Skip to content

Instantly share code, notes, and snippets.

@gmocamilotd
Last active August 8, 2019 15:31
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 gmocamilotd/d949d08ccfa5e314a5666510c4eed679 to your computer and use it in GitHub Desktop.
Save gmocamilotd/d949d08ccfa5e314a5666510c4eed679 to your computer and use it in GitHub Desktop.
# 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