A simple web application created using Python Flask in a purely server rendered manner. See task.py
for usage commands.
Before the project can be setup, please ensure the following tools are installed on the system
nodejs
/npm
- For installing front-end dependenciesvenv
- For creating python virutal environments
Once the above tools have been setup on your system, run the following commands.
# create a new virutual environment
$ python -m venv .venv
# activate the environment
$ . .venv/bin/activate
# install back-end dependencies (listed inside pyproject.toml file)
$ pip install .
# install front-end dependencies
$ npm i -D
# create the .env file
$ cp -v .env.example .env
A unique secret key is required by the application for security reasons. Generate
the key using the following command and the value inside .env
file
$ invoke gensecret
# ensure the database is initialized
$ invoke dbinit
# run the migrations
$ invoke dbmigrate
Note: Migrations can also be run through flask shell
# open the application shell
$ invoke shell
>>> from app import db
>>> db.create_all()