Running the Project¶
There are two main ways that the portal_server project can be run:
Flask’s built-in server¶
Flasks built in development server is useful for its live reload functionality.
- Make sure you are in the virtual env and at the project root
- Start the server with $ python run.py
Gunicorn¶
Gunicorn is the WSGI server used in production but it can also be run on your development machine.
- Make sure you are in the virtual env and at the project root
- Start the server with $ gunicorn -w 4 portal_server:app
Configuration¶
Runtime configuration works the same way either way you choose to run the project.
- Just set the
FLASK_CONFIGURATIONenvvar to one of the options found in__init__.py- e.g. to set the config to development run:
$ export FLASK_CONFIGURATION="development"
- e.g. to set the config to development run:
If you are having problems with setting up the envvar try these steps
- Make sure the user you are setting the envvar on is the same one running the project.
- Try debugging the envvar using some of the commands from this digital ocean guide.
Configuration Options are stored at the portal_server package root in the config.py and init.py files.
For help on understanding these files see Flask’s config docs.