On Wednesday, 11 April 2012 at 8:10 PM, Jason Ma wrote: > Hi, > I download and tried to use the Django 1.4 yesterday. I am a dummy > and I just follow the official document, but When I just start a > project. > I found that it is what I see from my computer: > > jason@jason-pc:~/workspace/hunqing$ tree . > . > ├── hunqing > │ ├── __init__.py > │ ├── __init__.pyc > │ ├── settings.py > │ ├── settings.pyc > │ ├── urls.py > │ ├── urls.pyc > │ ├── wsgi.py > │ └── wsgi.pyc > ├── __init__.py > ├── manage.py > ├── settings.py > └── urls.py > > but what doc say? > mysite/ > manage.py > mysite/ > __init__.py > settings.py > urls.py > wsgi.py
First rule: If you're following a tutorial and want to follow along, you need to actually follow the instructions as given. The tutorial asks you to type: django-admin.py startproject mysite >From the looks of it, you didn't type that. You typed: django-admin.py startproject hunqing Furthermore, you've evidently run some of the code before you looked at the directory structure. .pyc files are the Python runtime's precompiled byte code output. If you look at the directory structure at the point the tutorial asks you to, you shouldn't see any .pyc files. If you're using an IDE, it's possible the IDE might have compiled these files for you. Regardless, the existence of .pyc files shouldn't be a surprise to anyone that has used Python before. Django's installation guides tells you that you're going to need to install Python -- that should be enough of a hint that you're probably going to need to know a little bit about Python in order to use Django. Django's tutorial can't -- nor should it -- teach you everything there is to know about Python. At some point, we have to assume that you're going to learn the language that Django uses. > If you're a beginner, what are you going to say, yes, F! Why I created > more files? I heavily doubted that whether the writers have tested > that carefully. Ok, forget that, We'll see and continue. We've checked the tutorial quite carefully. To be doubly sure, I've just worked through the start of the tutorial myself to make sure it matches what is described -- and it does. If you follow the instructions as written, you should get the output as described. If you don't follow the instructions as written, then its anyone's guess what you'll get. > In the later chapter, we created two classes in the models.py in > polls, I do all the steps same as the doc except that one columns > name, mine is questions whereas the doc is question, so I want to test > the power of the syncdb, I modified the model.py and I just do the > python manage.py sql polls, that's ok, it is correct name this time. > So I just run it to change it in database using python manage.py > syncdb, it works too. But go to the db and see, the table is not > changed at all. I want to say F again now. That's what doc say: > > The syncdb command runs the SQL from sqlall on your database for all > apps in INSTALLED_APPS that don't already exist in your database. This > creates all the tables, initial data and indexes for any apps you've > added to your project since the last time you ran syncdb. syncdb can > be called as often as you like, and it will only ever create the > tables that don't exist. > > That's gr8, If you just create the tables that don't exist, why do you > syncdb successfully? One basic rule of database is consistence, if you > can't created the tables you want, why don't get alert? I am not a > good programmer though, I do know if you can't do something, just say > it. How can I know the error without any prompt? But it *does* give you a prompt. When you run syncdb, the output tells you exactly what has, and what has not, been created. So, if a table for myapp.MyModel has been created, in the output of syncdb you'll see a message that looks something like: Creating table myapp_mymodel If you then go and modify MyModel, and then run syncdb again, you won't see this message. That means that the table hasn't been created as a result of your syncdb call. If you run syncdb, and you *don't* see a "Creating table" message that you were expecting, then you should probably go looking to see why. > There are many people saying the Django is well-documented, do you > still think it is true? I may be biased, but I certainly think so. If you print Django's documentation, it runs to over 900 pages. That's not 900 pages of auto generated JavaDoc style APIs, either -- it's 900 pages of hand-crafted prose. There aren't too many open source frameworks (or frameworks of any stripe, for that matter) that can claim that. As for the question in your subject -- Is Django a "Serious framework"? Well, Instagram just got sold for $1 billion, and it's a Django site. AMD, Canonical, Discovery, Disqus, HP, IBM, Intel, Lexis-Nexis, the Library of Congress, Mozilla, NASA, National Geographic, the New York Times, Orbitz, PBS, Pinterest, Rdio, VMWare, Walt Disney, the Washington Post, and many, many more all use Django in some capacity. Sounds like a serious framework to me. Is Django perfect? Certainly not. Is the documentation perfect? Certainly not. But is it a solid, scalable framework that has some of the most comprehensive documentation you'll find on an open source project? Yes. We're always open to suggestions -- so if you can come up with any constructive suggestions on how we could improve the tutorial, the documentation, or the framework itself, feel free to make those suggestions. Yours, Russ Magee %-) -- 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.