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
We don't teach ORM like a book β we treat it like a lab.
- F()
- bulk update
- race condition
- performance test all methods are executable.
- 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',
},
}
}
- Install dependencies (Pipfile):
pip install pipenv
than
pipenv install
- use Environment:
pipenv shell
OR
Ctrl+P
Python: Select Interpreter
- 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
- run in Terminal/CMD
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver