Skip to content

This repository include the source codes of the article about django optimization tips 2.

Notifications You must be signed in to change notification settings

Kadermiyanyedi/django-select-related-prefetch-related-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Select Related & Prefetch Related Example

This repository include the source codes of the article about django optimization tips 2.

Setup

Create a virtual environment to isolate our package dependencies locally

virtualenv -p python3 .venv
source .venv/bin/activate
pip install -r requirements.txt

For poetry users:

poetry install
poetry shell

Migrate Database & Load Initial Data

cd backend
python manage.py migrate

python manage.py loaddata user.yaml
python manage.py loaddata country.yaml
python manage.py loaddata product.yaml

Admin Panel Login Credentials & Start Server

username: admin
password: secret1secret

If you want create a new super user : python manage.py createsuperuser --email xxx --username xxx

python manage.py runserver

Go to localhost:8000 in your browser

About

This repository include the source codes of the article about django optimization tips 2.

Topics

Resources

Stars

Watchers

Forks

Languages