Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Serving sphene media from a different server

Hi,

We serve all of our media from a seperate server (media.domain.com). Are there any plans to make sphene respect the media_root settings of the rest of the site? Ideally sphene would just use the MEDIA_URL in templates wherever images, css or js is referenced. A symbolic link could then be setup from MEDIA_ROOT to point to /communitiytools/static.

I hate to make direct changes to the the source of sphene, as that can make future upgrades a headache...

What do you think?
i think you are right.. it should be using MEDIA_ROOT instead of simply /static ..

but i don't think this will require too many changes.. there are only the stylesheets and the forum category icons which are static media files.. (and the emoticons in the board, which already use MEDIA_ROOT) ... i have created an issue for this: http://code.google.com/p/sct-project/issues/detail?id=72
Hey, we have Signatures !!! Great, isn't it ? ;)
Hi!

I've attached a patch, for media_url issue, to this post. It works for me but is not heavily tested.
The patch applies some changes to templates (replacement of "/static/" with {{ MEDIA_URL }}) and one change to templatetags (to pass context to a rendered template).

After applying you should correct your MEDIA_ROOT in settings.py and your development settings for static files in urls.py.
Attachments
hi,

cool thanks ! i have already applied it .. and it seems to work without any problems

i only had to include the context processor django.core.context_processors.media and everything kept working ..

so i have now committed your changes - thanks again ..

please let me know if i can include your name and email address in the AUTHORS file to attribute your patch
Hey, we have Signatures !!! Great, isn't it ? ;)
hi,

cool thanks ! i have already applied it .. and it seems to work without any problems
Nice to hear that :)

i only had to include the context processor django.core.context_processors.media and everything kept working ..

Oh yes. I forget to mention that.

so i have now committed your changes - thanks again ..

please let me know if i can include your name and email address in the AUTHORS file to attribute your patch

Yes, sure. I've updated my profile.

Thanks a lot!

Please login to post a reply.



Powered by Sphene Community Tools