Skip to content

Kongl. Teknologkören's amazing website ✨🧁🎶

License

Notifications You must be signed in to change notification settings

teknologkoren/teknologkoren.se-v2

Repository files navigation

teknologkoren.se-v2

Setup a development environment

Create a virtual environment:

python3 -m venv venv

Activate the environment:

. venv/bin/activate

Now you may either use pip directly to install the dependencies, or you can install pip-tools. The latter is recommended.

pip

pip install -r requirements.txt

pip-tools

pip-tools can keep your virtual environment in sync with the requirements.txt file, as well as compiling a new requirements.txt when adding/removing a dependency in requirements.in.

pip install pip-tools
pip-compile  # only necessary when adding/removing a dependency
pip-sync

Populating a mock database

flask initdb
flask populatetestdb

This will create the database and populate it with some mock data. Posts, events and pages are generated from some paragraphs of "lorem ipsum" and a bit of random "logic".

Running a test instance

FLASK_DEBUG=1 flask run

Create an admin user

flask createadmin

You will be prompted for a username and password.

Migrations

From the root directory, run

python3 -m migrations.<name_of_migration>

As it is run as a module, do not include the file extension (.py).