Django-cms template error in Django project

333 views Asked by At

I'm trying to run locally old Django 1.4 project which I have to upgrade and further develop. Everything is working fine on server. On my local I've got virtual environment set up using pip freeze from project on server and pip install. Project is using django-cms 2.3.8. Opening 127.0.0.0:8000 produces error:

Template error:

In template /home/user/projects/mprj/src/project/templates/menu/main_menu.html, error at line 6

   A template tag couldn''t find the page with lookup arguments `{'reverse_id': u'polls', 'site': 1}

`. The URL of the request was: http://example.com/

 6 :     <a href=" {% page_url "polls" %} " title="{% page_attribute "title" "polls" %}"> {% page_attribute "title" "polls" %} </a>



Traceback:

...
File "/home/user/.virtualenvs/mprj/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_context

  115.             page = _get_page_by_untyped_arg(page_lookup, request, site_id)

File "/home/user/.virtualenvs/mprj/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in _get_page_by_untyped_arg

  86.             raise Page.DoesNotExist(body)



Exception Type: DoesNotExist at /

Exception Value: A template tag couldn''t find the page with lookup arguments `{'reverse_id': u'polls', 'site': 1}

`. The URL of the request was: http://example.com/

Error occurs on {% page_url "polls" %}. It's not clear for me, where should reverse_id be set. I can't figure it out from django-cms docs. Also it doesn't seem to be issue of http://example.com/ URL. Error still occurs when I add 127.0.0.1:8000 site to database and set corresponding SITE_ID in settings.py. What should I set properly in order to make it work like it does on the server?

0

There are 0 answers