django-css icon indicating copy to clipboard operation
django-css copied to clipboard

django 1.3 STATIC_URL

Open munhitsu opened this issue 14 years ago • 8 comments

Django 1.3 introduces STATIC_URL as a standard approach for app static files. So from now on there are two paths for not dynamic files: MEDIA_URL - more like uploaded files STATIC_URL - statics delivered with app

At this point there are two issues with django-css.

  1. defeulting to context MEDIA_URL I guess it should be enough jus to remove templatetags/compress.py lines: if 'MEDIA_URL' in context: media_url = context['MEDIA_URL'] else:
  2. During development STATIC_ROOT is often empty as it is being dynamically filled by static app. A standard practice is to have all files collected to STATIC_ROOT only on development

It might be useful to either document this limitation or get real static file path while in development mode (runserver)

munhitsu avatar Jan 29 '11 05:01 munhitsu

I made a pull request regarding the media url issue earlier. You can have a look here https://github.com/dziegler/django-css/pull/27

hedberg avatar Feb 01 '11 00:02 hedberg

Works perfect. Thanks!

munhitsu avatar Feb 02 '11 19:02 munhitsu

i dont know about you guys, but i store site-wide sass files in STATIC_ROOT and now these files are not found by django-css. They are however served perfectly by django static files.

django-css needs to considder files in STATIC_ROOT before any files in STATICFILES_DIRS

twoolie avatar Apr 15 '11 06:04 twoolie

Django-css's copy of django-compressor is old in general. Django-compressor took care of this in recent versions

xster avatar May 10 '11 01:05 xster

is anyone merging django-compressor into django-css regularly/semi-regularly?

twoolie avatar May 10 '11 05:05 twoolie

You might wanna take a look at https://github.com/jezdez/django_compressor/. It now has a precompiler filter with which you can add support for external commands (sass, coffescript etc). Works well in my first test and have support for Django 1.3 / staticfiles.

hedberg avatar May 21 '11 17:05 hedberg

Yes, it works really well in my tests. Except one small problem where I can't get it to find my static files in my app. Other than that there's 0 problems. :)

ghost avatar May 21 '11 17:05 ghost

I tracked down the bug I spoke of above here, and have the fix.

ghost avatar May 22 '11 04:05 ghost