Check python versions pyenv versions
then choose one to create new environment and activate:
pyenv virtualenv 3.8.13 django_sample
pyenv activate django_sample
Note if
base
still there allong withdjango_sample
, useconda deactivate
.
-
Create Project
django-admin startproject <projectname>
-
Create App
python manage.py startapp <appname>
-
Edit settings to add new apps
-
Create views
-
Map urls
-
Create tables in models
-
python manage.py migrate
-
python manage.py makemigrations my_app_1
-
python manage.py migrate
-
import tables at
my_app_1/admin.py
-
Create superuser with:
python manage.py createsuperuser
Start project and run server
django-admin startproject carrentals
python manage.py runserver
Create apps with
python manage.py startapp <appname>
inside the new app created we need to create the file urls.py
and then, link it to main app urls file at carrentals/urls.py