Skip to content

cloudintro/python-django-quickapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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