views:

23

answers:

1

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.

+2  A: 

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 %}
sunn0
I've also tried with the full path to the package and that doesn't work.
Pierre Valade
What is the complete path to your view function?
sunn0