Learning Python - Django

How to run?

  1. Start server:
python manage.py runserver
  1. Login admin page: http://127.0.0.1:8000/admin
  2. Check the main page: http://127.0.0.1:8000/home

How to edit?

To update the model (table in database):
  1. Go to models.py of the app (this example is home) and create new class or update class fields
  2. Update to database

Create new app:

  1. Run this command
python manage.py startapp {{app_name}} 
  1. Go to settings.py and add name of app config to INSTALLED_APPS Example new app is demo: demo.apps.DemoConfig (or go to apps.py to check the name)
  2. Update to database
Update to database
python manage.py makemigrations
python manage.py migrate