ok I was getting help from a kind person on this problem and would like to see if anyone can help here is my code.
urls.py
urlpatterns = patterns('',
url(r'^venues/(?P<venue_id>\d+)/$','venues.views.venue', name='venue'),
views.py
def venue(request,venue_id):
venue= get_object_or_404(VenueProfile,
venue__pk=venue_id).select_related('venue')
return render_to_response('venues/venueprofile',{'venue',venue},
context_instance=RequestContext(request))
template
{% load url from future %}
{% for v in venues %}
{% with ven=v.venue profile=v %}
<a href="{% url 'venue' venue_id=venue.pk %}">{{ven.name}}</a>
now when I try to use this i get Reverse for ‘venue’ with arguments ‘()’ and keyword arguments ‘{‘venue_id’: ”}’ not found.Can anybody please help me here, and please keep in mind I left out some code like the {{venues}} object defined in a view.
Your
venueobject in your template is none, so it doesn’t have apk. In your template you aren’t passing anyvenuesobject either. Perhaps simplifying your code a bit will help:Adjusting your view method a bit:
Your template: