Skip to content

Instantly share code, notes, and snippets.

@solidpple
Created December 17, 2017 12:45
# polls/views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
# polls/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]
# mysite/urls.py
from django.urls import include, path
from django.contrib import admin
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment