2
votes

I have been working through the tutorial of Django CMS afer finishing the poll tutorial in Django. Everything seems to work perfectly in Django, however, when I tried to run the new page in Django-CMS after following http://docs.django-cms.org/en/latest/extending_cms/extending_examples.html#, I stuck on the problem where i got

NoReverseMatch at /polls/
u'polls' is not a registered namespace

1   <h1>Question available here</h1>
2   {% if latest_poll_list %}
3       <ul>
4       {% for poll in latest_poll_list %}
5           <li><a href="{% url 'polls:detail' poll.id %}">{{ poll.question }}</a>      </li>
6       {% endfor %}
7       </ul>
8   {% else %}
9       <p>No polls are available.</p>
10  {% endif %}

So it seems the polls is not recognized by the template there.

So the questions are:

  1. Does django-cms tutorial not synchronized really well with django tutorial?
  2. If it is the problem of namespace, how could I put a namespace with django-cms way? I have been trying to put app_name attribute in cms_app.py but it's still not working..
  3. When following the tutorial, I have been asked to create a new template, which I assume called plugin.html because of

    render_template = "polls/plugin.html"
    

    But when I was looking at stack trace, the file is still looking in index.html. so... What's the usage of the plugin.html?

1
upvoted, b/c didn't see why your question should be in the negative. - pymarco

1 Answers

0
votes

So i got it working by re-adding:

    (r'^polls/', include('polls.urls')) in the main urls.py

I am not sure why it has to be done this way because the tutorial explicitly gives an instruction to remove the line. However, maybe this is related to this problem https://github.com/divio/django-cms/issues/1858 .

I am working with django version 1.5 and django-cms 3.0.0beta