Skip to content

Instantly share code, notes, and snippets.

@ILoveBacteria
Created March 4, 2023 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ILoveBacteria/d375fed2637f39e2733213b910e0666f to your computer and use it in GitHub Desktop.
Save ILoveBacteria/d375fed2637f39e2733213b910e0666f to your computer and use it in GitHub Desktop.
Create paths in Django
# mysite/urls.py
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]
# polls/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment