WebFaction
Community site: login faq
3
3

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

asked 21 Aug '12, 14:44

rentgeeen's gravatar image

rentgeeen
47918
accept rate: 0%

edited 21 Aug '12, 18:36

seanf's gravatar image

seanf ♦♦
11.4k21132

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

[Tue Aug 21 19:27:56 2012] [error] [client 127.0.0.1] SyntaxError: invalid syntax
[Tue Aug 21 19:39:13 2012] [error] [client 127.0.0.1] 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 127.0.0.1] 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 127.0.0.1] Traceback (most recent call last):
[Tue Aug 21 19:39:13 2012] [error] [client 127.0.0.1]   File "/home/radek/webapps/mezzserver/ecommerce/wsgi.py", line 4, in <module>
[Tue Aug 21 19:39:13 2012] [error] [client 127.0.0.1]     from django.core.handlers.wsgi import WSGIHandler
[Tue Aug 21 19:39:13 2012] [error] [client 127.0.0.1]   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 127.0.0.1]     path_info = force_unicode(environ.get('PATH_INFO', u'/'))
[Tue Aug 21 19:39:13 2012] [error] [client 127.0.0.1]                                                           ^
[Tue Aug 21 19:39:13 2012] [error] [client 127.0.0.1] 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 rentgeeen's gravatar image

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's gravatar image

@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 waynek's gravatar image

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

(23 Mar, 20:06) Danos2000 Danos2000's gravatar image

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
../apache2/bin/restart

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

seanf's gravatar image

seanf ♦♦
11.4k21132
accept rate: 37%

edited 31 Jan '15, 00:01

Before I start - I cant use mysql?

(21 Aug '12, 18:11) rentgeeen rentgeeen's gravatar image

easy_install-2.7 pip

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

(21 Aug '12, 18:21) rentgeeen rentgeeen's gravatar image

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 ♦♦ seanf's gravatar image

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 ♦♦ seanf's gravatar image

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

(21 Aug '12, 18:38) rentgeeen rentgeeen's gravatar image

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 rentgeeen's gravatar image

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

(21 Aug '12, 21:56) rentgeeen rentgeeen's gravatar image

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

(22 Aug '12, 07:35) seanf ♦♦ seanf's gravatar image

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 Peter71's gravatar image

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 ♦♦ seanf's gravatar image
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

nednewton's gravatar image

nednewton
111
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 rentgeeen's gravatar image

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, 20:03) Danos2000 Danos2000's gravatar image

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

Lexotron's gravatar image

Lexotron
11
accept rate: 0%

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

(24 Nov '12, 12:36) bmeyer71 ♦♦ bmeyer71's gravatar image

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 Lexotron's gravatar image

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

Dragonstar's gravatar image

Dragonstar
1
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 ♦♦ bmeyer71's gravatar image

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

Peter71's gravatar image

Peter71
1
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:

https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts

check your version of django again...

(10 Apr '13, 15:10) rentgeeen rentgeeen's gravatar image

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 ♦♦ johns's gravatar image

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:

/home/your_username/webapps/django_project_name/my_cms/local_settings.py

permanent link

answered 04 Jul '13, 17:24

stuguru's gravatar image

stuguru
1113
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

osullivj's gravatar image

osullivj
11
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?

Best,

Tommy

permanent link

answered 19 Aug '14, 20:09

clearlylit's gravatar image

clearlylit
134
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 ♦♦ seanf's gravatar image

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 127.0.0.1] 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 127.0.0.1] Traceback (most recent call last): 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] File "/home/clearlylit/lib/python2.7/django/core/handlers/wsgi.py", line 187, in call 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] self.load_middleware() 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] 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 127.0.0.1] for middleware_path in settings.MIDDLEWARE_CLASSES: 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] File "/home/clearlylit/lib/python2.7/django/conf/init.py", line 54, in getattr 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] self._setup(name) 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] File "/home/clearlylit/lib/python2.7/django/conf/init.py", line 49, in _setup 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] self._wrapped = Settings(settings_module) 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] File "/home/clearlylit/lib/python2.7/django/conf/init.py", line 151, in init 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.") 
[Tue Aug 19 22:10:45 2014] [error] [client 127.0.0.1] ImproperlyConfigured: The SECRET_KEY setting must not be empty.
(19 Aug '14, 22:14) clearlylit clearlylit's gravatar image

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 ♦♦ seanf's gravatar image

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 127.0.0.1] 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 127.0.0.1] Traceback (most recent call last):
[Tue Aug 19 22:54:42 2014] [error] [client 127.0.0.1]   File "/home/clearlylit/webapps/bdng_site/my_cms/deploy/wsgi.py", line 7, in <module>
[Tue Aug 19 22:54:42 2014] [error] [client 127.0.0.1]     from django.core.handlers.wsgi import WSGIHandler
[Tue Aug 19 22:54:42 2014] [error] [client 127.0.0.1] ImportError: cannot import name WSGIHandler
(19 Aug '14, 23:04) clearlylit clearlylit's gravatar image

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 ♦♦ seanf's gravatar image

ok will do, thanks

(20 Aug '14, 00:38) clearlylit clearlylit's gravatar image

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 bashilo's gravatar image
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:

$HOME/webapps/django/my_cms/my_cms

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

helmingstay's gravatar image

helmingstay
112
accept rate: 0%

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

(01 Dec '15, 17:46) seanf ♦♦ seanf's gravatar image
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:

×875
×51
×7

question asked: 21 Aug '12, 14:44

question was seen: 8,986 times

last updated: 23 Mar, 20:06

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 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