I have my urls.py set up as follow right now:
urlpatterns = [
url(r'^(?P<content_type_name>[a-zA-z-_]+)$', views.content_type, name = 'content_type'),
]
This makes it so that this url will accept any word or string of words separated by - or _ or both. However, I want a regex that will accept only one of three words for the content_type_name parameter - 'comics', 'articles', 'videos'.
How do I set this up?
The following should do:
urlpatterns = [
url(r'^(?P<content_type_name>comics|articles|videos)$', views.content_type, name='content_type'),
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With