views:

25

answers:

1

Hay all, I've been reading up on middleware and how to use it with a context object. I want to write a simple middleware class which i can use on my own applications, it will essentially be a cut down version of the django one.

The problem i seem to have is that if i have

INSTALLED_APPS = ('django.contrib.my_auth')

in the settings file, all is well. I've also added

MIDDLEWARE_CLASSES = ('django.contrib.my_auth.middleware.MyAuthMiddleware')

in it and everything is fine.

My question is, how would i make my middleware automatically generate tables from a models.py module, much like how the django auth does when i run manage.py syncdb?

thanks

+2  A: 

Django auth middleware doesn't generate any tables. Django does it looking through INSTALLED_APPS when you run manage.py syncdb. Therefore all should already be fine.

Leonid Shvechikov
so 'django.contrib.my_auth.models' should get run when i run manage.py syncdb
dotty
Oh, it does. Thanks!
dotty