Static files with custom path

I have this project that in my urls.py I have the following:

if getattr(settings, 'MEDIA_ROOT'):

    urlpatterns_serve = patterns(

        '',

        (r'^static/(?P<path>.*)$', 'django.views.static.serve',

         {'document_root': settings.MEDIA_ROOT}),

        )

    urlpatterns.extend(urlpatterns_serve)

Basically, if in my settings (in this case, my development settings), I have a MEDIA_ROOT variable, django static serve map it to /static/

And in my case, the MEDIA_ROOT point to a /media/ subfolder.

So, in my template, I need to use /static/ folder to get content from /media/

But, inspector is confuse, no static files in templates cannot be found.

Is there a way to tell PyCharm to map a specific path to a local folder?

There can be many cases when a webserver is configured to use a local folder with a different published name.

thanks

Please sign in to leave a comment.