Community site: login faq

Hello, can anybody help me to setup mezzanine on webfaction?

asked 21 Aug '12, 14:44

accept rate: 0%

edited 21 Aug '12, 18:36


I setup 1 of those in my wf accout but have Internal Server Error +

[Tue Aug 21 19:27:56 2012] [error] [client] SyntaxError: invalid syntax
[Tue Aug 21 19:39:13 2012] [error] [client] mod_wsgi (pid=8178): Target WSGI script '/home/radek/webapps/mezzserver/ecommerce/wsgi.py' cannot be loaded as Python module.
[Tue Aug 21 19:39:13 2012] [error] [client] mod_wsgi (pid=8178): Exception occurred processing WSGI script '/home/radek/webapps/mezzserver/ecommerce/wsgi.py'.
[Tue Aug 21 19:39:13 2012] [error] [client] Traceback (most recent call last):
[Tue Aug 21 19:39:13 2012] [error] [client]   File "/home/radek/webapps/mezzserver/ecommerce/wsgi.py", line 4, in <module>
[Tue Aug 21 19:39:13 2012] [error] [client]     from django.core.handlers.wsgi import WSGIHandler
[Tue Aug 21 19:39:13 2012] [error] [client]   File "/home/radek/webapps/mezzserver/apache2/lib/python2.7/django/core/handlers/wsgi.py", line 131
[Tue Aug 21 19:39:13 2012] [error] [client]     path_info = force_unicode(environ.get('PATH_INFO', u'/'))
[Tue Aug 21 19:39:13 2012] [error] [client]                                                           ^
[Tue Aug 21 19:39:13 2012] [error] [client] SyntaxError: invalid syntax

I know it works, I would like to know proper way to install it. Please Help.

