Writing your first Django app
建立專案
1 | django-admin startproject mysite |
啟動 Server
1 | python manage.py runserver |
建立 Polls App
1 | python manage.py startapp polls |
建立一個 views.py
1 | from django.http import HttpResponse |
建立一個 urls.py
1 | from django.urls import path |
修改 mysite/urls.py
1 | from django.contrib import admin |
在 run 一次就可以看到剛剛寫的 Hello, world. You’re at the polls index.
1 | python manage.py runserver |