ive been changing the structure of my projects/applications over and
over.
thats because every time i change it, i realize i can make it a bit
different.
the whole time i felt it was neccessary to allow for multiple projects
on the same host.
well now that ive finally gotten somewhere, i was hoping someone else
would have some input on how i can improve, or have a different spin
on things?

on my production server (which is ubuntu, my dev is on windows, but
the same ideas apply)
in my /home/username directory i have:

- projects/
-- project 1/
--- apps/
----app 1/
----app 2/
-- project 2/
-- project 3/
---apps
----app 1/

- common/
-- app 1/
-- app 2/

- external/
-- app 1/
-- app 2/
-- app 3/
-- app 4/

basically, the idea being that i store my projects in the projects
folder
i put applications that i build that will be used by more than one
project into the common folder
and applications that i have grabbed from other people (comment_utils,
tagging, etc) into the external folder, and obv apps that are not
reusable into the project's app folder

then for each virtual host, i add to the python path the projects
folder (then reference settings by projectname.settings, from
observation, django adds the project to the python path itsself), and
the common folder and the external folder.

that works for apache, but then to get manage.py to work (it doesnt
work because none of the python paths are set for it), i edit /etc/
environment and add line
PYTHONPATH="/home/username/projects:/home/username/common:/home/
username/external"

does anyone else have any suggestions?
one thing im still in debate is, in the virtualhost pythonpath, i
could, instead of adding the whole projects folder to the python path,
is to add the actual project's folder to it, and then reference
settings just as settings instead of projectname.settings

but then that would be inconsistent with the environment variable
setup for manage.py
... so then i can do it how i did it a long time ago (this is what
lead me down the current path) and that is, every time i work with a
project's manage.py, type
export PYTHONPATH="/home/username/projectname"

that got annoying.

oh, i forgot to add, in my settings py, i have

import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'apps'))

so that the apps folder for each project is automatically added
(hmm... now that i think about it, i wonder how much overhead there is
in that).


comments appreciated =)
--~--~---------~--~----~------------~-------~--~----~
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