Skip to content

sinalalebakhsh/Django-ORM-Playground

Repository files navigation

πŸš€-Django-ORM-Playground

Build a Django project that:

  • Focuses only on ORM Every scenario is executable + explainable + testable Can be easily extended later (blog, PDF, course) README FARSI

Steps English:

Click here...

πŸ“Œ Important note:

We don't teach ORM like a book β†’ we treat it like a lab.

πŸ“Œ This model is intentionally designed so that:

  • F()
  • bulk update
  • race condition
  • performance test all methods are executable.

How to run:

  1. connect DATABASE (MySQL,Mongo,PostgreSQL,OR ...)
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'orm_playground',
        'HOST': 'localhost',
        'USER': 'root',
        'PASSWORD': '1234',
        'OPTIONS': {
            'charset': 'utf8mb4',
        },
    }
}
  1. Install dependencies (Pipfile):
pip install pipenv

than

pipenv install
  1. use Environment:
pipenv shell

OR
Ctrl+P

Python: Select Interpreter

  1. MySQL Workbench: Create a new SQL tab for executing queries:

Select first line and click on thunder ⚑
than select second line and click on thunder too:
DROP DATABASE orm_playground;
CREATE DATABASE orm_playground;

result:

orm_playground created

  • if do not see it in Navigator -> SCHEMAS tab -> Right Click and Refresh all

Now You can see it

  1. run in Terminal/CMD
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

All Steps from first development ... β†’

About

πŸ’š Build a Django project that: Focuses only on ORM Every scenario is executable + explainable + testable Can be easily extended later (blog, PDF, course)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors