Created
April 27, 2016 13:41
-
-
Save rygelouv/3876bb03489a9d91b232281f2b64581b to your computer and use it in GitHub Desktop.
the fu***g urls.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""digitalmarket URL Configuration | |
The `urlpatterns` list routes URLs to views. For more information please see: | |
https://docs.djangoproject.com/en/1.8/topics/http/urls/ | |
Examples: | |
Function views | |
1. Add an import: from my_app import views | |
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') | |
Class-based views | |
1. Add an import: from other_app.views import Home | |
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') | |
Including another URLconf | |
1. Add an import: from blog import urls as blog_urls | |
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) | |
""" | |
from django.conf.urls import include, url | |
from django.contrib import admin | |
urlpatterns = [ | |
url(r'^admin/', include(admin.site.urls)), | |
url(r'^detail/(?P<object_id>\d+)/$', 'products.views.detail_view', name='detail_view'), | |
url(r'^detail/(?P<slug>[\w)]+)/$', 'products.views.detail_slug_view', name='detail_slug'), | |
url(r'^list/$', 'products.views.list_view', name="list_view"), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment