Homey cybernetic platform.
This is a Django codebase. Check out the Django docs for general technical documentation.
The Django project is srdce
. There is one Django app,
main
Django app, with all business logic.
Using venv:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements_dev.txt
This project also uses pip-tools for dependencies management.
You need to create a new file named .envrc
in the root of this project once you cloned it.
.envrc
should contain the following env variables:
SECRET_KEY="thisisthesecretkey"
DATABASE_URL="postgres://srdce@127.0.0.1:5432/srdce"
EMAIL_HOST_USER="smtp_user"
EMAIL_HOST_PASSWORD="smtp_password"
When on production use also include:
NODEBUG=1
This project uses PostgreSQL. See above on how to configure it using the
.envrc
file.
After creating your local database, you need to create the schema and apply the migrations:
python manage.py migrate
To run the Django development server:
python manage.py runserver
python manage.py test
For coverage, run:
coverage run --source='.' --omit 'venv/*' manage.py test
coverage report -m
The following tools are used:
make format
make lint
Deployment is configured using the production-grade uwsgi server.
uwsgi --ini=uwsgi.ini -H venv/
You also need to populate your shell environment:
export SECRET_KEY="thisisthesecretkey"
export DATABASE_URL="postgres://username:password@localhost:5432/db_name"
export EMAIL_HOST_USER="smtp_user"
export EMAIL_HOST_PASSWORD="smtp_password"
In addition to the standard Django management commands, there is also:
python manage.py reset_dev_database
Which fills some sample data for a development database.
This software is licensed under the MIT license. For more information, read the LICENSE file.