Last active
March 7, 2017 06:12
-
-
Save delwar2016/610a2d5238bb28a4a9cc395828a7485d to your computer and use it in GitHub Desktop.
kick-start - django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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