Beispiel #1
0
    def REQUIRED_APPS(self):
        apps = [
            'django.contrib.auth', 'django.contrib.contenttypes',
            'django.contrib.sessions', 'django.contrib.sites',
            'django.contrib.messages', 'django.contrib.staticfiles',
            'django.contrib.admin'
        ] + fp.get_required_apps() + ['contact_us']

        if django.VERSION[1] < 7:
            apps.append('south')
        return apps
Beispiel #2
0
    def REQUIRED_APPS(self):
        apps = [
            'django.contrib.auth',
            'django.contrib.contenttypes',
            'django.contrib.sessions',
            'django.contrib.sites',
            'django.contrib.messages',
            'django.contrib.staticfiles',
            'django.contrib.admin'] + fp.get_required_apps() + ['contact_us']

        if django.VERSION[1] < 7:
            apps.append('south')
        return apps
Beispiel #3
0
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.flatpages',
    'django.contrib.admin',

    'compressor',
]

THIRD_PARTY_APPS = [
    'debug_toolbar',
]

OFP_APPS = fp.get_required_apps() + fp.get_fancypages_apps(use_with_oscar=True)

from oscar import get_core_apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + OFP_APPS + get_core_apps()

AUTHENTICATION_BACKENDS = (
    'oscar.apps.customer.auth_backends.Emailbackend',
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_REDIRECT_URL = '/accounts/'
APPEND_SLASH = True

DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False
}
def get_required_apps():
    return fp.get_required_apps()
def pytest_configure():
    from fancypages.defaults import FANCYPAGES_SETTINGS

    if not settings.configured:
        settings.configure(
            DATABASES={
                'default': {
                    'ENGINE': 'django.db.backends.sqlite3',
                    'NAME': ':memory:',
                }
            },
            MEDIA_ROOT=sandbox('public/media'),
            MEDIA_URL='/media/',
            STATIC_URL='/static/',
            STATICFILES_DIRS=[
                sandbox('static/')
            ],
            STATIC_ROOT=sandbox('public'),
            STATICFILES_FINDERS=(
                'django.contrib.staticfiles.finders.FileSystemFinder',
                'django.contrib.staticfiles.finders.AppDirectoriesFinder',
                'compressor.finders.CompressorFinder',
            ),
            TEMPLATE_LOADERS=(
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ),
            TEMPLATE_CONTEXT_PROCESSORS = (
                "django.contrib.auth.context_processors.auth",
                "django.core.context_processors.request",
                "django.core.context_processors.debug",
                "django.core.context_processors.i18n",
                "django.core.context_processors.media",
                "django.core.context_processors.static",
                "django.contrib.messages.context_processors.messages",
            ),
            MIDDLEWARE_CLASSES=(
                'django.middleware.common.CommonMiddleware',
                'django.contrib.sessions.middleware.SessionMiddleware',
                'django.middleware.csrf.CsrfViewMiddleware',
                'django.contrib.auth.middleware.AuthenticationMiddleware',
                'django.contrib.messages.middleware.MessageMiddleware',
                'fancypages.middleware.EditorMiddleware',
            ),
            ROOT_URLCONF='sandbox.sandbox.urls',
            TEMPLATE_DIRS=[
                sandbox('templates'),
            ],
            INSTALLED_APPS=[
                'django.contrib.auth',
                'django.contrib.contenttypes',
                'django.contrib.sessions',
                'django.contrib.sites',
                'django.contrib.messages',
                'django.contrib.staticfiles',
                'django.contrib.admin',
                'blog',
            ] + fp.get_required_apps() + fp.get_fancypages_apps(),
            AUTHENTICATION_BACKENDS=(
                'django.contrib.auth.backends.ModelBackend',
            ),
            COMPRESS_ENABLED=True,
            COMPRESS_OFFLINE=False,
            COMPRESS_PRECOMPILERS=(
                ('text/less', 'lessc {infile} {outfile}'),
            ),
            LOGIN_REDIRECT_URL='/accounts/',
            APPEND_SLASH=True,
            SITE_ID=1,
            **FANCYPAGES_SETTINGS
        )
