Django application for the DDP platform's management backend. Exposes API endpoints for the management frontend to communicate with, for the purposes of
Pep8
has been used to standardized variable names, classes, module names etc.Pylint
is the linting tool used to analyze the code as per Pep8 style.Black
is used as the code formatter.black
{ "editor.defaultFormatter": null, "python.linting.enabled": true, "python.formatting.provider": "black", "editor.formatOnSave": true }
pylint ddpui/
celery -A ddpui worker -n ddpui
celery -A ddpui worker -n ddpui -P solo
celery -A ddpui beat
pyenv local 3.10
pyenv exec python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
.env
from .env.template
create a SQL database and populate its credentials into .env
You can use a postgresql docker image for local development
docker run --name postgres-db -e POSTGRES_PASSWORD=<password> -p 5432:5432 -d <db name>
DBNAME=<db name>
DBHOST=localhost
DBPORT=5432
DBUSER=postgres
DBPASSWORD=<password>
DBADMINUSER=postgres
DBADMINPASSWORD=<password>
.env
AIRBYTE_SERVER_HOST=
AIRBYTE_SERVER_PORT=
AIRBYTE_SERVER_APIVER=
AIRBYTE_API_TOKEN= <token> # base64 encryption of username:password. Default username and password is airbyte:password and token will be YWlyYnl0ZTpwYXNzd29yZA==
AIRBYTE_DESTINATION_TYPES=
.env
PREFECT_PROXY_API_URL=
DEV_SECRETS_DIR
in .env
unless you want to use Amazon's Secrets ManagerOpen a new terminal
Create a local venv
, install dbt
and put its location into DBT_VENV
in .env
pyenv local 3.10
pyenv exec python -m venv <env-name>
source <env-name>/bin/activate
python -m pip install \
dbt-core \
dbt-postgres \
dbt-bigquery
CLIENTDBT_ROOT
CLIENTDBT_ROOT=
DBT_VENV=<env-name>/bin/activate
SIGNUPCODE
in .env
is for signing up using the frontend. If you are running the frontend, set its URL in FRONTEND_URL
DJANGOSECRET=
Create logs folder in ddpui
create whitelist.py
from .whitelist.template.py
in ddpui > assets folder
Run DB migrations python manage.py migrate
Seed the DB python manage.py loaddata seed/*.json
Start the server python manage.py runserver
python manage.py createorganduser <Org Name> <Email address>
Follow the steps below:
.env
from .env.template
inside the Docker folderwhitelist.py
fileIf using M1-based MacBook run this before building image
export DOCKER_DEFAULT_PLATFORM=linux/amd64
docker build -f Docker/Dockerfile.main --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t dalgo_backend_main_image:0.1 .
This will create the main imagedocker build -f Docker/Dockerfile.dev.deploy --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t dalgo_backend:0.1 .
docker-compose -f Docker/docker-compose.dev.yml up