Hi all -- semi-new to Django but learning fast and enjoyed meeting a lot of
folks at DjangoCon last week! I have some basic project setup and
terminology questions I'm hoping to get some thoughts on.

Basically I'm curious as to the convention about creating a project using
virtualenv and then adding applications to the project in terms of where
the files are placed. I'll just go through what I've been doing and I'd
welcome any and all feedback as to where I'm breaking with conventional
wisdom.

Let's say I'm starting a new project foo and run this from a ~/projects
directory:
virutalenv foo

So at that point I have ~/projects/foo I then cd into that directory,
activate that virtualenv, and install Django
cd ~/projects/foo
source bin/activate
bin/pip install django

I then start the Django project from ~/projects/foo:
bin/django-admin.py startproject foo

At that point I have ~/projects/foo/foo for my project directory, and in
there it puts another foo for the foo application (I'm assuming that's
accurate terminology? or is that the "project" since that's where
settings.py lives?).

So it's clear what I have at this point:
~/projects/foo <-- root virtualenv directory containing bin, include, etc.
~/projects/foo/foo <-- root project directory containing manage.py and foo
application (or is it called project?) directory
~/projects/foo/foo/foo <-- foo application (project?) directory containing
settings.py, etc.

If that's correct thus far (and please let me know if not!), my next
question is where to create additional applications. I'm assuming that in
this case if I want to create a bar app I cd into ~/projects/foo/foo and
run:
python manage.py startapp bar

So that that point I have:
~/projects/foo/foo/foo <-- where settings.py lives
~/projects/foo/foo/bar <-- bar application files (models.py, etc.)

Specifically on this last piece, should I be creating things there or is
the convention to put applications in the same directory as settings.py, so
you wind up with your application directories at the same level as
settings.py? E.g.:
~/projects/foo/foo/foo <-- where settings.py lives
~/projects/foo/foo/foo/bar <-- bar application files

It certainly works fine the way I'm doing it as long as I reference the
location of the application files correctly, but in a lot of the books I've
been reading application files would be referenced using this example as
'foo.bar' instead of just 'bar' which is what I wind up with the way I've
been doing things.

Any thoughts/pointers/admonitions/etc. are greatly appreciated.

Thanks,
Matt

-- 
Matthew Woodward
m...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to