I am trying to pass a pipe delimited string as a parameter in my url in django, but it fails to route to the respective view.
This is my pipe delimited string:
"main/1|adel|1|1989-09-19|1|1|test alert|2018-03-16-09-26-00|test module|1|1|test encounter"
and this is my url pattern:
from django.conf.urls import url
from django.views.generic import RedirectView
from alerter import views
app_name = 'alerter'
urlpatterns = [
url(r'^main/(?P<message>[a-zA-Z0-9_]+)/$',
views.TheView.as_view({'get': 'view'}), name = 'main'),
]
wordswhile you are passing words and special characters...\w+with\S+. or pass the message as url parameter\S+will capture/in the URL, but yes, the solution is to use an appropriate regex.