开发者

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 %}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