I'm having issues with a named URL pattern in my code. Django does not
seem to be finding the correct URL when the {% url %} and reverse( )
tag/functions are used.

the urls.py file at app_root/project/urls.py contains:

from django.views.generic import list_detail, create_update
from maverick.project.models import Project
from django.conf.urls.defaults import patterns, url
from django.core.urlresolvers import reverse

urlpatterns = patterns('maverick.project.views',
    url(r'^$', list_detail.object_list, {'queryset':
Project.objects.all()}, 'project-home'),
    url(r'^new$', create_update.create_object, {'model': Project,
'post_save_redirect': reverse('project-home')}, 'project-new'),
)

and I am referencing the URL pattern (in addition to in the second
link) in the file app_root/home/templates/base.html:

<html>
        <head>
                <link type="text/css" rel="stylesheet" href="/site_media/
maverick.css">
                <title>Maverick</title>
        </head>
        <body>
                <div id="nav">
                        <a href="{% url project-home %}">Projects</a>
                        <a href="{% url calibration-home %}">Calibrations</a>
                </div>
                <div id="menu">
                        {% block section_menu %}{% endblock %}
                </div>
                <div id="content">
                        {% block content %}{% endblock %}
                </div>
                <div id="footer">
                        {% block footer %}{% endblock %}
                </div>
        </body>
</html>

If you need more information, just let me know what to post.

Cheers,

David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to