Forums

Mezzanine deployment errors

I'm sorry to bring this one back up, but I'm trying to figure out if I'm just doing something stupid here (new to pythonanywhere, but not mezzanine), or if something is going crazy in the background. I've successfully deployed django test sites here, but keep getting errors with mezzanine. I followed the directions at https://www.pythonanywhere.com/forums/topic/251/, to include the original sqlite default dev.db to keep things simple at first, and run into the following error messages upon deployment:

"AttributeError at /

'module' object has no attribute 'get_language_from_path'

Request Method: GET Request URL: http://jstratm.pythonanywhere.com/ Django Version: 1.3.7 Exception Type: AttributeError Exception Value:

'module' object has no attribute 'get_language_from_path'

Exception Location: /usr/local/lib/python2.7/site-packages/mezzanine/utils/urls.py in path_to_slug, line 97 Python Executable: /usr/local/bin/uwsgi Python Version: 2.7.3"

The traceback: "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py in get_response

response = middleware_method(request, callback, callback_args, callback_kwargs) /usr/local/lib/python2.7/site-packages/mezzanine/pages/middleware.py in process_view

slug = path_to_slug(request.path_info) /usr/local/lib/python2.7/site-packages/mezzanine/utils/urls.py in path_to_slug

lang_code = translation.get_language_from_path(path)"

I suspect the WSGI, but I simply used a modified django one: "import os import sys

path = '/home/jstratm' if path not in sys.path: sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'meztest2.settings'

import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()"

I believe mezzanine depends in Django 1.4, I can see Django 1.3.7 in you r stack trace. It looks like you're going to need to use a virtualenv. Here's a guide to getting Django 1.4 running in a virtualenv on PythonAnywhere, then you can just install mezzanine.

Thanks a lot, I didn't catch the version issue. That fixed the primary issues! I hadn't realized virtualenv was a possibility here, so am now quite happy to have that option.

@jstratm: Welcome to PA!!

Just an FYI on forum usage...When you post code (like your trace above) You can make it look better by indenting four spaces. You can also define what type of highlighting to perform by prefixing it with an indented ":::text" or ":::python" etc...

For example:

"AttributeError at /

'module' object has no attribute 'get_language_from_path'

Request Method: GET Request URL: http://jstratm.pythonanywhere.com/ Django Version: 1.3.7 Exception Type: AttributeError Exception Value:

'module' object has no attribute 'get_language_from_path'

Exception Location: /usr/local/lib/python2.7/site-packages/mezzanine/utils/urls.py in path_to_slug, line 97 Python Executable: /usr/local/bin/uwsgi Python Version: 2.7.3"

The traceback: "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py in get_response

response = middleware_method(request, callback, callback_args, callback_kwargs) /usr/local/lib/python2.7/site-packages/mezzanine/pages/middleware.py in process_view

slug = path_to_slug(request.path_info) /usr/local/lib/python2.7/site-packages/mezzanine/utils/urls.py in path_to_slug

lang_code = translation.get_language_from_path(path)"

I suspect the WSGI, but I simply used a modified django one: "import os import sys

path = '/home/jstratm' if path not in sys.path: sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'meztest2.settings'

import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()"