Prerequisites:
- pipenv if you want to run the app on your machine
- heroku CLI if you want to deploy to Heroku
Install the project:
git clone git@github.com:ir-regular/neuromart.git
pipenv install
To run a local version with code reloading and werkzeug debugger enabled:
pipenv shell
FLASK_APP=neuromart FLASK_ENV=development flask run
...and then go to http://127.0.0.1:5000/ in your browser.
Set up the above as a single-click action in PyCharm:
Note: I'm assuming you're using a Community Edition here; Pro edition integrates with Flask out of the box
- Make sure to run
pipenv installfirst - Run
pipenv --venvand note the directory somewhere - Edit Configurations
- Add New Configuration > Python
- Name: "neuromart (development)"
- Script path:
{output of pipenv --venv}/bin/flask - Parameters:
run - Environment variables:
PYTHONUNBUFFERED=1;FLASK_APP=neuromart;FLASK_ENV=development - Working directory: select your local neuromart project directory
- Save configuration by pressing OK
Now you can start the server from PyCharm and see the server output in Run tab.
Test Heroku deployment locally:
pipenv shell
heroku local web
...and then go to http://127.0.0.1:5000/ in your browser.