(21 Aug '12, 15:05) rentgeeen

I cannot login to the site. I followed the instructions as written, but the default username/password will not let me in.

(01 May '13, 22:06) jeremydoan

@jeremydoan Could you please log a support ticket with us? That will help us to better assist and look at your particular case. Wayne K. | WebFaction Support.

(01 May '13, 22:16) waynek

To @jeremydoan and anyone else with the default username/password issue, see my comment to this answer below.

(23 Mar '17, 20:06) Danos2000

To install Mezzanine on a WebFaction hosting account, first create a new PostgreSQL database via the WF control panel, and make a note of the database name and password.

Next, create a "Django 1.6.10 (mod_wsgi 3.5/Python 2.7)" application and assign it to a website.

Next, SSH into your server and run the following commands (replacing name_of_your_app, database_name, database_password, and my_cms with appropriate values):

mkdir -p ~/lib/python2.7
easy_install-2.7 pip
cd ~/webapps/name_of_your_app
export PYTHONPATH=$PWD/lib/python2.7
pip2.7 install -U --install-option="--install-scripts=$PWD/bin" --install-option="--install-lib=$PWD/lib/python2.7" mezzanine
~/bin/mezzanine-project my_cms
cd my_cms
sed -i 's/"ENGINE": "django.db.backends.sqlite3"/"ENGINE": "django.db.backends.postgresql_psycopg2"/g' local_settings.py
sed -i 's/"NAME": "dev.db"/"NAME": "database_name"/g' local_settings.py
sed -i 's/"USER": ""/"USER": "database_name"/g' local_settings.py
sed -i 's/"PASSWORD": ""/"PASSWORD": "database_password"/g' local_settings.py
sed -i 's/DEBUG = True/DEBUG = False/g' local_settings.py
echo "ALLOWED_HOSTS = ['yourdomain.com',]" >> local_settings.py
python2.7 manage.py createdb --noinput
python2.7 manage.py collectstatic --noinput
sed -i 's/myproject\/myproject\/wsgi.py/my_cms\/wsgi.py/g' ../apache2/conf/httpd.conf
sed -i 's/myproject/my_cms/g' ../apache2/conf/httpd.conf

Next, create a "Symbolic link to static-only app" in the control panel, using "/home/your_username/webapps/name_of_your_app/my_cms/static" as the symlink path (in the "extra info" field, then assign that app to your site, using '/static' as the URL path.

Then just wait a few minutes for that last change to gel, and you're done.

permanent link
This answer is marked "community wiki".

answered 21 Aug '12, 17:28

accept rate: 37%

edited 31 Jan '15, 00:01

Before I start - I cant use mysql?

(21 Aug '12, 18:11) rentgeeen

easy_install-2.7 pip

[@web243 ~]$ easy_install-2.7 pip error: Resource temporarily unavailable

(21 Aug '12, 18:21) rentgeeen

Sure, you can use MySQL if you prefer. Just create a MySQL database in the first step, then change this...

sed -i 's/"ENGINE": "django.db.backends.sqlite3"/"ENGINE": "django.db.backends.postgresql_psycopg2"/g' local_settings.py

... to this ...

sed -i 's/"ENGINE": "django.db.backends.sqlite3"/"ENGINE": "django.db.backends.mysql"/g' local_settings.py

... when running the commands to set everything up.

(21 Aug '12, 18:26) seanf

Regarding "Resource temporarily unavailable" - you've got too many processes running and you're hitting the system per-user thread limit. If you're having any apps running that you're not using, stop them and disable their cron jobs, or delete them. If you can't do that, then change the "processes=" setting in your various httpd.conf files to a lower value so your apps will run fewer processes.

Also, be sure to use the "add new comment" button here when you want to leave a comment, instead of using the big "Your answer" box at the bottom of the page.

(21 Aug '12, 18:31) seanf

ok thanks a lot will do that, will let you know...

(21 Aug '12, 18:38) rentgeeen

Woow I am impressed, worked as a charm :) I have 1 little problem tho I need to find out admin login, never asked me to create username and password during install and creating tables into DB just like when I am doing django, by the way do you know default login? Anyway thanks a lot this is great :)

(21 Aug '12, 21:56) rentgeeen

I wanted to give you thumb up but it doesnt allow me, cause I dont have reputation...

(21 Aug '12, 21:56) rentgeeen

The default admin account is the one described in the official Mezzanine installation documentation.

(22 Aug '12, 07:35) seanf

I followed the exact steps, however my site appeared "Sorry, an error occurred."

I checked the log, it said [warn("You haven't defined the ALLOWED_HOSTS settings, which "]

(10 Apr '13, 13:44) Peter71

At the time this article was written, ALLOWED_HOSTS was an optional setting. Later versions of Django require it.

(10 Apr '13, 13:49) seanf
showing 5 of 10 show 5 more comments

Sorry if I am a bit of a dummy here. But I am having the same issue as rentgeeen. I have read the through the documentation and the default login/password combo isn't working. Any thoughts?

permanent link

answered 27 Nov '12, 22:01

accept rate: 0%

I solved it like this:

python2.7 manage.py createdb --noinput

remove the "--noinput" that means skip specify the username and password...

python2.7 manage.py createdb

(27 Nov '12, 22:13) rentgeeen

I had the same problem. The directions as written leave no admin users, not even the default. But you can create a new superuser by doing the following steps.

Navigate to the directory with your new mezzanine app in it. For example, ~/webapps/django_app/my_cms/. Then use the Django management command to create a new superuser.

pythonX.Y manage.py createsuperuser

where X.Y is replaced with whatever version of python you're using. You should then be prompted for username, email, and password. Once created, you'll be able to log into the mezzanine admin with those credentials.

(23 Mar '17, 20:03) Danos2000

Just some feedback - the line cp ../myproject/myproject/wsgi.py my_cms/deploy/ should read cp ../myproject/myproject/wsgi.py deploy/ since we're already in the my_cms directory at that point. Otherwise, this is great and saved me tonnes of headaches :-)

permanent link

answered 24 Nov '12, 12:31

accept rate: 0%

Corrected. Thanks for pointing that out. Glad it helped.

(24 Nov '12, 12:36) bmeyer71 ♦♦

I just tried this again, and it may need updating again. I'm getting the error: pip-2.7: command not found - I think the command should be pip2.7 not pip-2.7

Also, now half of the packages are getting installed into ~/lib/python2.7 instead of ~/webapps/app_name/lib/python2.7.

Finally, when trying to access my site, I get: ImproperlyConfigured: The SECRET_KEY setting must not be empty.

(26 Jan '15, 20:02) Lexotron

I can't find any "add new comment' buttons. Anyway, should database_name in this line:

sed -i 's/"USER": ""/"USER": "database_name"/g' local_settings.py

instead be database_user:

sed -i 's/"USER": ""/"USER": "database_user"/g' local_settings.py

Otherwise I have followed the steps. It seemed to work fine but when I access the site I get a Forbidden:403 error. Any ideas?

permanent link

answered 26 Jan '13, 14:09

accept rate: 0%

At the time of this post, the database_name was also the database user name. With the recent changes, you just need to specify the user name for accessing the database.

(26 Jan '13, 15:23) bmeyer71 ♦♦

I followed the steps listed above, however my site now is showing "Sorry, an error occurred. "

I checked my site's error log, it has "warn("You haven't defined the ALLOWED_HOSTS settings, which ""

BTW, I am using Django 1.4.5 (mod_wsgi 3.4/Python 2.7).

I read on the web, as described in this https://github.com/stephenmcd/mezzanine/issues/591 ,I need to update my requirements.txt. But where is the requirements.txt reside since I am not install mezzanine using virtualenv?

permanent link

answered 10 Apr '13, 13:59

accept rate: 0%

Ok first of all error: You haven't defined the ALLOWED_HOSTS settings - that's an error regarding django 1.5 - look here:


check your version of django again...

(10 Apr '13, 15:10) rentgeeen

As versions change the above guide will also change, this happens with any software. If you get stuck submit a support ticket and we can investigate.

(10 Apr '13, 17:19) johns ♦♦

I know this is too late for you, but for other people who come here looking for answers, hopefully this helps. I looked everywhere for a solution to this, my workaround was to insert:

ALLOWED_HOSTS = [ '.your_username.webfactional.com',]

replace '.your_username.webfactional.com' with your website name, remembering to keep the leading "." if you want it to work for subdomains.

into this file:


permanent link

answered 04 Jul '13, 17:24

accept rate: 0%

This pip cmd line didn't work for me - it tries to put Mezzanine under /usr/local, where I don't have write permissions...

    pip2.7 install -U --install-option="--install-scripts=$PWD/bin" --install-option="--install-
lib=$PWD/lib/python2.7" mezzanine

Did a little bit of googling on pip and found that the target dir for an install can be overridden more directly with pip's --target dir option. My home dir is /home/osullivj, so this worked for me...

pip2.7 install --target=/home/osullivj/lib/python2.7 mezzanine
permanent link

answered 05 Aug '14, 16:54

accept rate: 0%

edited 05 Aug '14, 16:56

Hi all,

I am new at this but definitely ambitious to get this up and running. I followed all of the above and when I connect to my domain I get a 200 error. I am not sure what this means. Does anyone know how this could happen after following the above?



permanent link

answered 19 Aug '14, 20:09

accept rate: 0%

edited 19 Aug '14, 20:10

The above instructions, written two years ago, work for the version of Django for which they were written. It's possible that using a newer version of Django could introduce some errors.

Check your error log (~/logs/user/error_appname.log) for the Python traceback that is causing the error you're seeing. What you see there should give you most, if not all, of the info you need to resolve the error.

Hope that helps!

(19 Aug '14, 20:40) seanf

I did. I keep getting "ImproperlyConfigured: The SECRET_KEY setting must not be empty." However the secret key has been set. The error is occurring when the wsgi.py file is running. Here is the full log.

[Tue Aug 19 22:10:45 2014] [error] [client] mod_wsgi (pid=320060): Exception occurred processing WSGI script '/home/clearlylit/webapps/bdng_site/my_cms/deploy/wsgi.py'. 
[Tue Aug 19 22:10:45 2014] [error] [client] Traceback (most recent call last): 
[Tue Aug 19 22:10:45 2014] [error] [client] File "/home/clearlylit/lib/python2.7/django/core/handlers/wsgi.py", line 187, in call 
[Tue Aug 19 22:10:45 2014] [error] [client] self.load_middleware() 
[Tue Aug 19 22:10:45 2014] [error] [client] File "/home/clearlylit/lib/python2.7/django/core/handlers/base.py", line 44, in load_middleware 
[Tue Aug 19 22:10:45 2014] [error] [client] for middleware_path in settings.MIDDLEWARE_CLASSES: 
[Tue Aug 19 22:10:45 2014] [error] [client] File "/home/clearlylit/lib/python2.7/django/conf/init.py", line 54, in getattr 
[Tue Aug 19 22:10:45 2014] [error] [client] self._setup(name) 
[Tue Aug 19 22:10:45 2014] [error] [client] File "/home/clearlylit/lib/python2.7/django/conf/init.py", line 49, in _setup 
[Tue Aug 19 22:10:45 2014] [error] [client] self._wrapped = Settings(settings_module) 
[Tue Aug 19 22:10:45 2014] [error] [client] File "/home/clearlylit/lib/python2.7/django/conf/init.py", line 151, in init 
[Tue Aug 19 22:10:45 2014] [error] [client] raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.") 
[Tue Aug 19 22:10:45 2014] [error] [client] ImproperlyConfigured: The SECRET_KEY setting must not be empty.
(19 Aug '14, 22:14) clearlylit

It seems to be picking up Django libraries from ~/lib/python2.7 instead of ~/webapps/bdng_site/lib/python2.7. Try removing the lib from ~/lib/python2.7, then restart your app to see if the problem persisss.

(19 Aug '14, 22:19) seanf

Sean, you have helped me generate different errors which is progress and I appreciate it. Now I am getting an import error.

[Tue Aug 19 22:54:42 2014] [error] [client] mod_wsgi (pid=373951): Exception occurred processing WSGI script '/home/clearlylit/webapps/bdng_site/my_cms/deploy/wsgi.py'.
[Tue Aug 19 22:54:42 2014] [error] [client] Traceback (most recent call last):
[Tue Aug 19 22:54:42 2014] [error] [client]   File "/home/clearlylit/webapps/bdng_site/my_cms/deploy/wsgi.py", line 7, in <module>
[Tue Aug 19 22:54:42 2014] [error] [client]     from django.core.handlers.wsgi import WSGIHandler
[Tue Aug 19 22:54:42 2014] [error] [client] ImportError: cannot import name WSGIHandler
(19 Aug '14, 23:04) clearlylit

I just checked your account and it looks like you've done some things with virtualenv that aren't a part of this procedure. At this point, I recommend that you start over with a clean app, and don't try to convert it to a virtualenv.

(20 Aug '14, 00:05) seanf

ok will do, thanks

(20 Aug '14, 00:38) clearlylit

Mezzanine has changed structure in 4.0.0. Is there a way to update now to 4.0.0? I've been using recommended here setup for more that 2 years already; but can't seem to figure out how to upgrade...

(26 Jul '15, 07:20) bashilo
showing 5 of 7 show 2 more comments

I just spent a few hours beating my head against this. I'm using python3.4.
The part I had the most trouble with:

mezzanine-project my_cms

In new versions, this creates two nested directories that created problems loading settings:


In dir django:

mv my_cms my_cms.dir

Then update apache2/conf/httpd.conf (and the static link creation) accordingly. One other problem - I wasn't able to get this to work properly in a sub-directory (e.g. served from domain.com/my_cms) - any hints?

permanent link
This answer is marked "community wiki".

answered 01 Dec '15, 08:17

accept rate: 0%

Mezzanine is a Django app, so try this: Mounting a Django Application on a Subpath

(01 Dec '15, 17:46) seanf
Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 21 Aug '12, 14:44

question was seen: 10,627 times

last updated: 23 Mar '17, 20:06