Beispiel #6
0
def pytest_configure():
    from fancypages.defaults import FANCYPAGES_SETTINGS

    if not settings.configured:
        settings.configure(
            DATABASES={
                'default': {
                    'ENGINE': 'django.db.backends.sqlite3',
                    'NAME': ':memory:',
                }
            },
            MEDIA_ROOT=sandbox('public/media'),
            MEDIA_URL='/media/',
            STATIC_URL='/static/',
            STATICFILES_DIRS=[sandbox('static/')],
            STATIC_ROOT=sandbox('public'),
            STATICFILES_FINDERS=(
                'django.contrib.staticfiles.finders.FileSystemFinder',
                'django.contrib.staticfiles.finders.AppDirectoriesFinder',
                'compressor.finders.CompressorFinder',
            ),
            TEMPLATE_LOADERS=(
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ),
            TEMPLATE_CONTEXT_PROCESSORS=(
                "django.contrib.auth.context_processors.auth",
                "django.core.context_processors.request",
                "django.core.context_processors.debug",
                "django.core.context_processors.i18n",
                "django.core.context_processors.media",
                "django.core.context_processors.static",
                "django.contrib.messages.context_processors.messages",
            ),
            MIDDLEWARE_CLASSES=(
                'django.middleware.common.CommonMiddleware',
                'django.contrib.sessions.middleware.SessionMiddleware',
                'django.middleware.csrf.CsrfViewMiddleware',
                'django.contrib.auth.middleware.AuthenticationMiddleware',
                'django.contrib.messages.middleware.MessageMiddleware',
                'fancypages.middleware.EditorMiddleware',
            ),
            ROOT_URLCONF='sandbox.sandbox.urls',
            TEMPLATE_DIRS=[
                sandbox('templates'),
            ],
            INSTALLED_APPS=[
                'django.contrib.auth',
                'django.contrib.contenttypes',
                'django.contrib.sessions',
                'django.contrib.sites',
                'django.contrib.messages',
                'django.contrib.staticfiles',
                'django.contrib.admin',
                'blog',
            ] + fp.get_required_apps() + fp.get_fancypages_apps(),
            AUTHENTICATION_BACKENDS=(
                'django.contrib.auth.backends.ModelBackend', ),
            COMPRESS_ENABLED=True,
            COMPRESS_OFFLINE=False,
            COMPRESS_PRECOMPILERS=(('text/less',
                                    'lessc {infile} {outfile}'), ),
            LOGIN_REDIRECT_URL='/accounts/',
            APPEND_SLASH=True,
            SITE_ID=1,
            **FANCYPAGES_SETTINGS)
    'django.contrib.admin',

    'debug_toolbar',
    'django_extensions',
    'blog',
]

try:
    import devserver
except ImportError:
    pass
else:
    DJANGO_APPS.append('devserver')

from fancypages.defaults import *
INSTALLED_APPS = DJANGO_APPS + fp.get_required_apps() + fp.get_fancypages_apps()

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_URL = '/admin/login/'

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
Beispiel #8
0
def pytest_configure():
    from fancypages.defaults import FANCYPAGES_SETTINGS

    ADDITIONAL_SETTINGS = dict(
        LANGUAGE_CODE='en-gb',
        LANGUAGES=(
            ('de', _('German')),
            ('en-gb', _("English")),
        ),
        INSTALLED_APPS=[
            'django.contrib.auth',
            'django.contrib.contenttypes',
            'django.contrib.sessions',
            'django.contrib.sites',
            'django.contrib.messages',
            'django.contrib.staticfiles',
            'django.contrib.admin',
        ] + fp.get_required_apps() + fp.get_fancypages_apps(
            use_with_oscar=USE_OSCAR_SANDBOX),
    )

    if USE_OSCAR_SANDBOX:
        from oscar.defaults import OSCAR_SETTINGS
        ADDITIONAL_SETTINGS.update(OSCAR_SETTINGS)

    ADDITIONAL_SETTINGS.update(FANCYPAGES_SETTINGS)

    if USE_OSCAR_SANDBOX:
        ADDITIONAL_SETTINGS.update(FP_OSCAR_SETTINGS)

        from oscar import get_core_apps
        ADDITIONAL_SETTINGS['INSTALLED_APPS'] += [
            'django.contrib.flatpages',
        ] + get_core_apps()

    if not settings.configured:
        settings.configure(
            DATABASES={
                'default': {
                    'ENGINE': 'django.db.backends.sqlite3',
                    'NAME': ':memory:',
                }
            },
            MEDIA_ROOT=TEMP_MEDIA_ROOT,
            MEDIA_URL='/media/',
            STATIC_URL='/static/',
            STATICFILES_DIRS=[sandbox('static/')],
            STATIC_ROOT=sandbox('public'),
            STATICFILES_FINDERS=(
                'django.contrib.staticfiles.finders.FileSystemFinder',
                'django.contrib.staticfiles.finders.AppDirectoriesFinder',
            ),
            TEMPLATE_LOADERS=(
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ),
            TEMPLATE_CONTEXT_PROCESSORS = (
                "django.contrib.auth.context_processors.auth",
                "django.core.context_processors.request",
                "django.core.context_processors.debug",
                "django.core.context_processors.i18n",
                "django.core.context_processors.media",
                "django.core.context_processors.static",
                "django.contrib.messages.context_processors.messages",
            ),
            MIDDLEWARE_CLASSES=(
                'django.contrib.sessions.middleware.SessionMiddleware',
                'django.middleware.locale.LocaleMiddleware',
                'django.middleware.common.CommonMiddleware',
                'django.middleware.csrf.CsrfViewMiddleware',
                'django.contrib.auth.middleware.AuthenticationMiddleware',
                'django.contrib.messages.middleware.MessageMiddleware',
                'fancypages.middleware.EditorMiddleware',
            ),
            ROOT_URLCONF='sandboxes.{}.sandbox.urls'.format(SANDBOX_MODULE),
            TEMPLATE_DIRS=[('templates')],
            AUTHENTICATION_BACKENDS=(
                'django.contrib.auth.backends.ModelBackend',
            ),
            LOGIN_REDIRECT_URL='/accounts/',
            APPEND_SLASH=True,
            SITE_ID=1,
            USE_OSCAR_SANDBOX=USE_OSCAR_SANDBOX,
            ALLOWED_HOSTS=['*'],
            **ADDITIONAL_SETTINGS
        )
