-
Create a project folder, such as hello_django
-
sudo apt-get install python3-venv # If needed
-
python3 -m venv .venv
-
source .venv/bin/activate
-
python -m pip install --upgrade pip
-
python -m pip install django
-
-
Create the Django project
- django-admin startproject web_project .
-
Create an empty development database
- python3 manage.py migrate
-
Run server
- python manage.py runserver
-
Create a Django app
- python manage.py startapp hello
-
Work with data, data models, and migrations
- Make changes to the models in your models.py file.
- Run python manage.py makemigrations to generate scripts in the migrations folder that migrate the database from its current state to the new state.
- Run python manage.py migrate to apply the scripts to the actual database.
congle16 / django-tutorial Goto Github PK
View Code? Open in Web Editor NEWInternship Paradox