yet another Python Web Framework - heavy MVC mentality
Feb'2012: at version 1.3.1
book printed in 2007 covered v0.96. There's a "web preview" available there covering the newer versions, though most of the action there seems like it's from 2009.
Simon Willison was involved along with Adrian Holovaty.
http://technorati.com/tags/django
http://www.dehora.net/journal/2005/08/django_debugging_and_mvcp_frameworks.html
http://www.postneo.com/2005/07/18/django-gotchas
1100+ "packages" (apps) to leverage. So much redundancy that they have a grid system for evaluating alternatives.
intro implementing a ToDoList.
steps in processing a request
extending its User Model for Web Authentication (2006) (e.g. to add extra fields to the user's profile)
Mar'2011 - still doesn't use email address as identifier (instead of username) very well http://www.micahcarrick.com/django-email-authentication.html
Starting to play with it - Mar'2009
There's a book-v2 draft in-process that includes django-v1 (book currently in print doesn't cover that version).
Running it on my MacBook, just using SQLite for now.
- looks like framework code is within '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django'
Decided it's time to try TextMate.
To run multiple projects, it looks like I set a manual port number when launching like 'python manage.py runserver 8001'.
At first blush, I hate the Template System here as much as with every other one. Though maybe the extra goodies make it worthwhile...
Database chapter
doesn't include setup info for SQLite - see v1 book for that (or, duh, just look at the comments in the settings file)
missing 'unicode' method for Book class
More ORM joys:
Unless you instruct it otherwise, Django automatically gives every model an auto-incrementing integer primary key field called id. Each Django model is required to have a single-column primary key.
you could swap in Sql Alchemy if you wanted that flavor
what if you want to partition your data across multiple databases/servers?
what if you want to use a non-SQL Data Store (e.g. like CouchDb, the File System, or AmazonS3) for some of your data?
Adding null=True is more complicated than adding blank=True, because null=True changes the semantics of the database - that is, it changes the CREATE TABLE statement to remove the NOT NULL from the publication_date field. To complete this change, we'll need to update the database. For a number of reasons, Django does not attempt to automate changes to database schemas, so it's your own responsibility to execute the appropriate ALTER TABLE statement whenever you make such a change to a model.
Uh, boy, turning on the admin interface created all sorts of issues
- contrary to docs, it never asked me about creating a superuser
then when I hit the '/admin/' url, it told me I needed to uncomment 'django.contrib.contenttypes' in my 'I N S T A L L E D_APPS' list.
then when I hit url again, it said "'W S G I Request' object has no attribute 'user'"
ok, I also uncommented 'django.contrib.auth', having done 'django.contrib.auth' before; then re-ran syncdb, which then properly had me set up super-user.
argh, still getting the "'W S G I Request' object has no attribute 'user'" message
I un-commented the 3 'M I D D L E W A R E_CLASSES' entries. Now get much messier traceback ending with 'Operational Error: no such table: django_session'
- So I also uncommented 'django.contrib.sessions', re-ran syncdb, then everything was good.
Apr23'2009: Set up Mac Personal Svn Server before going further.
Apr23 decide to jump into using PinAx, and working on a personal project
Aug'2010 - start building app with DjanGo and MongoDb, so avoiding PinAx for now, but using the Virtual Env I created there.... Django And Mongodb.
Then decide that's a distraction, and I should focus on the product and stay with the mainstream/core framework.
Sept15'2010
start fresh, following docs for 1.2.
create director/app inside Virtual Env pinax-env/mf/
- launch, hit root, it loads fine
edit settings.py file per docs (uncomment admin app line, too). Using SQLite-3. Set db NAME=~/Documents/djcode.../mf/mf.sql
run syncdb get sqlite3.OperationalError: unable to open database file
used chmod to widen permissions in that directory: no difference
tried changing file-extension to .db, then to leave it completely off: no difference
changed path to db file to be full (start with /Users/billseitz... instead of ~ - it worked. (Now have mf.db.)
as part of syncdb it asked if I wanted to set admin superuser, so I did (and this time I documented it in my Private Wiki).
need to start app within the project. It won't let you use the same name for both, so the app is family
Sept26 update: decide to get complicated, and use 2 Data Store-s
SQL for users/accounts/payments (make this the "default")
Django And Mongodb for everything else
hmm, using a tuple of DATABASES entries is for multiple SQL backends. It smells like I keep a single item there for the SQL, and a from mongoengine import connect section for MongoDB...
post to discussion to see if this is kosher.
Outcome: get DayJob, put this on hold.
Mar'2012: come back, decide to stick with straight DjanGo (and SQL): Django For Simplest Thing.