Django 04
virtualenv -p python 3 lesson 04 source bin/activate pip install --upgrade pip install django==1. 9
django-admin startproject trydjango 19
python manage. py runserver
settings. py
python manage. py migrate
python manage. py createsuperuser
http: //127. 0. 0. 1: 8000/admin/
python manage. py startapp posts
models. py
models. py
settings. py
python manage. py makemigrations
0001_initial. py
python manage. py migrate
https: //docs. djangoproject. com/en/1. 9 /ref/models/fields/
admin. py
https: //docs. djangoproject. com/en/1. 9 /ref/contrib/admin/
urls. py
crud. md
views. py urls. py 127. 0. 0. 1: 8000/posts/
https: //github. com/codingforentrepreneurs/Guides/blob/master/all/commo n_url_regex. md https: //docs. djangoproject. com/el/1. 10/topics/http/urls/
views. py, urls. py
settings. py
index. html, views. py
urls. py
views. py
index. html
http: //127. 0. 0. 1: 8000/posts/
python manage. py shell
views. py
http: //127. 0. 0. 1: 8000/posts/detail/
views. py, urls. py http: //127. 0. 0. 1: 8000/posts/detail/1/
http: //127. 0. 0. 1: 8000/posts/detail/1/ http: //127. 0. 0. 1: 8000/posts/detail/2/
urls. py http: //127. 0. 0. 1: 8000/posts/2/
index. html
urls. py index. html
models. py, index. html
urls. py, models. py, index. html
forms. py
views. py, post_form. html http: //127. 0. 0. 1: 8000/posts/create/
update
http: //127. 0. 0. 1: 8000/posts/3/edit/ http: //127. 0. 0. 1: 8000/posts/300/edit/
Редирект
Сообщения
https: //docs. djangoproject. com/en/1. 9 /ref/contrib/messages/
post_detail. html
И на edit и на create
post_detail. html