Skip to content

Instantly share code, notes, and snippets.

@gmocamilotd
Last active Aug 8, 2019
Embed
What would you like to do?
# antiguo
from django.conf.urls import url
url(r'^login/$', views.user_login, name='login'),
url(r'^detail/(?P<id>\d+)/(?P<slug>[-\w]+)/$',views.image_detail, name='detail'),
url(r'^users/(?P<username>[-\w]+)/$', views.user_detail, name='user_detail'),
# nuevo
from django.urls import path
path('login/', views.user_login, name='login')
-------------------
urlpatterns = [
path('articles/2003/', views.special_case_2003),
path('articles/<int:year>/', views.year_archive),
path('articles/<int:year>/<int:month>/', views.month_archive),
path('articles/<int:year>/<int:month>/<slug:slug>/', views.article_detail),
path('articles/<slug:title>/', views.article, name='article-detail'),
path('articles/<slug:title>/<int:section>/', views.section, name='article-section'),
path('users/<username>/', views.user_detail, name='user_detail')
path('weblog/', include('blog.urls')),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment