Sunday, March 30, 2014


Hi Jonathan,

the cleanest way I found:

at the beginning of your add

import os
BASE_PROJECT = os.path.dirname(__file__)

then when the section comes

MEDIA_ROOT = os.path.join(BASE_PROJECT,'media')
MEDIA_URL = '/media/'

STATIC_ROOT = os.path.join(BASE_PROJECT,'static')
STATIC_URL = '/static/'

and in some cases I also add the static inside the apps like this

# Put strings here, like "/home/html/static" or
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(BASE_PROJECT, 'newApp','static')


On dom 30 mar 2014 00:39:41 CET, Jonathan Querubina wrote:
> Guys
> What is the best way to configure and make accessible via URL the STATIC and the MEDIA uri?
> I can`t seem to find a good way, and get so many errors for the both being equal.
> Can someone send me an example of this configs?
> Thanks!

Julio Molina Soler

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment