On Wed, 2006-10-25 at 14:58 +0200, patrickk wrote: > thanks malcolm, I think we´re getting closer ... > > Am 25.10.2006 um 14:42 schrieb Malcolm Tredinnick: > > > > > On Wed, 2006-10-25 at 14:13 +0200, patrickk wrote: > >> sorry for being a pain in the neck, but we´re about to go online with > >> our site and I desperately need to solve this problem. > > > > You already mentioned that you have solved it using lighttpd (or, at > > least, that's what you seem to have mentioned), so if things are > > really > > that tight, use lighttpd for your development. Spending (apparently) > > hours just to try and use the django development server in your chosen > > configuration seems like time wasted in your current circumstances. > > misunderstanding. I just mentioned that we´re using lighttpd to serve > media in production mode.
This is all very confusing, since it's not at all clear what you have working and what you don't. If you already have something that works in production mode, then the simplest solution of all is to replicate that on your development environment. > > > > >> solutions I had so far: > >> 1. hardcoding media-urls incl. the host (not nice) > >> 2. symlink from /django/contrib/media/ to /media/ (problem with > >> django-updates) > > > > Why would you do the symlink in that direction? Link /media to the > > Django source tree, then things served from /media are read from teh > > Django source. > > > >> short description again: > >> in my source-code I´m having this > >> <img src="/media/uploads/userprofiles/2006/10/210/tn_profil.jpg" /> > > > > You seem to be jumbling up a few different uses of "media" throughout > > all this. If you are using the /media/ prefix to serve admin media, > > why > > not put the uploaded files under another URL prefix? It looks like > > some > > of your problems might come from trying to insist that both uploaded > > files and admin media are served from "/media/". > > that´s true. all our media is in /media/ ... is that not possible? It may not be possible with the development server. Since the development server is designed to be very simplistic, it doesn't have all the functionality of a full-blown web server. It just doesn't need it. > if I change ADMIN_MEDIA_PREFIX, none of the css, images etc. is > loaded with using the dev-server. Strange. I've had that working before. And if you look in django/core/servers/basehttp.py, in AdminMediaHandler, you can see how the development server intercepts calls to the ADMIN_MEDIA_PREFIX correctly. Still, that's all a bit of a side issue. > our directory-structure: > /media/css/ > /media/js/ > /media/uploads/ > /media/img/ I've got a very similar setup working under Apache, but there are more than just one or two lines of configuration involved to get the right things being served from the right location. So I wouldn't expect this to work under the dev server (because of the way AdminMediaHandler works). You've given yourself an impossible set of constraints here. You want: (1) to use the dev server (2) no changes when moving to production (3) to have core and non-core content served out of the ADMIN_MEDIA_PREFIX prefix. You can't have (1) and (3) without changing Django (you could write your own AdminMediaHandler class, but that would take more time), so if you want (1) in development and (3) in production, you can't have (2) as well. Setting up Apache or lighthttpd locally is not that hard. Just bite the bullet. Please! Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---

