-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |