This repository contains all Žinau, ką renku platform code.
It's a standart Django based project. After cloning project:
- Create Python virtual environment
python -m venv virtual-env
Windows:
virtual-env\Scripts\activate.bat
Unix/MacOS:
source virtual-env/bin/activate
- Install project requirements using pip e.g
pip install -r requirements.txt
- Set environment variable
DEV=1
- Create Sqlite database file
db.sqlite3
or Postgres database and apply migrations usingpython manage.py migrate
- Fetch some data by running
python manage.py fetch_seimas_data
. You can see all possible Celery tasks inzkr/settings.py
nearCELERY_BEAT_SCHEDULE
- Start project using
python manage.py runserver
Once code is pushed to Master branch Travis should automatically deploy changes to the server.
Server environment is completely dockerized: Docker
and Docker-Compose
are used.
In very rare cases you may need to edit Docker environment file .env
in which all secrets are kept.
The structure of .env
file:
SECRET_KEY=[SECRET_KEY]
POSTGRES_USER=[POSTGRES_USER]
POSTGRES_PASSWORD=[POSTGRES_PASSWORD]
POSTGRES_HOST=[POSTGRES_HOST]
POSTGRES_DB=[POSTGRES_DB]
REDIS_PORT_6379_TCP_ADDR=[REDIS_PORT_6379_TCP_ADDR]
SENTRY_KEY=[SENTRY_KEY]
SENTRY_SECRET=[SENTRY_SECRET]
SENTRY_PROJECT_ID=[SENTRY_PROJECT_ID]
RECAPTCHA_PUBLIC_KEY=[RECAPTCHA_PUBLIC_KEY]
RECAPTCHA_PRIVATE_KEY=[RECAPTCHA_PRIVATE_KEY]
ALLOWED_HOSTS=[ALLOWED_HOSTS]
SENDGRID_API_KEY=[SENDGRID_API_KEY]
This file should be edited on the server.