Thanks a lot for the feedback everyone.
I have come up a perfect setup and folder structure (at least
perfect for my needs) that will allow me to work on generic apps and
project specific apps efficiently and just wanted to share it with
everyone in case it can save a anyone a headache.
*Folder structure for a django project*
/var/django_root/my_project_name/
urls.py
settings.py
apps/
my_project_specific_app_1/
my_project_specific_app_2/
my_project_specific_app_3/
*Folder structure for generic/portable apps*
/var/django_root/shared/
my_generic_portable_app_1/
my_generic_portable_app_2/
my_generic_portable_registration_app/
*Development Setup*
I added the following to the top of my_project_name/settings.py so it
appends the portable/generic apps folder to the python path.
DEVELOPMENT = True
if DEVELOPMENT:
import sys
sys.path.append('/var/django_root/shared')
For extended convenience I symlinked my portable/generic apps folder
to my django project so I can quickly make changes to my generic apps
without having to go outside my django project folder structure
ln -s `pwd`/var/django_root/shared /var/django_root/my_project_name/
shared
*Production Setup*
My Apache conf file:
<VirtualHost *>
ServerName championsound.local
ServerAlias *.championsound.local
SetHandler python-program
PythonPath "['/var/django_root', '/var/django_root/shared'] +
sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE championsound.settings
PythonDebug On
</VirtualHost>
Note how '/var/django_root' and '/var/django_root/shared' are added to
the PythonPath
Enjoy it!
Sebastian Macias
On Jul 25, 6:19 am, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
> On 7/24/07, Sebastian Macias <[EMAIL PROTECTED]> wrote:
>
> > My dilemma is... what is the point of having projects and apps if the
> > applications created for my project won't be portable in other
> > projects (becase the namespaces will always start with the project
> > name). I can't just copy and app from one project to another.
>
> Personally I never use "projects" -- they were just a quick thing we
> made up just before we open-sourced Django, with the thinking being
> "projects" would make it quicker and easier for people to get started.
> They are *not* a good method to use if you want to distribute your
> application, however.
>
> We need better documentation about best practices to make apps portable.
>
> Adrian
>
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---