Saturday, September 23, 2017

Re: capturing url pattern from html forms



On Sep 23, 2017 1:27 PM, "Mel DeJesus" <meldejesus22@gmail.com> wrote:
Unfortunately, I didn't show my entire URLpatterns list, and the ^item/$  seems to interfere with the ^$ of the previous:  Any suggestions for a work around? thanks again. 

from django.conf.urls import include, url
from django.contrib import admin
from rest_framework.urlpatterns import format_suffix_patterns
from durham_app import views

urlpatterns = [
# Examples:
url(r'^admin/', include(admin.site.urls)),

url(r'^$', views.index, name='index'),
url(r'^item/$', views.item_detail, name='item_detail'),
url(r'^items/', views.ItemList.as_view()),
]

urlpatterns = format_suffix_patterns(urlpatterns)


There isn't really a reason that any of those URL patterns would interfere with each other. I'd change the last one to r'items/$', but otherwise they look fine.

What do you mean by 'interfere'?

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciU_e0k8eLpt%2BjJvRGFPsg%2B_Gota6F5Z0omrm9-xhg1dgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment