On Oct 26, 7:23 pm, Tobias McNulty <tob...@caktusgroup.com> wrote: > > IMHO the project namespace is a useful one to keep around. If you lose the > project name space, then you risk polluting your python path with a lot of > generic 'urls' modules, among other things. > > If your directory structure on your server includes the domain name, then > include the project folder under that. There's nothing stopping you from > housing more generic apps outside the project namespace.
Yeah, keeping the project namespace is reasonable, but pushing that package so that it's inside your project would make more sense. Instead of having a new project look like: mysite/ __init__.py manage.py settings.py urls.py Structure a Django project so it has the same layout as a normal Python project. Which might look something like: myinstance/ setup.py settings.py bin/ manage.py mysite/ __init__.py urls.py (not sure where settings.py is supposed to be though - it makes sense inside the project namespace, but then you shouldn't have user- editable files inside a package) > > On a related note, an on-going pet peeve of mine is that manage.py leaves > '.' on the python path. This can be confusing for new users who are trying > to figure out how to structure their imports. > If the structure of a Django project was changed, then you wouldn't need to take '.' off the path. The default Python path should be fine without further munging. (Well, I would agree that the Python interpreter shouldn't be putting '.' on the path to begin with, but that's done this since before Python 1.5 and I suspect this was done to make imports less confusing for new users - FWIW Ruby also does this, but Perl does not). I think the confusion arises with new users who don't realize that they're already working inside a python package (well, as an experienced users I find this pretty confusing too ...). If you don't mix executables and library code together (e.g. manage.py shouldn't be inside a python package!), then having '.' on the path doesn't become an issue. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---