google-code-export / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Ability to add a prefix for static content? #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Is there a way to add a prefix to all of the static images? From what I
understand photologue uses Django's reverse() function which seems to
always use a url that Django will handle (rather than have apache or
whatever serve the static content). It would be great if I could prefix
something like /static to all thumbnails and images. Any ideas?

Last resort would be to edit all of the templates.

Great app btw.

Original issue reported on code.google.com by cfatta...@gmail.com on 27 Jul 2009 at 9:26

GoogleCodeExporter commented 9 years ago
It uses reverse when it generates the url for a view (such as the photo detail 
page). 
Otherwise, if you call get_SIZE_url it just returns the URL of image itself 
(the static 
url). Is there a specific place where you think the behavior is wrong?

Original comment by justin.d...@gmail.com on 28 Jul 2009 at 12:25

GoogleCodeExporter commented 9 years ago
For example if my gallery is at /photologue/gallery/test/ The template,
gallery_detail.html {{ photo.get_thumbnail_url }} returns a url for the 
thumbnail at
/photologue/gallery/sts-launch/photologue/photos/cache/picture_thumbail.jpg
Which the way this is setup will try to have the app serve the static content. 
I am
not sure if there is an easy way to add a prefix to these urls (/static/) so 
that
apache can serve them instead.

I have tried to add my own get_thumbnail_url method in the Photo class but it is
ignored. The only solution I can see is to add a prefix in to get_thumbnail_url 
and
get_display_url in all of the templates.

Sorry this isn't very specific, I am willing to accept that my setup is wrong. I
Appreciate your input.

Original comment by cfatta...@gmail.com on 28 Jul 2009 at 5:13

GoogleCodeExporter commented 9 years ago
There's a problem in your settings. Check you MEDIA_ROOT and MEDIA_URL config.

Original comment by justin.d...@gmail.com on 28 Jul 2009 at 5:16

GoogleCodeExporter commented 9 years ago
You're right, MEDIA_URL was not set. Thanks for the quick reply.

Original comment by cfatta...@gmail.com on 28 Jul 2009 at 5:21

GoogleCodeExporter commented 9 years ago
No problem.

Original comment by justin.d...@gmail.com on 28 Jul 2009 at 5:24