How to (intentionally) skip an app with Django syncdb
I have several django apps:
INSTALLED_APPS = (
'geonode.exposure',
'geonode.isc_viewer',
'geonode.geodetic',
'geonode.observations',
'geonode.ged4gem',
I need to manage all of them except one c syncdb
. How can I get to syncdb
intentionally skip the application geonode.exposure
?
Update: I have not covered the full configuration, please let me elaborate further: I use south to manage migrations and fixtures db for all applications except for impact cases. The Exposure app accesses an external database and uses a router to do this (which is why I want syncdb to skip this). My router settings look like this:
class GedRouter(object):
def db_for_read(self, model, **hints):
"Point all operations on ged models to 'geddb'"
if model._meta.app_label == 'exposure':
return 'geddb'
return 'default'
def allow_syncdb(self, db, model):
if db == 'geddb' or model._meta.app_label == "ged":
return False # we're not using syncdb on our legacy database
else: # but all other models/databases are fine
return True
Doesn't the south respect the allow_syncdb method? south works syncbd in exposure app because i dont have migration for it?
source to share
There is a "managed" model meta option, for more info: django:
https://docs.djangoproject.com/en/dev/ref/models/options/#managed
source to share
Ok, this is not what you are asking directly, but please consider using the south http://south.aeracode.org
You can decide which applications to include which version of the model to migrate, etc. It looks like you need a solution here.
source to share