On Sat, 2008-11-15 at 16:13 -0800, dash86no wrote: > Hi everyone, > > I'm new to django, and this I have been doing my best to follow online > documentation to help me get my first site up and running. My main > source has been: > > http://www.djangobook.com/en/1.0/ > > Now this has been great but i'm starting to get the sense that django > is a fast moving project and some of the material may be a little out > of date now. Specifically: http://www.djangobook.com/en/1.0/chapter06/ > the chapter about setting up the admin interface tells me to add: > > class Admin: > pass > > to my models.py file under the relevant class definitions. However, > after having done this, and uncommenting the relevant lines in urls.py > and settings.py to set up the superuser and allow access to the admin, > I can log into the admin interface, but the only site I can see in > there is: "example.com". > > I did a bit of reading around and found this: > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/ > > Which seems very different to the method described in djangobook.com. > I would follow this documentation, but it describes an "admin.py" > file, which does not exist within my project folder or my app folder. > > I'm a little confused, and would appreciate it if somebody could point > me to the current "authoritative" tutorials, so I can begin to get > back on the right path here. > > Cheers,
Hi Dash, I believe the method for bringing models up in 1.0+ has changed from previous. Instead you need to now add the following: from django.contrib import admin in your import statements and then use the following to "register" your models with the admin interface. admin.site.register([NAME_OF_MODEL_TO_REGISTER]) -- James Purser http://collaborynth.com.au Mob: 0406 576 553 Ph: +61 2 8210 6725 Skype: collaborynth
signature.asc
Description: This is a digitally signed message part