views:

1665

answers:

3

I have: Python 2.6 Django 1.1.1 I downloaded Django-cms from git://github.com/digi604/django-cms-2.0.git I passed south off/on

I stuck on this:

After enabling south syncdb returns:

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.admin
 > django.contrib.sites
 > publisher
 > mptt
 > reversion
 > example.categories
 > south
 > example.sampleapp

Not synced (use migrations):
 - cms
 - cms.plugins.text
 - cms.plugins.picture
 - cms.plugins.file
 - cms.plugins.flash
 - cms.plugins.link
 - cms.plugins.snippet
 - cms.plugins.googlemap
 - cms.plugins.teaser
 - cms.plugins.video
 - cms.plugins.twitter
 - cms.plugins.inherit
(use ./manage.py migrate to migrate these)

startserver returns (when I open in browser 127.0.0.1:8000):

Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 279, in run
self.result = application(self.environ, self.start_response)

File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 651, in __call__
return self.application(environ, start_response)

File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py",
line 230, in __call__
self.load_middleware()

File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
line 42, in load_middleware
raise exceptions.ImproperlyConfigured,
'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware django.middleware.csrf:
"No module named csrf"

[25/Feb/2010 05:49:43] "GET / HTTP/1.1" 500 746

When I commented lines:

#'django.middleware.csrf.CsrfViewMiddleware',  - in MIDDLEWARE_CLASSES
#'django.core.context_processors.csrf', - in TEMPLATE_CONTEXT_PROCESSORS

i could run it now, but when I'm trying to add page i see:

Template error

In template /home/gennadich/Documents/django-cms-2.0/cms/templates/admin/cms/page/change_form.html, error at line 97
Invalid block tag: 'csrf_token'
+2  A: 

Now that you've disabled the CSRF modules, you no longer have any CSRF tags available. Either enable the CSRF modules or remove all CSRF tags.

Ignacio Vazquez-Abrams
It's my first run of Django-cms. What is CSRF need for?
Gennadich
Preventing cross-site request forgeries against your project.
Ignacio Vazquez-Abrams
Thanx a lot. I deleted csrf tag from "change_form.html" and now it works. For now it's enough for me for testing. But I still want to know how to run CMS with CSRF.
Gennadich
The CSRF functionality is in the development version (trunk) of Django. The error ImproperlyConfigured: Error importing middleware django.middleware.csrf:"No module named csrf"implies that you're not running a recent enough version of Django.
Brian Luft
Yes, problem was in Django version.
Gennadich
A: 

disable south or try postgresql. I ended up disabling south since i was just messing around on my dev machine

[EDIT]

this has worked for the latest pinax trunk too (Mar 22 2010)

[EDIT]

Try upgrading too the latest build of django, at this time 1.2 beta

John Spounias
A: 

And how do you disable south?

Also, would the right solution not be to just make sure that Django/Python can find csrf instead of disabling smth?

Thomas

Thomas