Beispiel #9
0
def pytest_configure():
    from fancypages.defaults import FANCYPAGES_SETTINGS

    ADDITIONAL_SETTINGS = dict(
        LANGUAGE_CODE="en-gb",
        LANGUAGES=(("de", _("German")), ("en-gb", _("English"))),
        INSTALLED_APPS=[
            "django.contrib.auth",
            "django.contrib.contenttypes",
            "django.contrib.sessions",
            "django.contrib.sites",
            "django.contrib.messages",
            "django.contrib.staticfiles",
            "django.contrib.admin",
        ]
        + fp.get_required_apps()
        + fp.get_fancypages_apps(use_with_oscar=USE_OSCAR_SANDBOX),
    )

    if USE_OSCAR_SANDBOX:
        from oscar.defaults import OSCAR_SETTINGS

        ADDITIONAL_SETTINGS.update(OSCAR_SETTINGS)

    ADDITIONAL_SETTINGS.update(FANCYPAGES_SETTINGS)

    if USE_OSCAR_SANDBOX:
        ADDITIONAL_SETTINGS.update(FP_OSCAR_SETTINGS)

        from oscar import get_core_apps

        ADDITIONAL_SETTINGS["INSTALLED_APPS"] += get_core_apps()

    if not settings.configured:
        settings.configure(
            DATABASES={"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}},
            MEDIA_ROOT=TEMP_MEDIA_ROOT,
            MEDIA_URL="/media/",
            STATIC_URL="/static/",
            STATICFILES_DIRS=[sandbox("static/")],
            STATIC_ROOT=sandbox("public"),
            STATICFILES_FINDERS=(
                "django.contrib.staticfiles.finders.FileSystemFinder",
                "django.contrib.staticfiles.finders.AppDirectoriesFinder",
            ),
            TEMPLATE_LOADERS=(
                "django.template.loaders.filesystem.Loader",
                "django.template.loaders.app_directories.Loader",
            ),
            TEMPLATE_CONTEXT_PROCESSORS=(
                "django.contrib.auth.context_processors.auth",
                "django.core.context_processors.request",
                "django.core.context_processors.debug",
                "django.core.context_processors.i18n",
                "django.core.context_processors.media",
                "django.core.context_processors.static",
                "django.contrib.messages.context_processors.messages",
            ),
            MIDDLEWARE_CLASSES=(
                "django.contrib.sessions.middleware.SessionMiddleware",
                "django.middleware.locale.LocaleMiddleware",
                "django.middleware.common.CommonMiddleware",
                "django.middleware.csrf.CsrfViewMiddleware",
                "django.contrib.auth.middleware.AuthenticationMiddleware",
                "django.contrib.messages.middleware.MessageMiddleware",
                "fancypages.middleware.EditorMiddleware",
            ),
            ROOT_URLCONF="sandboxes.{}.sandbox.urls".format(SANDBOX_MODULE),
            TEMPLATE_DIRS=[("templates")],
            AUTHENTICATION_BACKENDS=("django.contrib.auth.backends.ModelBackend",),
            LOGIN_REDIRECT_URL="/accounts/",
            APPEND_SLASH=True,
            SITE_ID=1,
            USE_OSCAR_SANDBOX=USE_OSCAR_SANDBOX,
            **ADDITIONAL_SETTINGS
        )
Beispiel #10
0
    'django.contrib.admin',

    #'debug_toolbar',
    'django_extensions',
    'blog',
]

