Thank you Denis. I will keep my eye on this ticket: 
https://code.djangoproject.com/ticket/21221

Best,
BN

On Monday, December 7, 2015 at 12:42:23 AM UTC-6, Denis Cornehl wrote:
>
> Hi Brian, 
>
> a sidenote, this will be fixed: 
> https://github.com/django/django/pull/5571
>
> -- 
> Denis
>
> Am Sonntag, 6. Dezember 2015 um 17:17 schrieb Brian Neal:
>
> I'm investigating using staticfiles ManifestStaticFilesStorage. Unless I'm 
> missing something, there seems to be a hole with Django forms Media class. 
> If you use an inner Media class you do not get the hashed versions of the 
> assets filenames. 
>
> This leads me to believe you can't use the Forms Media technique with 
> ManifestStaticFilesStorage. 
>
> I noticed there was an undocumented function called static in 
> staticfiles.templatetags.staticfiles. I tried calling this function inside 
> my inner Media classes to make it return the hashed version of the files, 
> and this does work as long as collectstatic has been run. But if you have 
> an empty STATIC_DIR, you can't even call the management command to run 
> collectstatic as it tries to resolve these Media classes at import time. So 
> it seems to be a chicken and egg problem. A possible work around was found 
> on stackoverflow to delay the evaluation of the Media classes: 
> http://stackoverflow.com/questions/28366281/django-cachedstaticfilesstorage-in-modeladmin-media
>
> So it seems I have a couple of options:
>
> 1) Give up on form Media classes and explicitly use {% static %} in my 
> templates instead of {% form.media %}
> 2) Defer the resolution of {% form.media %} using the stackoverflow trick
>
> Since I'm not doing any dynamic decision making in my views about what 
> forms to use (yet), I always know what static files I need in my templates 
> to support my forms, so I'm leaning toward option 1. But just wanted to 
> bounce this off the community in case I am missing something.
>
> Thanks.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com <javascript:>.
> To post to this group, send email to django...@googlegroups.com 
> <javascript:>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/39a230f1-3025-4964-b543-b7d48a0798ab%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/39a230f1-3025-4964-b543-b7d48a0798ab%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/50655e01-554b-4a34-8ecc-8b0c362d537b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to