I’m currently working on a Django 1.3 app where both MEDIA_ROOT and STATIC_ROOT are identical, and MEDIA_URL and STATIC_URL are identical.
This (somehow) runs on the production server, but locally when I call manage.py runserver I get an ImproperlyConfigured exception and can only run the application when I override the settings so that MEDIA_* is different from STATIC_* (DEBUG=False just gives a 500). This is what I would expect to happen (as per documentation), and so I don’t understand how they can get it working in Production.
The original developer of the application has moved on so I can’t ask any questions as how they’ve managed to get this to work. Is there a known method of circumventing Django’s static and media file separation?
Not a great answer as it’s so specific, but the answer was that they just never run the application with
DEBUG=True(runserver will run happily withDEBUG=Falseand incorrectMEDIA_*andSTATIC_*settings). There was no silver bullet, the application appears to be debugged using the error log created by mod_wsgi (no logging in place). I assume that this also how the development environment was set up.The application is also notable for being run whilst not being on the
PYTHONPATH, and having all of its apps in a separate folder in another part of the filesystem. This was discovered when adding a new application to the folder containingmanage.pyand having import errors for the new application. I think this was so that multiple django installations could use the same set of apps.Thanks to Yuji for his help .