On Wed, 2009-03-11 at 01:01 -0700, Matt Doran wrote: > Hi Malcolm, > > On Mar 8, 4:57 pm, Malcolm Tredinnick <malc...@pointy-stick.com> > wrote: [...] > It seems that by making into a package, it make the django novice feel > like there is more importance to the "project" than there really > is.... and that some black magic is at play. My initial reaction is > to not touch things, because I don't understand them. If I delete the > "__init__.py" file then the local "manage.py" file fails to run.
You are kind of mixing up two modes of operation here. *Either* you are using the kind of default structure that Django provides, which means you are using manage.py, which adds the directory it lives in to the path and operates on a "project containing application directories" assumption. *Or* you are adding a bunch of application directories to somewhere on your Python path, pointing to a settings file, using django-admin.py, etc. The reason __init__.py is in the project directory is because you asked django to create a "project" structure for you. Case A, above. That's an aid to beginners. There are about 400 different things to learn when somebody is starting out with Django and, as I've noted before in this thread, I believe, many of them don't have particularly good Python knowledge. And at that point on the learning curve, trying to mess around with the basic layout is probably ill-advised, both in terms of requiring knowledge about Python stuff and because 398 of the other things on that list are more important. > Do you think there would be any benefit of changing this so it's not a > "module", which will make it more obvious to newbies about how django > works. But Django works fine if it is a module. It even makes some things easier for people starting out. I'm of the opinion that the "startproject" structure isn't necessarily broken if you aren't expecting it solve all of your problems. There was a huge thread about this recently on the list and I'll stick by what I wrote there. There are levels of mastery and trying to run before walking or even crawling is not a problem with Django's design. I don't personally mind Django making some concessions for the still-learning-crawl and -walk brigade, since it doesn't impose hardship on the people who are into running and flying. Again, I suspect you're over-thinking things here. If you don't want __init__.py in the project directory, then you don't need it. But it's pretty irrelevant in the grand scheme of things when you're starting to learn Django, so I wouldn't spend any real time on it. Remember that everybody comes to this with vastly different levels of both experience and personal preference. Pleasing everybody is obviously impossible, but pleasing anybody down to a tee is also so. Everybody has to make some concessions at the beginning. As you go further down the track, you realise which things are simply conventions and which are requirements (kind of why I wrote that blog post you read), but that's pretty far down the list of things to worry about initially. I guess what I"m trying to say here is this: by all means poke around and find something that is most comfortable for you. That way you'll both feel happy with the layout and learn more about what's going on. But we have an awful lot of experience with people coming to Django and the current structure of things has stood up pretty well. When you're just learning the platform, making suggestions on subtle changes like that is probably a bit too soon. The current layout doesn't get in the way of anything. It helps out a large group of beginners. Alternate layouts would have similar benefits and trade-offs and we have to pick something. Probably not worth messing around the edges too much, for the sake of stability and consistency. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---