Skip to content

Latest commit

 

History

History
31 lines (28 loc) · 1.18 KB

README.MD

File metadata and controls

31 lines (28 loc) · 1.18 KB

Django quick start app

Getting started with Django - Basic application

pip install Django

  • Create application

django-admin startproject mysite

  • Migrate the pre-installed apps to use them with your project

python manage.py migrate

  • Create admin user

python manage.py createsuperuser

  • Run the application. If port is not specified, default is 8000

python manage.py runserver 8080

Some commands used during this app development

  • Create new app polls inside base app

python manage.py startapp polls

  • Generate the model SQLs before migrate

python manage.py sqlmigrate polls 0001

  • Migrate the change to use

python manage.py migrate

  • After changing models(in models.py) migrate those changes

python manage.py makemigrations

  • Apply model changes to the database

python manage.py migrate

  • Test the polls app

python manage.py test polls