django

July 9, 2007 on 1:00 am | In .english, webdev | 1 Comment

Let’s assume you want to see the django admin pages for an existing mysql database, let’s also assume you’ve installed django:

1. django-admin startproject foo
2. cd foo

Fill out existing mysql db auth AND add ‘foo.bar’ in the module-list at the bottom.

1. vi settings.py
2. python manage.py startapp bar
3. python manage.py inspectdb > bar/models.py
4. vi bar/models.py # add ‘class Admin: pass’ to the data classes
5. vi urls.py # enable /admin access
6. python manage.py syncdb
7. python manage.py runserver

The admin interface should run now, but it doesn’t, in fact. It complains about a module that needs to be added to settings.py. okay, no sweat. You can edit the site at runtime anyway :-)

Here is my first try on a vblog, just talking about django a bit:

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^

[rss feed: http://blog.superstring.nl/feed/rss/]