How do I stop django from syncing certain tables when I do syncdb?
Whenever I run the syncdb command, I'm getting a lot of auth tables created but I'm not including the admin or auth packages. Here are the tables it is creating on its own:
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
I don't need these tables. In my settings.py file, I have commented out the AuthenticationMiddleware, MessageMiddleware and all apps except for django.contrib.sessions and my own personal apps. Is there a setting somewhere that I'm missing so that th开发者_JS百科ese tables aren't created?
Here are my INSTALLED_APPS
INSTALLED_APPS = (
'deanproxy.globaltags',
'deanproxy.blog',
'deanproxy.auth',
'deanproxy.twitter',
# 'django.contrib.auth',
# 'django.contrib.contenttypes',
'django.contrib.sessions',
# 'django.contrib.sites',
# 'django.contrib.messages',
#'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
EDIT: I Just realized that if I comment out my own app 'deanproxy.auth', that all of these tables are not created. However, my auth app isn't including any of the django auth stuff and it's a very, very simple auth system (just e-mail and password). It appears Django may be getting confused by the name of it...
I found the cause. I had an app called 'auth' which was a very simple auth system and nowhere near as involved as the django auth app. It appears that django was including all of these tables whenever I added 'deanproxy.auth' to my INSTALLED_APPS. Whenever I renamed this app to something else, these tables were not being included anymore. I'm going to try to track down why it does this... however, if anyone else has this issue, just name your app to something other than auth. Even though you're including it from your app, it still thinks it's the django auth system...
精彩评论