0

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) ?

2
  • Possible duplicate for stackoverflow.com/questions/15491727/… Commented 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. Commented Sep 11, 2013 at 11:27

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.