Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python regular expression path

from django.urls import path, re_path

from . import views

urlpatterns = [
    path('articles/2003/', views.special_case_2003),
    re_path(r'^articles/(?P<year>[0-9]{4})/$', views.year_archive),
    re_path(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', views.month_archive),
    re_path(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<slug>[w-]+)/$', views.article_detail),
]
Comment

PREVIOUS NEXT
Code Example
Python :: stripe white space django template 
Python :: x and y in python 
Python :: BMI CALCULATOR CODE IN PYTHON 
Python :: np logical and 
Python :: Create an x amount of unique random fixed size strings 
Python :: the most effective search algorithm in python 
Python :: print two values using f string 
Python :: kite order syntax 
Python :: flask how to initialze extension after start 
Python :: how to truncate a float in jinja template 
Python :: how to calculate the area and perimeter of a shape in python 
Python :: python package for facial emotion recognition 
Python :: python cheat sheets 
Python :: python data manipulation_16.06.2022 
Python :: 100 days of python 
Python :: 1043 uri solution 
Python :: iterate over batch of dict keys at once python 
Python :: basic decorator example 
Python :: 5.2.5: Counting 10 to 100 by ... 
Python :: index is datetime and i want the row number 
Python :: calculate speed with time in datetime python 
Python :: What is the purpose of open ( ) and close ( ) in os 
Python :: python get text between two comma 
Python :: matplotlib x tlabels ax.set_xlabel 
Python :: how is pythons glob.glob ordered list 
Python :: how to wirte something 100 times with python 
Python :: pass in 2 numbers, A and B. You should create a list with A rows and B columns, then populate each cell 
Python :: Build the union of a list of RDDs 
Python :: use reshape in python with zeros 
Python :: python set table widget header 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =