KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm having a really hard time getting my head around the use of django-compressor. Here's what I'm attempting to accomplish: Separation of Static Files & Assets (LESS, Coffeescript) I would like to separate my LESS CSS and Coffeescript files into an assets directory e.g. app └── assets ├── coffee │ └── script.coffee └── less └── style.less Leaving static assets such as images in my static directory e.g. app └── static ├── hello.txt └── photo.jpg To do this, I've added the assets path to my STATICFILES_DIRS variable to allow django-compressor to find the files (which works as expected). Is this the correct approach? I have been trying to find an independent load path dedicated to django-compressor but didn't have any luck as I don't intend for these assets to be served as statics. Collection of Files for Production Deployment For deploying to production, I would then like the compiled CSS & JS files along with other media in my app/static directory (e.g. images and so on) to be collected to an app/static-prod directory. But this doesn't work out so well because the assets are also collected when using the collectstatic command. e.g. (django-cpython)fots@fotsies-ubprecise-01:~/django_learning$ ./manage.py collectstatic --noinput Copying '/home/fots/django_learning/app/assets/less/style.less' Copying '/home/fots/django_learning/app/assets/less/import.less' Copying '/home/fots/django_learning/app/assets/coffee/script.coffee' Copying '/home/fots/django_learning/app/static/photo.jpg' Copying '/home/fots/django_learning/app/static/hello.txt' 5 static files copied. Using the ./manage.py compress command only takes tare of my compiled files, not photo.jpg or hello.txt in this example. Th
Tags (comma-separated)
Save Edits
Cancel