login community faq
1
3

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

asked Aug 21 '12 at 14:44

rentgeeen's gravatar image

rentgeeen
194

edited Aug 21 '12 at 18:36

seanf's gravatar image

seanf ♦♦
56291220

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[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.

(Aug 21 '12 at 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.

(May 01 at 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.

(May 01 at 22:16) waynek ♦♦ waynek's gravatar image

To install Mezzanine, first create a new PostgreSQL database via our control panel, and make a note of the database name and password.

Next, create a "Django 1.4.1 (mod_wsgi 3.3/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):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
mkdir -p ~/lib/python2.7 ~/tmp
export TMPDIR=~/tmp
easy_install-2.7 pip
cd ~/webapps/name_of_your_app
export PYTHONPATH=$PWD/lib/python2.7
pip-2.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
python2.7 manage.py createdb --noinput
python2.7 manage.py collectstatic --noinput
cp ../myproject/myproject/wsgi.py deploy/
sed -i 's/myproject.settings/my_cms.settings/g' deploy/wsgi.py
sed -i 's/myproject\/myproject\/wsgi.py/my_cms\/deploy\/wsgi.py/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.

Hope that helps!

This answer is marked "community wiki".

answered Aug 21 '12 at 17:28

seanf's gravatar image

seanf ♦♦
56291220

edited Nov 24 '12 at 12:35

bmeyer71's gravatar image

bmeyer71 ♦♦
8512310

Before I start - I cant use mysql?

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

easy_install-2.7 pip

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

(Aug 21 '12 at 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...

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

... to this ...

1
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.

(Aug 21 '12 at 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.

(Aug 21 '12 at 18:31) seanf ♦♦ seanf's gravatar image

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

(Aug 21 '12 at 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 :)

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

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

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

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

(Aug 22 '12 at 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 "]

(Apr 10 at 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.

(Apr 10 at 13:49) seanf ♦♦ seanf's gravatar image
showing 5 of 10 show all

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 :-)

answered Nov 24 '12 at 12:31

Lexotron's gravatar image

Lexotron
1

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

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

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?

answered Nov 27 '12 at 22:01

nednewton's gravatar image

nednewton
1

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

(Nov 27 '12 at 22:13) rentgeeen rentgeeen'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?

answered Jan 26 at 14:09

Dragonstar's gravatar image

Dragonstar
1

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.

(Jan 26 at 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?

answered Apr 10 at 13:59

Peter71's gravatar image

Peter71
1

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...

(Apr 10 at 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.

(Apr 10 at 17:19) johns ♦♦ johns's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
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

Tags:

×643
×25
×5

Asked: Aug 21 '12 at 14:44

Seen: 1,766 times

Last updated: May 01 at 22:16

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited