Procedure memo to start django continued
$cd project name
$ python manage.py startapp app name
At this stage
A folder that is
In the app
views.py
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return HttpResponse("Hello, World")
In the project
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app name'← Add
]
urls.py
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', 'app name.views.home')
]
Start up the server and complete
Recommended Posts