Hi,
On 7/30/06, Guillermo Fernandez Castellanos <[EMAIL PROTECTED] > wrote:
> I'm going to have a server with several domain names serve a few
> applications (blog, photo gallery,...). But I'm a bit at a loss when
> dealing with how to organize the different files.
I prefer your second solution, with modifications. I like the idea of self-contained reusable applications to simplify deploying dependencies. At work we try to separate projects from sites using this layout:
Starting at /home/work/django
media/
(common media files and folders)
(soft links to real media folders)
templates/
(common templates)
apps/
blog/
media/
templates/
photogallery/
media/
templates/
sites/
site1/
config/
settings.py
urls.py
manage.py
site2/
config/
settings.py
urls.py
manage.py
site1 vhost config is as follows (using apache 2.0 and mod_python)
<VirtualHost *:80>
ServerName site1
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE config.settings
PythonPath "['/home/work/django/apps', '/home/work/django/sites/site1'] +
sys.path"
</Location>
Alias /media "/home/work/django/media"
<Directory "/home/work/django/media">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
RewriteRule ^/media$ /media/ [R]
<Location "/media/">
SetHandler None
</Location>
</VirtualHost>
site2 vhost config:
(Same as above, changing ServerName and PythonPath)
You don't need to make soft links in apps template folders if you configure properly settings.py:
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source
',
'django.template.loaders.app_directories.load_template_source', # :-)
)
This layout works because we use the same server machine for django and static files. Probably in a more optimized environment you will need to copy application media folders to the static content server.
Nos vemos!
--
Obstáculos es lo que ves cuando apartas la vista del objetivo.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
- Re: django server tree organization Miguel Hernández
- Re: django server tree organization Kenneth Gonsalves
- Re: django server tree organizati... Guillermo Fernandez Castellanos

