-
create django-project
pip install django
django-admin startproject --template=https://github.com/KimSoungRyoul/django-backend-starter-template/archive/main.zip hello_django_project
-
create virtualenv(venv) using poetry & install library
poetry config virtualenvs.in-project true # if true .venv was created in PROJECT ROOT poetry shell poetry install
-
[Optional] install pre-commit config
- if you want always run black&isort before commit
pre-commit install
- pre-commit run (reformatting)
pre-commit run --files apps/**/**
-
[Optional] if you want to use not only sqlite3
docker compose -f docker/compose.yaml up -d
-
django migration
python apps/manage.py migrate
-
create superuser for test
python apps/manage.py createsuperuser --username=root --email=kimsoungryoul@gmail.com
-
django runserver
python apps/manage.py runserver 8000
-
you can see default API Docs in http://localhost:8000/docs
8-1. get JWT Token with Login API
8-2. set JWT Token to API Docs
8-3. you can use other APIs
- install docker first install docker desktop
- docker build
docker build -f docker/application.dockerfile -t django-backend-starter-application:1.0.0 .
- docker run
docker run -d -p "8000:8000" --rm --name django-backend-application django-backend-starter-application:1.0.0