Skip to content

Instantly share code, notes, and snippets.

@foxmask
Created August 12, 2012 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxmask/3335225 to your computer and use it in GitHub Desktop.
Save foxmask/3335225 to your computer and use it in GitHub Desktop.
Reverse for ''profiles_profile_detail'' with arguments
{% if user.is_authenticated %}
<a href="{% url 'profiles_profile_detail' user.username %}">Mon compte</a>
{% endif %}
l'appel du urls.py issue du module django-profiles :
url(r'^profiles/', include('profiles.urls')),
j'obtiens l'erreur :
Reverse for ''profiles_profile_detail'' with arguments '(u'foxmask',)' and keyword arguments '{}' not found.
from django.template import Context, loader
from monsite.models import Histo
from django.http import HttpResponse
def home(request):
latest_histo_list = Histo.objects.all().order_by('-date_created')[:5]
t = loader.get_template('home.html')
c = Context({
'latest_histo_list': latest_histo_list,
'user': request.user
})
return HttpResponse(t.render(c))
@foxmask
Copy link
Author

foxmask commented Aug 13, 2012

solution
{% if user.is_authenticated %}
Mon compte
{% endif %}

sans quote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment