Skip to content

Commit

Permalink
Merge 960c10e into 416a8d5
Browse files Browse the repository at this point in the history
  • Loading branch information
javabrett authored Aug 21, 2018
2 parents 416a8d5 + 960c10e commit 785b4b4
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions etc/pythonanywhere/pythonanywhere_com_wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
This script is a WSGI configuration/setup file suitable for use in
deploying the Flasgger demo_app to PythonAnywhere, https://www.pythonanywhere.com/ .
To deploy:
- Create a PythonAnywhere account if you don't already have one. Replace <username>
below with your PythonAnywhere username.
- Visit https://www.pythonanywhere.com/user/<username>/webapps and create a new/default
web app, using Manual Configuration and Python 3.6.
- Confirm you can access the Hello, World! page at https://<username>.pythonanywhere.com/ .
- Visit https://www.pythonanywhere.com/user/<username>/consoles/ and create a new bash console.
- From your home directory /home/<username>, run:
git clone https://github.com/rochacbruno/flasgger.git
... or use another fork.
- cd ~/flasgger, then change to whichever branch you want to use.
- Create a new virtual environment:
mkvirtualenv --python=python3.6
- Run: pip3 install -r requirements.txt -r requirements-dev.txt
- cd /var/www
- rm ${USERNAME}_pythonanywhere_com_wsgi.py
- ln -s ~/flasgger/etc/pythonanywhere/pythonanywhere_com_wsgi.py ${USERNAME}_pythonanywhere_com_wsgi.py
- Go to the web app console at https://www.pythonanywhere.com/user/<username>/webapps .
- Modify the configuration:
- Make the source path /home/<username>/flasgger
- Make the working directory /home/<username>/flasgger
- Change the virtual env path to /home/<username>/.virtualenvs/flasgger
- Reload the web app.
- Visit https://<username>.pythonanywhere.com/ and you should see the demo_app landing page.
- If an error occurs, review the log files.
"""
import os
import sys

home = os.path.expanduser("~")
path = os.environ.get('FLASGGER_HOME') or home + '/flasgger'

if path not in sys.path:
sys.path.append(path)

from demo_app.app import application

0 comments on commit 785b4b4

Please sign in to comment.