I am working on a project with django + some js + some css. Is there a place where i should put the dev version of the js/css source files that are compiled into js/css prod versions (and stored in /static) ?
-
Possible duplicate for stackoverflow.com/questions/15491727/…naor– naor2013-09-11 11:23:17 +00:00Commented Sep 11, 2013 at 11:23
-
I know how to render static css/js files with Django. But where should I put the dev js/css files ? Is there any specific Django folder for that ? 'Cause putting them in static means that they're accessible from the client which is not desirable.Simon– Simon2013-09-11 11:27:19 +00:00Commented Sep 11, 2013 at 11:27
Add a comment
|
1 Answer
You can go this way:
In settings:
LIB_URL = '/var/static/lib/'
Make new context_processor:
from django.conf import settings
def static(request):
return {'LIB_URL': settings.LIB_URL}
add new context processor to TEMPLATE_CONTEXT_PROCESSORS and then in template:
script:
<script src='{{ LIB_URL }}jquery/jquery.js'></script>
And make folder /var/static/lib/, download your dev libs here. Think that'll help you.