We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Improve payments templates
Use Bootstrap 3 classes.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `saleor/core/templatetags/bootstrap.py`
Content:
```
1 from django import forms
2 from django.forms.forms import BoundField, BaseForm
3 from django.forms.util import ErrorList
4 from django.template import Library, Context, TemplateSyntaxError
5 from django.template.loader import render_to_string
6 from django.utils.safestring import mark_safe
7 
8 register = Library()
9 
10 TEMPLATE_ERRORS = 'bootstrap/_non_field_errors.html'
11 TEMPLATE_HORIZONTAL = 'bootstrap/_field_horizontal.html'
12 TEMPLATE_VERTICAL = 'bootstrap/_field_vertical.html'
13 
14 
15 def render_non_field_errors(errors):
16     if not errors:
17         return ''
18     context = Context({'errors': errors})
19     return render_to_string(TEMPLATE_ERRORS, context_instance=context)
20 
21 
22 def render_field(bound_field, show_label, template):
23     widget = bound_field.field.widget
24 
25     if isinstance(widget, forms.RadioSelect):
26         input_type = 'radio'
27     elif isinstance(widget, forms.Select):
28         input_type = 'select'
29     elif isinstance(widget, forms.Textarea):
30         input_type = 'textarea'
31     elif isinstance(widget, forms.CheckboxInput):
32         input_type = 'checkbox'
33     else:
34         input_type = 'input'
35 
36     context = Context({'bound_field': bound_field,
37                        'input_type': input_type,
38                        'show_label': show_label})
39     return render_to_string(template, context_instance=context)
40 
41 
42 def as_bootstrap(obj, show_label, template):
43     if isinstance(obj, BoundField):
44         return render_field(obj, show_label, template)
45     elif isinstance(obj, ErrorList):
46         return render_non_field_errors(obj)
47     elif isinstance(obj, BaseForm):
48         non_field_errors = render_non_field_errors(obj.non_field_errors())
49         fields = (render_field(field, show_label, template) for field in obj)
50         form = ''.join(fields)
51         return mark_safe(non_field_errors + form)
52     else:
53         raise TemplateSyntaxError('Filter accepts form, field and non fields '
54                                   'errors.')
55 
56 
57 @register.filter
58 def as_horizontal_form(obj, show_label=True):
59     return as_bootstrap(obj=obj, show_label=show_label,
60                         template=TEMPLATE_HORIZONTAL)
61 
62 
63 @register.filter
64 def as_vertical_form(obj, show_label=True):
65     return as_bootstrap(obj=obj, show_label=show_label,
66                         template=TEMPLATE_VERTICAL)
67 
68 
69 @register.simple_tag
70 def render_widget(obj, **attrs):
71     return obj.as_widget(attrs=attrs)
72
```

Path: `saleor/settings.py`
Content:
```
1 import os.path
2 
3 DEBUG = True
4 TEMPLATE_DEBUG = DEBUG
5 
6 SITE_ID = 1
7 
8 PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
9 
10 ROOT_URLCONF = 'saleor.urls'
11 
12 WSGI_APPLICATION = 'saleor.wsgi.application'
13 
14 ADMINS = (
15     # ('Your Name', 'your_email@example.com'),
16 )
17 MANAGERS = ADMINS
18 INTERNAL_IPS = ['127.0.0.1']
19 
20 DATABASES = {
21     'default': {
22         'ENGINE': 'django.db.backends.sqlite3',
23         'NAME': 'dev.sqlite'
24     }
25 }
26 
27 TIME_ZONE = 'America/Chicago'
28 LANGUAGE_CODE = 'en-us'
29 USE_I18N = True
30 USE_L10N = True
31 USE_TZ = True
32 
33 MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
34 MEDIA_URL = '/media/'
35 
36 STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
37 STATIC_URL = '/static/'
38 STATICFILES_DIRS = [
39     os.path.join(PROJECT_ROOT, 'saleor', 'static')
40 ]
41 STATICFILES_FINDERS = [
42     'django.contrib.staticfiles.finders.FileSystemFinder',
43     'django.contrib.staticfiles.finders.AppDirectoriesFinder'
44 ]
45 
46 TEMPLATE_DIRS = [
47     os.path.join(PROJECT_ROOT, 'templates')
48 ]
49 TEMPLATE_LOADERS = [
50     'django.template.loaders.filesystem.Loader',
51     'django.template.loaders.app_directories.Loader',
52     # TODO: this one is slow, but for now need for mptt?
53     'django.template.loaders.eggs.Loader'
54 ]
55 
56 # Make this unique, and don't share it with anybody.
57 SECRET_KEY = '{{ secret_key }}'
58 
59 MIDDLEWARE_CLASSES = [
60     'django.contrib.sessions.middleware.SessionMiddleware',
61     'django.middleware.common.CommonMiddleware',
62     'django.middleware.csrf.CsrfViewMiddleware',
63     'django.contrib.auth.middleware.AuthenticationMiddleware',
64     'django.contrib.messages.middleware.MessageMiddleware',
65     'saleor.cart.middleware.CartMiddleware',
66     'saleor.core.middleware.GoogleAnalytics',
67     'saleor.core.middleware.CheckHTML'
68 ]
69 
70 TEMPLATE_CONTEXT_PROCESSORS = [
71     'django.contrib.auth.context_processors.auth',
72     'django.core.context_processors.debug',
73     'django.core.context_processors.i18n',
74     'django.core.context_processors.media',
75     'django.core.context_processors.static',
76     'django.core.context_processors.tz',
77     'django.contrib.messages.context_processors.messages',
78     'django.core.context_processors.request',
79     'saleor.core.context_processors.canonical_hostname',
80     'saleor.core.context_processors.default_currency'
81 ]
82 
83 INSTALLED_APPS = [
84     # External apps that need to go before django's
85 
86     # Django modules
87     'django.contrib.contenttypes',
88     'django.contrib.sessions',
89     'django.contrib.messages',
90     'django.contrib.staticfiles',
91     'django.contrib.admin',
92     'django.contrib.webdesign',
93 
94     # External apps
95     'django_images',
96     'django_prices',
97     'mptt',
98     'payments',
99     'south',
100 
101     # Local apps
102     'saleor.cart',
103     'saleor.checkout',
104     'saleor.core',
105     'saleor.order',
106     'saleor.payment',
107     'saleor.product',
108     'saleor.registration',
109     'saleor.userprofile'
110 ]
111 
112 LOGGING = {
113     'version': 1,
114     'disable_existing_loggers': False,
115     'formatters': {
116         'verbose': {
117             'format': '%(levelname)s %(asctime)s %(module)s '
118             '%(process)d %(thread)d %(message)s'
119         },
120         'simple': {
121             'format': '%(levelname)s %(message)s'
122         },
123     },
124     'filters': {
125         'require_debug_false': {
126             '()': 'django.utils.log.RequireDebugFalse'
127         },
128         'require_debug_true': {
129             '()': 'django.utils.log.RequireDebugTrue'
130         }
131     },
132     'handlers': {
133         'mail_admins': {
134             'level': 'ERROR',
135             'filters': ['require_debug_false'],
136             'class': 'django.utils.log.AdminEmailHandler'
137         },
138         'console': {
139             'level': 'DEBUG',
140             'class': 'logging.StreamHandler',
141             'filters': ['require_debug_true'],
142             'formatter': 'simple'
143         },
144     },
145     'loggers': {
146         'django.request': {
147             'handlers': ['mail_admins'],
148             'level': 'ERROR',
149             'propagate': True
150         },
151         'saleor': {
152             'handlers': ['console'],
153             'level': 'DEBUG',
154             'propagate': True
155         }
156     }
157 }
158 
159 AUTHENTICATION_BACKENDS = (
160     'saleor.registration.backends.EmailPasswordBackend',
161     'saleor.registration.backends.ExternalLoginBackend',
162     'saleor.registration.backends.TrivialBackend'
163 )
164 
165 AUTH_USER_MODEL = 'userprofile.User'
166 
167 CANONICAL_HOSTNAME = 'localhost:8000'
168 
169 IMAGE_SIZES = {
170     'normal': {
171         'size': (750, 0)
172     },
173     'admin': {
174         'size': (50, 50),
175         'crop': True
176     }
177 }
178 
179 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
180 
181 LOGIN_URL = '/account/login'
182 
183 WARN_ABOUT_INVALID_HTML5_OUTPUT = False
184 
185 SATCHLESS_DEFAULT_CURRENCY = 'USD'
186 
187 ACCOUNT_ACTIVATION_DAYS = 3
188 
189 LOGIN_REDIRECT_URL = 'home'
190 
191 FACEBOOK_APP_ID = None
192 FACEBOOK_SECRET = None
193 
194 GOOGLE_ANALYTICS_TRACKING_ID = None
195 GOOGLE_CLIENT_ID = None
196 GOOGLE_CLIENT_SECRET = None
197 
198 PAYMENT_BASE_URL = 'http://%s/' % CANONICAL_HOSTNAME
199 
200 PAYMENT_MODEL = 'payment.Payment'
201 
202 PAYMENT_VARIANTS = {
203     'default': ('payments.dummy.DummyProvider', {'url': 'http://google.pl/'})
204 }
205 
206 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
207 
208 CHECKOUT_PAYMENT_CHOICES = [
209     ('default', 'Dummy provider')
210 ]
211 
212 TEMPLATE_STRING_IF_INVALID = '<< MISSING VARIABLE >>'
213
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/saleor/core/templatetags/bootstrap.py b/saleor/core/templatetags/bootstrap.py
--- a/saleor/core/templatetags/bootstrap.py
+++ b/saleor/core/templatetags/bootstrap.py
@@ -30,6 +30,8 @@
         input_type = 'textarea'
     elif isinstance(widget, forms.CheckboxInput):
         input_type = 'checkbox'
+    elif issubclass(type(widget), forms.MultiWidget):
+        input_type = 'multi_widget'
     else:
         input_type = 'input'
 
diff --git a/saleor/settings.py b/saleor/settings.py
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -91,13 +91,6 @@
     'django.contrib.admin',
     'django.contrib.webdesign',
 
-    # External apps
-    'django_images',
-    'django_prices',
-    'mptt',
-    'payments',
-    'south',
-
     # Local apps
     'saleor.cart',
     'saleor.checkout',
@@ -106,7 +99,14 @@
     'saleor.payment',
     'saleor.product',
     'saleor.registration',
-    'saleor.userprofile'
+    'saleor.userprofile',
+
+    # External apps
+    'django_images',
+    'django_prices',
+    'mptt',
+    'payments',
+    'south'
 ]
 
 LOGGING = {

{"golden_diff": "diff --git a/saleor/core/templatetags/bootstrap.py b/saleor/core/templatetags/bootstrap.py\n--- a/saleor/core/templatetags/bootstrap.py\n+++ b/saleor/core/templatetags/bootstrap.py\n@@ -30,6 +30,8 @@\n         input_type = 'textarea'\n     elif isinstance(widget, forms.CheckboxInput):\n         input_type = 'checkbox'\n+    elif issubclass(type(widget), forms.MultiWidget):\n+        input_type = 'multi_widget'\n     else:\n         input_type = 'input'\n \ndiff --git a/saleor/settings.py b/saleor/settings.py\n--- a/saleor/settings.py\n+++ b/saleor/settings.py\n@@ -91,13 +91,6 @@\n     'django.contrib.admin',\n     'django.contrib.webdesign',\n \n-    # External apps\n-    'django_images',\n-    'django_prices',\n-    'mptt',\n-    'payments',\n-    'south',\n-\n     # Local apps\n     'saleor.cart',\n     'saleor.checkout',\n@@ -106,7 +99,14 @@\n     'saleor.payment',\n     'saleor.product',\n     'saleor.registration',\n-    'saleor.userprofile'\n+    'saleor.userprofile',\n+\n+    # External apps\n+    'django_images',\n+    'django_prices',\n+    'mptt',\n+    'payments',\n+    'south'\n ]\n \n LOGGING = {\n", "issue": "Improve payments templates\nUse Bootstrap 3 classes.\n\n", "before_files": [{"content": "from django import forms\nfrom django.forms.forms import BoundField, BaseForm\nfrom django.forms.util import ErrorList\nfrom django.template import Library, Context, TemplateSyntaxError\nfrom django.template.loader import render_to_string\nfrom django.utils.safestring import mark_safe\n\nregister = Library()\n\nTEMPLATE_ERRORS = 'bootstrap/_non_field_errors.html'\nTEMPLATE_HORIZONTAL = 'bootstrap/_field_horizontal.html'\nTEMPLATE_VERTICAL = 'bootstrap/_field_vertical.html'\n\n\ndef render_non_field_errors(errors):\n    if not errors:\n        return ''\n    context = Context({'errors': errors})\n    return render_to_string(TEMPLATE_ERRORS, context_instance=context)\n\n\ndef render_field(bound_field, show_label, template):\n    widget = bound_field.field.widget\n\n    if isinstance(widget, forms.RadioSelect):\n        input_type = 'radio'\n    elif isinstance(widget, forms.Select):\n        input_type = 'select'\n    elif isinstance(widget, forms.Textarea):\n        input_type = 'textarea'\n    elif isinstance(widget, forms.CheckboxInput):\n        input_type = 'checkbox'\n    else:\n        input_type = 'input'\n\n    context = Context({'bound_field': bound_field,\n                       'input_type': input_type,\n                       'show_label': show_label})\n    return render_to_string(template, context_instance=context)\n\n\ndef as_bootstrap(obj, show_label, template):\n    if isinstance(obj, BoundField):\n        return render_field(obj, show_label, template)\n    elif isinstance(obj, ErrorList):\n        return render_non_field_errors(obj)\n    elif isinstance(obj, BaseForm):\n        non_field_errors = render_non_field_errors(obj.non_field_errors())\n        fields = (render_field(field, show_label, template) for field in obj)\n        form = ''.join(fields)\n        return mark_safe(non_field_errors + form)\n    else:\n        raise TemplateSyntaxError('Filter accepts form, field and non fields '\n                                  'errors.')\n\n\n@register.filter\ndef as_horizontal_form(obj, show_label=True):\n    return as_bootstrap(obj=obj, show_label=show_label,\n                        template=TEMPLATE_HORIZONTAL)\n\n\n@register.filter\ndef as_vertical_form(obj, show_label=True):\n    return as_bootstrap(obj=obj, show_label=show_label,\n                        template=TEMPLATE_VERTICAL)\n\n\n@register.simple_tag\ndef render_widget(obj, **attrs):\n    return obj.as_widget(attrs=attrs)\n", "path": "saleor/core/templatetags/bootstrap.py"}, {"content": "import os.path\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nSITE_ID = 1\n\nPROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))\n\nROOT_URLCONF = 'saleor.urls'\n\nWSGI_APPLICATION = 'saleor.wsgi.application'\n\nADMINS = (\n    # ('Your Name', 'your_email@example.com'),\n)\nMANAGERS = ADMINS\nINTERNAL_IPS = ['127.0.0.1']\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': 'dev.sqlite'\n    }\n}\n\nTIME_ZONE = 'America/Chicago'\nLANGUAGE_CODE = 'en-us'\nUSE_I18N = True\nUSE_L10N = True\nUSE_TZ = True\n\nMEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')\nMEDIA_URL = '/media/'\n\nSTATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')\nSTATIC_URL = '/static/'\nSTATICFILES_DIRS = [\n    os.path.join(PROJECT_ROOT, 'saleor', 'static')\n]\nSTATICFILES_FINDERS = [\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder'\n]\n\nTEMPLATE_DIRS = [\n    os.path.join(PROJECT_ROOT, 'templates')\n]\nTEMPLATE_LOADERS = [\n    'django.template.loaders.filesystem.Loader',\n    'django.template.loaders.app_directories.Loader',\n    # TODO: this one is slow, but for now need for mptt?\n    'django.template.loaders.eggs.Loader'\n]\n\n# Make this unique, and don't share it with anybody.\nSECRET_KEY = '{{ secret_key }}'\n\nMIDDLEWARE_CLASSES = [\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'saleor.cart.middleware.CartMiddleware',\n    'saleor.core.middleware.GoogleAnalytics',\n    'saleor.core.middleware.CheckHTML'\n]\n\nTEMPLATE_CONTEXT_PROCESSORS = [\n    'django.contrib.auth.context_processors.auth',\n    'django.core.context_processors.debug',\n    'django.core.context_processors.i18n',\n    'django.core.context_processors.media',\n    'django.core.context_processors.static',\n    'django.core.context_processors.tz',\n    'django.contrib.messages.context_processors.messages',\n    'django.core.context_processors.request',\n    'saleor.core.context_processors.canonical_hostname',\n    'saleor.core.context_processors.default_currency'\n]\n\nINSTALLED_APPS = [\n    # External apps that need to go before django's\n\n    # Django modules\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.admin',\n    'django.contrib.webdesign',\n\n    # External apps\n    'django_images',\n    'django_prices',\n    'mptt',\n    'payments',\n    'south',\n\n    # Local apps\n    'saleor.cart',\n    'saleor.checkout',\n    'saleor.core',\n    'saleor.order',\n    'saleor.payment',\n    'saleor.product',\n    'saleor.registration',\n    'saleor.userprofile'\n]\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s '\n            '%(process)d %(thread)d %(message)s'\n        },\n        'simple': {\n            'format': '%(levelname)s %(message)s'\n        },\n    },\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse'\n        },\n        'require_debug_true': {\n            '()': 'django.utils.log.RequireDebugTrue'\n        }\n    },\n    'handlers': {\n        'mail_admins': {\n            'level': 'ERROR',\n            'filters': ['require_debug_false'],\n            'class': 'django.utils.log.AdminEmailHandler'\n        },\n        'console': {\n            'level': 'DEBUG',\n            'class': 'logging.StreamHandler',\n            'filters': ['require_debug_true'],\n            'formatter': 'simple'\n        },\n    },\n    'loggers': {\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': True\n        },\n        'saleor': {\n            'handlers': ['console'],\n            'level': 'DEBUG',\n            'propagate': True\n        }\n    }\n}\n\nAUTHENTICATION_BACKENDS = (\n    'saleor.registration.backends.EmailPasswordBackend',\n    'saleor.registration.backends.ExternalLoginBackend',\n    'saleor.registration.backends.TrivialBackend'\n)\n\nAUTH_USER_MODEL = 'userprofile.User'\n\nCANONICAL_HOSTNAME = 'localhost:8000'\n\nIMAGE_SIZES = {\n    'normal': {\n        'size': (750, 0)\n    },\n    'admin': {\n        'size': (50, 50),\n        'crop': True\n    }\n}\n\nEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n\nLOGIN_URL = '/account/login'\n\nWARN_ABOUT_INVALID_HTML5_OUTPUT = False\n\nSATCHLESS_DEFAULT_CURRENCY = 'USD'\n\nACCOUNT_ACTIVATION_DAYS = 3\n\nLOGIN_REDIRECT_URL = 'home'\n\nFACEBOOK_APP_ID = None\nFACEBOOK_SECRET = None\n\nGOOGLE_ANALYTICS_TRACKING_ID = None\nGOOGLE_CLIENT_ID = None\nGOOGLE_CLIENT_SECRET = None\n\nPAYMENT_BASE_URL = 'http://%s/' % CANONICAL_HOSTNAME\n\nPAYMENT_MODEL = 'payment.Payment'\n\nPAYMENT_VARIANTS = {\n    'default': ('payments.dummy.DummyProvider', {'url': 'http://google.pl/'})\n}\n\nSESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'\n\nCHECKOUT_PAYMENT_CHOICES = [\n    ('default', 'Dummy provider')\n]\n\nTEMPLATE_STRING_IF_INVALID = '<< MISSING VARIABLE >>'\n", "path": "saleor/settings.py"}], "after_files": [{"content": "from django import forms\nfrom django.forms.forms import BoundField, BaseForm\nfrom django.forms.util import ErrorList\nfrom django.template import Library, Context, TemplateSyntaxError\nfrom django.template.loader import render_to_string\nfrom django.utils.safestring import mark_safe\n\nregister = Library()\n\nTEMPLATE_ERRORS = 'bootstrap/_non_field_errors.html'\nTEMPLATE_HORIZONTAL = 'bootstrap/_field_horizontal.html'\nTEMPLATE_VERTICAL = 'bootstrap/_field_vertical.html'\n\n\ndef render_non_field_errors(errors):\n    if not errors:\n        return ''\n    context = Context({'errors': errors})\n    return render_to_string(TEMPLATE_ERRORS, context_instance=context)\n\n\ndef render_field(bound_field, show_label, template):\n    widget = bound_field.field.widget\n\n    if isinstance(widget, forms.RadioSelect):\n        input_type = 'radio'\n    elif isinstance(widget, forms.Select):\n        input_type = 'select'\n    elif isinstance(widget, forms.Textarea):\n        input_type = 'textarea'\n    elif isinstance(widget, forms.CheckboxInput):\n        input_type = 'checkbox'\n    elif issubclass(type(widget), forms.MultiWidget):\n        input_type = 'multi_widget'\n    else:\n        input_type = 'input'\n\n    context = Context({'bound_field': bound_field,\n                       'input_type': input_type,\n                       'show_label': show_label})\n    return render_to_string(template, context_instance=context)\n\n\ndef as_bootstrap(obj, show_label, template):\n    if isinstance(obj, BoundField):\n        return render_field(obj, show_label, template)\n    elif isinstance(obj, ErrorList):\n        return render_non_field_errors(obj)\n    elif isinstance(obj, BaseForm):\n        non_field_errors = render_non_field_errors(obj.non_field_errors())\n        fields = (render_field(field, show_label, template) for field in obj)\n        form = ''.join(fields)\n        return mark_safe(non_field_errors + form)\n    else:\n        raise TemplateSyntaxError('Filter accepts form, field and non fields '\n                                  'errors.')\n\n\n@register.filter\ndef as_horizontal_form(obj, show_label=True):\n    return as_bootstrap(obj=obj, show_label=show_label,\n                        template=TEMPLATE_HORIZONTAL)\n\n\n@register.filter\ndef as_vertical_form(obj, show_label=True):\n    return as_bootstrap(obj=obj, show_label=show_label,\n                        template=TEMPLATE_VERTICAL)\n\n\n@register.simple_tag\ndef render_widget(obj, **attrs):\n    return obj.as_widget(attrs=attrs)\n", "path": "saleor/core/templatetags/bootstrap.py"}, {"content": "import os.path\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nSITE_ID = 1\n\nPROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))\n\nROOT_URLCONF = 'saleor.urls'\n\nWSGI_APPLICATION = 'saleor.wsgi.application'\n\nADMINS = (\n    # ('Your Name', 'your_email@example.com'),\n)\nMANAGERS = ADMINS\nINTERNAL_IPS = ['127.0.0.1']\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': 'dev.sqlite'\n    }\n}\n\nTIME_ZONE = 'America/Chicago'\nLANGUAGE_CODE = 'en-us'\nUSE_I18N = True\nUSE_L10N = True\nUSE_TZ = True\n\nMEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')\nMEDIA_URL = '/media/'\n\nSTATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')\nSTATIC_URL = '/static/'\nSTATICFILES_DIRS = [\n    os.path.join(PROJECT_ROOT, 'saleor', 'static')\n]\nSTATICFILES_FINDERS = [\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder'\n]\n\nTEMPLATE_DIRS = [\n    os.path.join(PROJECT_ROOT, 'templates')\n]\nTEMPLATE_LOADERS = [\n    'django.template.loaders.filesystem.Loader',\n    'django.template.loaders.app_directories.Loader',\n    # TODO: this one is slow, but for now need for mptt?\n    'django.template.loaders.eggs.Loader'\n]\n\n# Make this unique, and don't share it with anybody.\nSECRET_KEY = '{{ secret_key }}'\n\nMIDDLEWARE_CLASSES = [\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'saleor.cart.middleware.CartMiddleware',\n    'saleor.core.middleware.GoogleAnalytics',\n    'saleor.core.middleware.CheckHTML'\n]\n\nTEMPLATE_CONTEXT_PROCESSORS = [\n    'django.contrib.auth.context_processors.auth',\n    'django.core.context_processors.debug',\n    'django.core.context_processors.i18n',\n    'django.core.context_processors.media',\n    'django.core.context_processors.static',\n    'django.core.context_processors.tz',\n    'django.contrib.messages.context_processors.messages',\n    'django.core.context_processors.request',\n    'saleor.core.context_processors.canonical_hostname',\n    'saleor.core.context_processors.default_currency'\n]\n\nINSTALLED_APPS = [\n    # External apps that need to go before django's\n\n    # Django modules\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.admin',\n    'django.contrib.webdesign',\n\n    # Local apps\n    'saleor.cart',\n    'saleor.checkout',\n    'saleor.core',\n    'saleor.order',\n    'saleor.payment',\n    'saleor.product',\n    'saleor.registration',\n    'saleor.userprofile',\n\n    # External apps\n    'django_images',\n    'django_prices',\n    'mptt',\n    'payments',\n    'south'\n]\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s '\n            '%(process)d %(thread)d %(message)s'\n        },\n        'simple': {\n            'format': '%(levelname)s %(message)s'\n        },\n    },\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse'\n        },\n        'require_debug_true': {\n            '()': 'django.utils.log.RequireDebugTrue'\n        }\n    },\n    'handlers': {\n        'mail_admins': {\n            'level': 'ERROR',\n            'filters': ['require_debug_false'],\n            'class': 'django.utils.log.AdminEmailHandler'\n        },\n        'console': {\n            'level': 'DEBUG',\n            'class': 'logging.StreamHandler',\n            'filters': ['require_debug_true'],\n            'formatter': 'simple'\n        },\n    },\n    'loggers': {\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': True\n        },\n        'saleor': {\n            'handlers': ['console'],\n            'level': 'DEBUG',\n            'propagate': True\n        }\n    }\n}\n\nAUTHENTICATION_BACKENDS = (\n    'saleor.registration.backends.EmailPasswordBackend',\n    'saleor.registration.backends.ExternalLoginBackend',\n    'saleor.registration.backends.TrivialBackend'\n)\n\nAUTH_USER_MODEL = 'userprofile.User'\n\nCANONICAL_HOSTNAME = 'localhost:8000'\n\nIMAGE_SIZES = {\n    'normal': {\n        'size': (750, 0)\n    },\n    'admin': {\n        'size': (50, 50),\n        'crop': True\n    }\n}\n\nEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n\nLOGIN_URL = '/account/login'\n\nWARN_ABOUT_INVALID_HTML5_OUTPUT = False\n\nSATCHLESS_DEFAULT_CURRENCY = 'USD'\n\nACCOUNT_ACTIVATION_DAYS = 3\n\nLOGIN_REDIRECT_URL = 'home'\n\nFACEBOOK_APP_ID = None\nFACEBOOK_SECRET = None\n\nGOOGLE_ANALYTICS_TRACKING_ID = None\nGOOGLE_CLIENT_ID = None\nGOOGLE_CLIENT_SECRET = None\n\nPAYMENT_BASE_URL = 'http://%s/' % CANONICAL_HOSTNAME\n\nPAYMENT_MODEL = 'payment.Payment'\n\nPAYMENT_VARIANTS = {\n    'default': ('payments.dummy.DummyProvider', {'url': 'http://google.pl/'})\n}\n\nSESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'\n\nCHECKOUT_PAYMENT_CHOICES = [\n    ('default', 'Dummy provider')\n]\n\nTEMPLATE_STRING_IF_INVALID = '<< MISSING VARIABLE >>'\n", "path": "saleor/settings.py"}]}