Question
Deploying Django Mezzanine Using Fabric
I’m trying to use a “fab all” (or “fab install”, “fab deploy”) to get Django Mezzanine up on Ubuntu. Even being as vanilla as I can, I get errors. At best, no errors are thrown, and I just get the nginx splash page at my IP with nothing at my example.com.
First Problem
Running “fab all” or “fab deploy” raises this error:
$ supervisorctl update gunicorn_jaredrovny_app ->
[45.55.255.108] out: sudo password:
[45.55.255.108] out: error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
After tracking this problem to supervisorctl, I’ve found that a “sudo service supervisor start” on the server allows getting past the above. But the site still won’t deploy, so I’ve included the above because I’m not sure what role it’s playing in my problems…
Second Problem
After searching around, I found my “/home/usr/logs/<mezz_app>_supervisor” log shows
Error: 'gunicorn.conf.py' doesn't exist
I cannot find out why this is happening.
With a local virtualenv, mezzanine, etc., the only thing I do before “fab all” is edit my local_settings.py file to have the following:
ALLOWED_HOSTS = ["<example.com>"]
and
FABRIC = {
"DEPLOY_TOOL": "git", # Deploy with "git", "hg", or "rsync"
"SSH_USER": "<usr>", # VPS SSH username
"HOSTS": ["<IP address>"], # The IP address of your VPS
"DOMAINS": ALLOWED_HOSTS, # Edit domains in ALLOWED_HOSTS
"REQUIREMENTS_PATH": "requirements.txt", # Project's pip requirements
"GUNICORN_PORT": 8000, # Port gunicorn will listen on
"LOCALE": "en_US.UTF-8", # Should end with ".UTF-8"
"DB_PASS": "", # Live database password
"ADMIN_PASS": "", # Live admin user password
"REPO_URL": "<github url>",
"SECRET_KEY": SECRET_KEY,
"NEVERCACHE_KEY": NEVERCACHE_KEY,
}
Highlighted regions are things I’ve changed.
(FYI, I’ve tried things like putting “.postgresql_psycopg2” in the DATABASES section, changing the settings.py file, and a handful of other things as well, including explicitly moving the “missing” gunicorn.conf.py file to the directory where it’s being looked for– still nothing!)
Any ideas what’s going on here?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Followup note:
Problem “1” above doesn’t occur on Ubuntu 14.04.5, but problem “2” (‘gunicorn.conf.py’ doesn’t exist) persists.