Skip to content

Instantly share code, notes, and snippets.

@delwar2016
Last active March 7, 2017 06:12
Show Gist options
  • Save delwar2016/610a2d5238bb28a4a9cc395828a7485d to your computer and use it in GitHub Desktop.
Save delwar2016/610a2d5238bb28a4a9cc395828a7485d to your computer and use it in GitHub Desktop.
kick-start - django
Installtion
pip install django
Create Project
django-admin startproject home
Run server
python manage.py runserver
Django relies on a three-part process for adding Web pages
1) Templates - the layout and appearance
2) Views - the logic or actual database-driven content
3) URLs - the location, for example /about/
python manage.py migrate
Creating models
Activating models
python manage.py makemigrations polls
for migrate for first time
python manage.py migrate
if add/ change any things then first run
python manage.py makemigrations
then
python manage.py migrate
three-step guide to making model changes:
* Change your models (in models.py).
* Run python manage.py makemigrations to create migrations for those changes
* Run python manage.py migrate to apply those changes to the database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment