google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

new install with no page #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With the latest django-page-cms source tree, a new install with no pages
generate an error when you try to create the first page in the admin:

TemplateSyntaxError at /admin/pages/page/add/

Caught an exception while rendering: Failed lookup for key [current_page]
in u"[{'PAGES_MEDIA_URL': '/media/pages/', 'PAGE_USE_SITE_ID': False},
{'request': <WSGIRequest\nGET:<QueryDict: {}>,\nPOST:<QueryDict:
{}>,\nCOOKIES:{},\nMETA:{'HTTP_HOST': 'testhost',\n 'PATH_INFO': u'/',\n
'REQUEST_METHOD': 'GET',\n 'SCRIPT_NAME': u'',\n 'SERVER_NAME': 'test',\n
'SERVER_PORT': '8000'}>}, {'MEDIA_URL': '/media/'}, {}, {'LANGUAGES':
(('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca',
'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de',
'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('et',
'Estonian'), ('es-ar', 'Argentinean Spanish'), ('eu', 'Basque'), ('fa',
'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('ga', 'Irish'), ('gl',
'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr',
'Croatian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'),
('ka', 'Georgian'), ('ko', 'Korean'), ('km', 'Khmer'), ('kn', 'Kannada'),
('lv', 'Latvian'), ('lt', 'Lithuanian'), ('mk', 'Macedonian'), ('nl',
'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'),
('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv',
'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr',
'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw',
'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'fr'},
{'perms': <django.core.context_processors.PermWrapper object at 0x979ad6c>,
'messages': [], 'user': <django.contrib.auth.models.AnonymousUser object at
0x979ae6c>}, {}]"

Request Method:     GET
Request URL:    http://127.0.0.1:8000/admin/pages/page/add/
Exception Type:     TemplateSyntaxError
Exception Value:    

Caught an exception while rendering: Failed lookup for key [current_page]
in u"[{'PAGES_MEDIA_URL': '/media/pages/', 'PAGE_USE_SITE_ID': False},
{'request': <WSGIRequest\nGET:<QueryDict: {}>,\nPOST:<QueryDict:
{}>,\nCOOKIES:{},\nMETA:{'HTTP_HOST': 'testhost',\n 'PATH_INFO': u'/',\n
'REQUEST_METHOD': 'GET',\n 'SCRIPT_NAME': u'',\n 'SERVER_NAME': 'test',\n
'SERVER_PORT': '8000'}>}, {'MEDIA_URL': '/media/'}, {}, {'LANGUAGES':
(('ar', 'Arabic'), ('bn', 'Bengali'), ('bg', 'Bulgarian'), ('ca',
'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de',
'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('et',
'Estonian'), ('es-ar', 'Argentinean Spanish'), ('eu', 'Basque'), ('fa',
'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('ga', 'Irish'), ('gl',
'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr',
'Croatian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'),
('ka', 'Georgian'), ('ko', 'Korean'), ('km', 'Khmer'), ('kn', 'Kannada'),
('lv', 'Latvian'), ('lt', 'Lithuanian'), ('mk', 'Macedonian'), ('nl',
'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'),
('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv',
'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr',
'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw',
'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'fr'},
{'perms': <django.core.context_processors.PermWrapper object at 0x979ad6c>,
'messages': [], 'user': <django.contrib.auth.models.AnonymousUser object at
0x979ae6c>}, {}]"

Exception Location: 
/usr/local/lib/python2.6/dist-packages/django/template/debug.py in
render_node, line 81

Original issue reported on code.google.com by d...@denishofmann.net on 6 Oct 2009 at 2:10

GoogleCodeExporter commented 9 years ago
I can't reproduce this bug, can you try again?

What is the template tag that generate this error?

Original comment by batiste....@gmail.com on 7 Oct 2009 at 6:52

GoogleCodeExporter commented 9 years ago
Yes, just delete all the pages you have on your site, try to create a new one 
and
you'll get the bug.

I don't have any page in db. Perhaps it comes from that ?
Attached file is my sqlite db.

template is "index.html" 

Original comment by d...@denishofmann.net on 7 Oct 2009 at 1:40

Attachments:

GoogleCodeExporter commented 9 years ago
I was debugging this problem with Denis. If I understand it well, the details() 
view
of django-page-cms is called when adding a new page in the admin (to get form
widgets?). And when there is no page, the view returns a Http404 error, hence 
the
problem. Does it make sense?

Original comment by cla...@2xlibre.net on 8 Oct 2009 at 8:10

GoogleCodeExporter commented 9 years ago
Yes it make sense. For getting the placeholders the admin has to render the 
actual 
templates. I was using the details view to get an appropriate context. 

What version of the CMS do you use? Because I think now the admin is not making 
this 
call to details view anymore. Do you use the latest release or the trunk?

Original comment by batiste....@gmail.com on 8 Oct 2009 at 11:07

GoogleCodeExporter commented 9 years ago
With no new input, I consider this as fixed.

Original comment by batiste....@gmail.com on 27 Oct 2009 at 8:56