try:
    import devserver
except ImportError:
    pass
else:
    DJANGO_APPS.append('devserver')

from fancypages.defaults import *
INSTALLED_APPS = DJANGO_APPS + fp.get_required_apps() + fp.get_fancypages_apps()

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_URL = '/admin/login/'

########## COMPRESSOR SETTINGS
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = False

COMPRESS_PRECOMPILERS = (
    ('text/less', 'lessc {infile} {outfile}'),
)
########## END COMPRESSOR SETTINGS
Beispiel #11
0
def pytest_configure():
    from fancypages.defaults import FANCYPAGES_SETTINGS

    ADDITIONAL_SETTINGS = dict(
        LANGUAGE_CODE='en-gb',
        LANGUAGES=(
            ('de', _('German')),
            ('en-gb', _("English")),
        ),
        INSTALLED_APPS=[
            'django.contrib.auth',
            'django.contrib.contenttypes',
            'django.contrib.sessions',
            'django.contrib.sites',
            'django.contrib.messages',
            'django.contrib.staticfiles',
            'django.contrib.admin',
        ] + fp.get_required_apps() +
        fp.get_fancypages_apps(use_with_oscar=USE_OSCAR_SANDBOX),
    )

    if USE_OSCAR_SANDBOX:
        from oscar.defaults import OSCAR_SETTINGS
        ADDITIONAL_SETTINGS.update(OSCAR_SETTINGS)

    ADDITIONAL_SETTINGS.update(FANCYPAGES_SETTINGS)

    if USE_OSCAR_SANDBOX:
        ADDITIONAL_SETTINGS.update(FP_OSCAR_SETTINGS)

        from oscar import get_core_apps
        ADDITIONAL_SETTINGS['INSTALLED_APPS'] += [
            'django.contrib.flatpages',
        ] + get_core_apps()

    if not settings.configured:
        settings.configure(
            DATABASES={
                'default': {
                    'ENGINE': 'django.db.backends.sqlite3',
                    'NAME': ':memory:',
                }
            },
            MEDIA_ROOT=TEMP_MEDIA_ROOT,
            MEDIA_URL='/media/',
            STATIC_URL='/static/',
            STATICFILES_DIRS=[sandbox('static/')],
            STATIC_ROOT=sandbox('public'),
            STATICFILES_FINDERS=(
                'django.contrib.staticfiles.finders.FileSystemFinder',
                'django.contrib.staticfiles.finders.AppDirectoriesFinder',
            ),
            TEMPLATE_LOADERS=(
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ),
            TEMPLATE_CONTEXT_PROCESSORS=(
                "django.contrib.auth.context_processors.auth",
                "django.core.context_processors.request",
                "django.core.context_processors.debug",
                "django.core.context_processors.i18n",
                "django.core.context_processors.media",
                "django.core.context_processors.static",
                "django.contrib.messages.context_processors.messages",
            ),
            MIDDLEWARE_CLASSES=(
                'django.contrib.sessions.middleware.SessionMiddleware',
                'django.middleware.locale.LocaleMiddleware',
                'django.middleware.common.CommonMiddleware',
                'django.middleware.csrf.CsrfViewMiddleware',
                'django.contrib.auth.middleware.AuthenticationMiddleware',
                'django.contrib.messages.middleware.MessageMiddleware',
                'fancypages.middleware.EditorMiddleware',
            ),
            ROOT_URLCONF='sandboxes.{}.sandbox.urls'.format(SANDBOX_MODULE),
            TEMPLATE_DIRS=[('templates')],
            AUTHENTICATION_BACKENDS=(
                'django.contrib.auth.backends.ModelBackend', ),
            LOGIN_REDIRECT_URL='/accounts/',
            APPEND_SLASH=True,
            SITE_ID=1,
            USE_OSCAR_SANDBOX=USE_OSCAR_SANDBOX,
            **ADDITIONAL_SETTINGS)