Wednesday, December 26, 2012

Re: Serving static files: Tried 3 ways with no luck

On 27/12/2012 2:03pm, warsameb0@gmail.com wrote:
> I am having an unbelievable time getting my new django application to
> servie static files, i have read the django documentation but it seems
> as there isn't one consistent way to serve static files while in
> development using the Django server.
>
> In order are my settings.py file, my urls.py file and finally in my
> base.html where i reference these files.
>
>
> I have no idea why i still get 404 not found errors when the path is
> full load as in when i reference in my base.html file {{ Media_Url}} it
> actually resolves to /media/ yet the file is still not found.
>
> If anyone can help, please let me know. i have spent way to long on this
> small issue.

I remember I found it tricky in the beginning. The way I finally got my
head around it was to put print statements in my settings file (if DEBUG
of course) to output the paths for static and media dirs. Then I
experimented with settings.STATICFILES_FINDERS until I figured out
exactly what delivered the goods.

hth

Mike

>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/r63T5ycQ81MJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate