Make sure Pipenv is installed. Clone and change directory to the repo, then run
pipenv install # Create virtualenv and install deps
pipenv shell # Spawn a shell with our environment
nodeenv -p -r npm-requirements.txt # Install node.js requirements
You can exit out of the shell with exit
or ^D
Use manage.py
to setup everything. python3 manage.py full_setup
will
create the database, which is pretty much all you need.
Run pybabel compile -d teknologkoren_se/translations
to compile the
translations.
Set environment variable FLASK_APP
to teknologkoren_se/__init__.py
, then run
flask run
. To enable debugging, set FLASK_DEBUG
to 1
.
E.g.,
FLASK_APP=teknologkoren_se/__init__.py FLASK_DEBUG=1 flask run
Image paths have the optional /img(400|800|1600)/ which nginx understands but
Flask's developement server does not. Images with the resize path argument will
return 404. Setting DEBUG = True
in the config will however enable redirection
of those paths to the original image, making it possible to use Flask's server.