Hello, why not is possible override the command runserver.py in my custom app in Django 1.7, like this
# encoding: utf-8
from django.conf import settings
from django.core.management.base import CommandError, BaseCommand
# from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand
from django.core.management.commands.runserver import Command as RunserverCommand
class Command(RunserverCommand):
def handle(self, addrport='', *args, **options):
database = options.get('database', 'default')
if (settings.DATABASES[database]['ENGINE'] == 'saas.backends.postgresql_psycopg2' or
RunserverCommand is BaseCommand):
raise CommandError("migrate has been disabled, for database '{}'. Use migrate_schemas "
"instead. Please read the documentation if you don't know why you "
"shouldn't call migrate directly!".format(database))
super(Command, self).handle(self, addrport='', *args, **options)
def check_migrations(self):
"""
Checks to see if the set of migrations on disk matches the
migrations in the database. Prints a warning if they don't match.
"""
print('OK')
The output when i run manage.py, note that the runserver is not present in [saas] commands
Available subcommands:
[auth]
..
[debug_toolbar]
..
[django]
..
[reversion]
...
[saas]
migrate
migrate_saas
migrate_schemas
sync_schemas
syncdb
tenant_command
[sessions]
..
[staticfiles]
collectstatic
findstatic
runserver