0

What the best way to organize and deploy java-script and css files in django ? The main idea is rather simple - in debug mode use a lot of JS's and in production only one minified java-script . I am think that I 'am inventing a bicycle, trying to reorganize my old project this way, and should be some well known solution for this problem.

Seems I have found what I need - django-pipeline

2 Answers 2

2

See Managing static files in official documentation.

In short:

  • When debugging you can ask Django to serve these files by himself (just put them in one directory and configure STATICFILES_DIRS).
  • When going into production stage, you should use a real webserver like Apache. (see Deploying static files)
Sign up to request clarification or add additional context in comments.

Comments

1

You could collect all static files in a folder (https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/) and then run requirejs optimiser to minify and merge the js files (http://requirejs.org/docs/optimization.html).

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.