Awesome, thanks! Following your suggestion, I went to views and I assigned the request.GET['id'] to a variable and was able to use it!
On Saturday, September 23, 2017 at 3:41:16 PM UTC-4, Daniel Roseman wrote: > > > > On Saturday, 23 September 2017 19:48:37 UTC+1, Mel DeJesus wrote: >> >> >> Hi - >> >> If the number '1' is submitted with the form below, the following url is >> created: http://localhost:8000/item/?id=1 >> >> But I continually get a page not found. How can I style the regex in the >> urlpatterns so that this url registers? Thanks. >> >> <form id="form" form action = "item/" method="get"> >> Item Name:<br> >> <input id="entry" type="text" name="id"><br> >> <br><br> >> <input type="submit" value="Submit"> >> </form> >> >> I'm attempting to capture here: >> >> urlpatterns = [ >> # Examples: >> url(r'^admin/', include(admin.site.urls)), >> # url(r'^item\/\?id=(?P<id>\d+)/', views.item_detail, name='item_detail'), >> url(r'^item/(?P<id>\d+)/', views.item_detail, name='item_detail'), >> # JSON files >> >> >> > > GET parameters are not captured in URL patterns. Just accept `^item/$` and > get the data inside the view via `request.GET['id']`. > -- > DR. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/f368a66e-0602-4dba-aad7-f832b22a4b32%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

