Django 0.96 and url
I want to get the absolute url of a given action in Django 0.96 (using Google App Engine).
I have this url configuration:
from django.conf.urls.defaults import patterns
开发者_如何转开发
urlpatterns = patterns('framework.facebook',(r'^canvas/invite_friends$','views.inviteFriends'),
)
In my template:
window._url = '{% url views.inviteFriends %}';
I don't understand why this doesn't work.
Syntax for url is package.package.module.function args so if you replace 'views' with your module/ application name it should work.
{% url app_name.inviteFriends %}
An example:
If the full path to your function is myproject.myapp.views.inviteFriends code would be:
{% url myapp.inviteFriends %}
or
{% url myproject.myapp.inviteFriends %}
精彩评论