https://docs.djangoproject.com/en/1.9/intro/
###SETUP:
$ django-admin startproject mysite$ python manage.py runserver / $ python manage.py runserver 0.0.0.0:8000
$ python manage.py startapp polls
views.py:
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
urls.py:
urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]
###DB: mysite/settings.py
DATABASES = ENGINE , NAME
###MODELS: models.py
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
###MIGRATIONS:mysite/settings.py
INSTALLED_APPS = [
'polls.apps.PollsConfig', ….
$ python manage.py makemigrations polls
$ python manage.py sqlmigrate polls 0001
$ python manage.py migrate
###ADMIN:
$ python manage.py createsuperuser