Skip to content

capn-nepal/website-backend

Repository files navigation

CMS Backend

Local development

Setup

Clone

git clone git@github.com:capn-nepal/website-backend.git backend
cd backend

Create a .env file

Important

NOTE: Overwrite/Set variables using .env

Available options are defined in docker-compose.yml and main/settings.py (env = environ.Env)

Build and pull images

docker compose pull
docker compose build

Run

Essentials

docker compose up

Web & Workers

docker compose up web worker worker-beat

Django migration commansd

# Create new migrations if required
docker compose exec web ./manage.py makemigrations

# Show migrations status
docker compose exec web ./manage.py showmigrations

# Run latest migrations
docker compose exec web ./manage.py migrate

User management commands

# Create new user
docker compose exec web ./manage.py createsuperuser

https://docs.djangoproject.com/en/latest/ref/django-admin/#createsuperuser

https://docs.djangoproject.com/en/5.1/ref/django-admin/#changepassword

Generate latest GraphQl schema

docker compose run --rm web ./manage.py graphql_schema --out schema.graphql
docker compose exec web ./manage.py graphql_schema --out schema.graphql

Tips

You can use django run command if there are no running instance for temporary commands

# If you want to generate latest GraphQl schema
# You can replace this command
docker compose exec web ./manage.py graphql_schema --out schema.graphql
# with this (Which will create a temporary container, run the command, and clean of the container)
docker compose run --rm web ./manage.py graphql_schema --out schema.graphql

About

Backend repository of CAPN website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages