#!/usr/bin/env python

import os
import sys

from django.conf import settings
from django.core.management import execute_from_command_line

DEBUG = False

TIME_ZONE = 'Europe/Stockholm'

DATABASES={
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
    }
}

SECRET_KEY = 'not needed'

USE_TZ = True

LANGUAGE_CODE = "en"

INSTALLED_APPS=[
    'django.contrib.contenttypes',
    'django.contrib.auth',
    'django.contrib.sites',
    "django.contrib.admin",

    'wagtail.core',
    'wagtail.sites',
    'wagtail.users',
    'wagtail.images',
    "wagtail.documents",
    'taggit',

    "wagtailaltgenerator",
    "wagtailaltgenerator.tests.demopages",
    "wagtailaltgenerator.tests.demosite",
]

ROOT_URLCONF = 'wagtailaltgenerator.tests.demosite.urls'

MIDDLEWARE = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',

    'wagtail.core.middleware.SiteMiddleware',
    'wagtail.contrib.redirects.middleware.RedirectMiddleware',
)

ALT_GENERATOR_MIN_CONFIDENCE = 0

COMPUTER_VISION_API_KEY = os.environ['COMPUTER_VISION_API_KEY']
COMPUTER_VISION_REGION = "canada"

@@ -30,113 +30,8 @@
  os%0A
-import sys%0A%0Afrom django.conf import settings%0Afrom django.core.management import execute_from_command_line
 %0A%0ADE
@@ -84,17 +84,19 @@
 ATABASES
-=
+ = 
 %7B%0A    %22d
@@ -241,17 +241,19 @@
 LED_APPS
-=
+ = 
 %5B%0A    'd
@@ -1242,16 +1242,24 @@
 I_KEY = 
+getattr(
 os.envir
@@ -1260,17 +1260,18 @@
 .environ
-%5B
+, 
 'COMPUTE
@@ -1287,17 +1287,23 @@
 API_KEY'
-%5D
+, None)
 %0ACOMPUTE

Make key optional