static content server

1 view
Skip to first unread message

heru

unread,
Mar 1, 2009, 3:18:53 PM3/1/09
to glashammer
hi,

firstly i'm new user to glashammer, i usually use django.
my question is, how if i want to serve the static content from other
server?
for example in django we could define the media url in setting file
and django use a function to get the setting
do i have to write down a function also to get the media url from
another server?
is there a chance to use the url_for?

thanks

Ali Afshar

unread,
Mar 1, 2009, 7:37:15 PM3/1/09
to glash...@googlegroups.com

Hi, the way it currently stands, yes you will need to write your own
function to get the information. One thing I usually do though is to
always serve media files aliased from a real server: apache/nginx etc.
This way in development I get served static files through WSGI using
Glashammer's add_shared_directory, then later use aliases to those same
directories on the same URLs. The gh-admin script has a staticaliases
command just for this purpose. It takes the app, and works out what
aliases you will need for the web server.

This way, I don't need two web servers.

Ali

Reply all
Reply to author
Forward
0 new messages