Beispiel #1
0
"""Django DEMO settings for maas project."""

from os.path import abspath

from maasserver.djangosettings import (
    development,
    import_settings,
    settings,
)

# We expect the following settings to be overridden. They are mentioned here
# to silence lint warnings.
MIDDLEWARE_CLASSES = None

# Extend base and development settings.
import_settings(settings)
import_settings(development)

MEDIA_ROOT = abspath("media/demo")

# Connect to the DNS server. TODO: Use the signals manager instead.
DNS_CONNECT = True

# Connect to the DHCP server. TODO: Use the signals manager instead.
DHCP_CONNECT = True

# Connect to the PROXY server. TODO: Use the signals manager instead.
PROXY_CONNECT = True

MAAS_CLI = abspath("bin/maas")
Beispiel #2
0
from formencode.validators import StringBool
from maasserver.djangosettings import (
    fix_up_databases,
    import_settings,
    settings,
)

# We expect the following settings to be overridden. They are mentioned here
# to silence lint warnings: import_settings() below will actually re-set it
# to a tuple as set in settings.INSTALLED_APPS, and TEMPLATES to a dict.
INSTALLED_APPS = None
TEMPLATES = {}

# Extend base settings.
import_settings(settings)

prevent_migrations = StringBool().to_python(
    os.environ.get("MAAS_PREVENT_MIGRATIONS", 0))

if prevent_migrations:
    INSTALLED_APPS += ("maasserver.tests", "metadataserver.tests")

# Use our custom test runner, which makes sure that a local database
# cluster is running in the branch.
TEST_RUNNER = 'maastesting.djangoloader.MAASDjangoTestRunner'

# Don't connect to the DNS server in development because bind is not running
# and no access to write into the required directories.
DNS_CONNECT = False