matching query does not exist Python Django -


I am programming in Django 1.4.3 with Python 2.7 in Windows Vista, from which the website is being offered . So I have various products listed in my / productive subpage. Now I am trying to display page / product / / which is to show that page with the product listed Shows This is my urls.py , which acts as the index of my pages: , url urlpatterns = patterns ('Demo.apps.home.views', url (r '^ $', 'index_view', name = 'vista_principal'), url (r '^ about / $', 'about_view', name = 'vista_about') , Url (r '^ productos / $', 'productos_view', name = 'vista_productos'), url (r '^ producto / (? P> id_prod & gt; *) / $', 'singleProduct_view', name = 'Vista_single_producto'), url (r '^ contacto / $', 'contacto_view', name = 'vista_contacto'), url (r '^ login / $', 'login_view', name = 'vista_login'), url R '^ logout / I have a singleProduct_view function in views.py I $$,' logout_view ', name =' vista_logout '),) < / Pre>

> That product Recovers and feeds it on my website

  def singleproduct_view (request, id_prod): prod = producto.objects.get (id = id_prod) ctx = {'producto': prod} Return to Render_to_reponse ('home / SingleProducto.html', Ctx, context_instance = RequestContext (Request))   

However, when I type / producto / 2, I producto match query does not exist 'error' What's the problem?

Well, this fact may well be that with an Integerfield Unicode string, However changing the proposed URL may not help you get rid of the error. Because you will still get the argument in the form of a string.

However, you should change the argument id_prod to int and also ensure that id = 2

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -