WebFaction
Community site: login faq

Hello my mezzanine (Django) powered website has been working for a couple of weeks with no particular problems. Recently I've tried to upload some images using the admin interface (Grappelli) and I broke something, not sure how. I suspect the media url was improperly configured. In settings.py

    STATIC_URL = "www.mysite.com/static/"  /* I suspect the problem was here */
    MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))
    MEDIA_URL = STATIC_URL + "media/"

So I think that the static url was misconfigured, in fact I've found a folder structure inside my app that I did not create, something similar to this:

http:
    www.mysite.com        
        static
            media
                 uploads
                      testFolder

I guess that the upload folder was created in the wrong place, it should be in the static app, separated from my django app. Even tough I've tried to correct the mistake I still get the 500 internal error. I can post some lines from my log (basically it goes on like this repeating over and over again):

[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1] mod_wsgi (pid=23219): Exception occurred processing WSGI script '/home/myUser/webapps/myApp/myApp-mezzanine/myApp-mezzanine/wsgi.py'.
[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1] Traceback (most recent call last):
[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1]   File "/home/myUser/webapps/myApp/lib/python2.7/django/core/handlers/wsgi.py", line 219, in __call__
[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1]     self.load_middleware()
[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1]   File "/home/myUser/webapps/myApp/lib/python2.7/django/core/handlers/base.py", line 47, in load_middleware
[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Sat Mar 16 02:39:54 2013] [error] [client 127.0.0.1] ImproperlyConfigured: Error importing middleware mezzanine.core.middleware: "No module named mezzanine.core.middleware"
[Sat Mar 16 02:41:16 2013] [notice] caught SIGTERM, shutting down
[Sat Mar 16 02:50:01 2013] [notice] Apache/2.2.17 (Unix) mod_wsgi/3.4 Python/2.7.3 configured -- resuming normal operations

asked 15 Mar '13, 22:26

Lenny
1113
accept rate: 0%

edited 15 Mar '13, 23:25

Try separating the media and static dirs from each other - I doubt Django will be happy with them being nested within each other since they are for a different purpose.

(15 Mar '13, 23:49) waynek
Be the first one to answer this question!
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:

×909
×337
×125
×7

question asked: 15 Mar '13, 22:26

question was seen: 4,607 times

last updated: 15 Mar '13, 23:49

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