Hi!

I've many Django projects that doesn't have any relation. In
production I use different domains, so I have different virtual hosts
for them, and everything is ok.

In development I want to have just one domain, and access all my
projects from it. Something like:

http://dev.mycompany.com/project1 (that in production will be www.project1.com)
http://dev.mycompany.com/project2
...

Structure that I use is something like:

/var/www
/var/www/project1
/var/www/project1/settings.py
/var/www/project1/media
/var/www/project1/media/css
/var/www/project1/media/img
...
/var/www/project2
/var/www/project1/media
...

In production I set DocumentRoot to /var/www/project1/media, so I just
point to /img/myimage.png for static files.

Using Django's documentation setup is great for Django's served pages:

<VirtualHost *>
    ServerName www.example.com
    # ...
    <Location "/something">
        SetEnv DJANGO_SETTINGS_MODULE mysite.settings
        PythonInterpreter mysite
    </Location>

    <Location "/otherthing">
        SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
        PythonInterpreter mysite_other
    </Location>
</VirtualHost>

But how can I set where to find media file?

If I just add:

        <LocationMatch "/(css|js|img|swf)/">
                SetHandler None
        </LocationMatch>

a request to http://dev.mycompany.com/project1/img/myimage.png will be
searched in:
/var/www/img/myimage.png (DocumentRoot + link)
and should be searched in
/var/www/project1/media/img/myimage.png (DocumentRoot + project path
from requested url + link)

Thanks a lot!
  Marc
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to