Mezzanine and Gunicorn

238 views
Skip to first unread message

John Munroe

unread,
Nov 16, 2012, 2:07:04 PM11/16/12
to mezzani...@googlegroups.com
Hi

I'm trying to get Mezzanine to work with Gunicorn, but I somehow can't reach /static. I get 404 when I try to access static/css/bootstrap.responsive.css, static/mezzanine/js/jquery-1.7.1.min.js etc. Does anyone know why? I didn't make any changes to the settings or variables in Gunicorn.

Thanks

John

Lorin Hochstein

unread,
Nov 16, 2012, 2:18:13 PM11/16/12
to mezzani...@googlegroups.com
John:

When you run a django app like mezzanine in production mode using a tool like gunicorn, it won't serve static files, such as those from your /static directory. The recommended approach is to configure your web server to serve the static content. 

for example, we have the following lines in our nginx config file for doing this:

    location  /static/ {
        root  /home/deploy/our-mezzanine-app/projects/our-project;
        access_log      off;
        log_not_found   off;
    }


Take care,

Lorin
--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.




Ken Bolton

unread,
Nov 16, 2012, 2:26:34 PM11/16/12
to mezzanine-users
Also, be sure to look at the excellent deployment work at https://github.com/stephenmcd/mezzanine/tree/master/mezzanine/project_template/deploy and the Fabric script at https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py. The nginx.conf in the `deploy` directory is a great illustration of Lorin's example.

best,
ken

John Munroe

unread,
Nov 23, 2012, 8:19:52 PM11/23/12
to mezzani...@googlegroups.com
Unfortunately I'm running it on Heroku and can't make a similar configuration...

John

Stephen McDonald

unread,
Nov 23, 2012, 8:32:53 PM11/23/12
to mezzani...@googlegroups.com
Nate from appsembler recently set up Mezzanine on a handful of different providers including Heroku:


You'll find source code there as well which might help.
--
Stephen McDonald
http://jupo.org

John Munroe

unread,
Nov 24, 2012, 7:26:44 PM11/24/12
to mezzani...@googlegroups.com, st...@jupo.org
Thanks. My ADMIN_MEDIA_PREFIX_CUSTOM is set to STATIC_URL + "grappelli/", where STATIC_URL is "/static/". However, in my /static/ there isn't grappelli/, so should I upload lib/python2.7/site-packages/grappelli_safe/static to S3 instead?

Thanks

John
Reply all
Reply to author
Forward
0 new messages