Hi everyone,
I've created a django CMS apphook. Unfortunately I'm not able to reverse
apphook urls using the Python shell.
The cms_app.py file looks like:
class ArticleApp (CMSApp):
name = _('Article App')
app_name = 'article_app'
urls = ['article.urls']
apphook_pool.register(ArticleApp)
This is my urls.py file:
urlpatterns = patterns('',
url(r'^(?P<slug>[\w\-]+)?', ArticleView.as_view(), name=
'article-by-slug'),
)
The template file is:
{% url 'article_app:article-by-slug' article.slug %}
URL reversing inside the template performs like expected. If I try to do
the same using the Python shell I receive an error message:
>>> from django.core.urlresolvers import reverse
>>> from article.models import Article
>>> a = Article.objects.get(pk=1)
>>> reverse('article_app:article-by-slug', kwargs={'slug': a.slug})
# Reverse for 'article_app:article-by-slug' with arguments '()' and keyword
arguments '{'slug': 'this-is-article-1'}' not found.
Additional urls defined in the main urls.py work like expected from inside
the shell. Only apphook urls don't work.
Any suggestions? I appreciate your help!
Thank you!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/54b254d4-eb9c-468a-91b2-201fee0a8c1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.