WebFaction
Community site: login faq

Hi,

I have set up a project using django cms in my webfaction account, mostly following this tutotial : http://racingtadpole.com/blog/django-cms-with-webfaction

I have done everything except creating the database, which returns the following error :

AttributeError: 'function' object has no attribute 'decode'

And when I go to the main page of my site, here is the error I get :

Environment:

Request Method: GET
Request URL: url

Django Version: 1.5.2
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'djangocms_text_ckeditor',
 'cms',
 'cms.stacks',
 'mptt',
 'menus',
 'south',
 'sekizai',
 'djangocms_admin_style',
 'django.contrib.admin',
 'cms.plugins.file',
 'cms.plugins.flash',
 'cms.plugins.googlemap',
 'cms.plugins.link',
 'cms.plugins.picture',
 'cms.plugins.snippet',
 'cms.plugins.teaser',
 'cms.plugins.video',
 'reversion')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')

Traceback:
File "/home/namor/webapps/app_django/lib/python2.7/django/core/handlers/base.py" in get_response
  92.                     response = middleware_method(request)
File "/home/namor/webapps/app_django/lib/python2.7/django/middleware/locale.py" in process_request
  21.         check_path = self.is_language_prefix_patterns_used()
File "/home/namor/webapps/app_django/lib/python2.7/django/middleware/locale.py" in is_language_prefix_patterns_used
  56.         for url_pattern in get_resolver(None).url_patterns:
File "/home/namor/webapps/app_django/lib/python2.7/django/core/urlresolvers.py" in url_patterns
  347.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/namor/webapps/app_django/lib/python2.7/django/core/urlresolvers.py" in urlconf_module
  342.             self._urlconf_module = import_module(self.urlconf_name)
File "/home/namor/webapps/app_django/lib/python2.7/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/home/namor/webapps/app_django/app/app/urls.py" in <module>
  6. admin.autodiscover()
File "/home/namor/webapps/app_django/lib/python2.7/django/contrib/admin/__init__.py" in autodiscover
  29.             import_module('%s.admin' % app)
File "/home/namor/webapps/app_django/lib/python2.7/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/home/namor/webapps/app_django/lib/python2.7/cms/admin/__init__.py" in <module>
  9. plugin_pool.plugin_pool.discover_plugins()
File "/home/namor/webapps/app_django/lib/python2.7/cms/plugin_pool.py" in discover_plugins
  20.         load('cms_plugins')
File "/home/namor/webapps/app_django/lib/python2.7/cms/utils/django_load.py" in load
  42.         get_module(app, modname, verbose, failfast)
File "/home/namor/webapps/app_django/lib/python2.7/cms/utils/django_load.py" in get_module
  21.         module = import_module(module_name)
File "/home/namor/webapps/app_django/lib/python2.7/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/home/namor/webapps/app_django/lib/python2.7/cms/stacks/cms_plugins.py" in <module>
  7. from cms.stacks.models import StackLink, Stack
File "/home/namor/webapps/app_django/lib/python2.7/cms/stacks/models.py" in <module>
  21. class Stack(models.Model):
File "/home/namor/webapps/app_django/lib/python2.7/cms/stacks/models.py" in Stack
  34.     content = PlaceholderField(stack_slotname, verbose_name=_(u'stack content'), related_name='stacks_contents')
File "/home/namor/webapps/app_django/lib/python2.7/cms/models/fields.py" in __init__
  13.         validate_placeholder_name(slotname)
File "/home/namor/webapps/app_django/lib/python2.7/cms/utils/placeholder.py" in validate_placeholder_name
  41.         name.decode('ascii')

Exception Type: AttributeError at /
Exception Value: 'function' object has no attribute 'decode'

The static files seem to be working as I can reach them. I don't really understand the problem since the project is working locally.

Thank you for your help :)

asked 23 Aug '13, 12:04

namor
313
accept rate: 0%

edited 23 Aug '13, 21:07


Are you using the exact same versions of the libraries locally and on the server? The trackback is a syntax error, and it provides the path and name of the function, have you tried debugging this function to check if the syntax error is correct? There are many ways to debug, I would start by editing the file and printing the variable and any parts of functions higher up which create that variable.

permanent link

answered 23 Aug '13, 17:51

johns
5.4k412
accept rate: 23%

Thank you ! I checked the exact versions of python eggs on the server and on my virtualenv, and the only difference was that on the server there was one more egg, the one of django cms, but of another version (2.4). I droped it and everything works.

(23 Aug '13, 21:05) namor
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×910
×15
×1
×1

question asked: 23 Aug '13, 12:04

question was seen: 3,881 times

last updated: 23 Aug '13, 21:07

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM