Procházet zdrojové kódy

Created simple settings file and updated setup.py to include south

master
David Winterbottom před 14 roky
rodič
revize
ca0c5fd3bc
2 změnil soubory, kde provedl 239 přidání a 0 odebrání
  1. 238
    0
      sandbox/settings-simple.py
  2. 1
    0
      setup.py

+ 238
- 0
sandbox/settings-simple.py Zobrazit soubor

@@ -0,0 +1,238 @@
1
+import os
2
+
3
+# Django settings for oscar project.
4
+PROJECT_DIR = os.path.dirname(__file__)
5
+location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
6
+
7
+DEBUG = True
8
+TEMPLATE_DEBUG = True
9
+SQL_DEBUG = True
10
+
11
+ADMINS = (
12
+    # ('Your Name', 'your_email@domain.com'),
13
+)
14
+EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
15
+
16
+MANAGERS = ADMINS
17
+
18
+DATABASES = {
19
+    'default': {
20
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
21
+        'NAME': 'db.sqlite',                      # Or path to database file if using sqlite3.
22
+        'USER': '',                      # Not used with sqlite3.
23
+        'PASSWORD': '',                  # Not used with sqlite3.
24
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
25
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
26
+    }
27
+}
28
+
29
+# Local time zone for this installation. Choices can be found here:
30
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
31
+# although not all choices may be available on all operating systems.
32
+# On Unix systems, a value of None will cause Django to use the same
33
+# timezone as the operating system.
34
+# If running in a Windows environment this must be set to the same as your
35
+# system time zone.
36
+TIME_ZONE = 'Europe/London'
37
+
38
+# Language code for this installation. All choices can be found here:
39
+# http://www.i18nguy.com/unicode/language-identifiers.html
40
+LANGUAGE_CODE = 'en-us'
41
+
42
+SITE_ID = 1
43
+
44
+# If you set this to False, Django will make some optimizations so as not
45
+# to load the internationalization machinery.
46
+USE_I18N = True
47
+
48
+# If you set this to False, Django will not format dates, numbers and
49
+# calendars according to the current locale
50
+USE_L10N = True
51
+
52
+# Absolute path to the directory that holds media.
53
+# Example: "/home/media/media.lawrence.com/"
54
+MEDIA_ROOT = location("assets")
55
+
56
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
57
+# trailing slash if there is a path component (optional in other cases).
58
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
59
+MEDIA_URL = '/media/'
60
+
61
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
62
+# trailing slash.
63
+# Examples: "http://foo.com/media/", "/media/".
64
+#ADMIN_MEDIA_PREFIX = '/media/admin/'
65
+
66
+STATIC_URL = '/static/'
67
+STATICFILES_DIRS = (location('static/'),)
68
+STATIC_ROOT = location('public')
69
+
70
+# Make this unique, and don't share it with anybody.
71
+SECRET_KEY = '$)a7n&o80u!6y5t-+jrd3)3!%vh&shg$wqpjpxc!ar&p#!)n1a'
72
+
73
+# List of callables that know how to import templates from various sources.
74
+TEMPLATE_LOADERS = (
75
+    'django.template.loaders.filesystem.Loader',
76
+    'django.template.loaders.app_directories.Loader',
77
+#     'django.template.loaders.eggs.Loader',
78
+)
79
+
80
+TEMPLATE_CONTEXT_PROCESSORS = (
81
+    "django.contrib.auth.context_processors.auth",
82
+    "django.core.context_processors.request",
83
+    "django.core.context_processors.debug",
84
+    "django.core.context_processors.i18n",
85
+    "django.core.context_processors.media",
86
+    "django.core.context_processors.static",
87
+    "django.contrib.messages.context_processors.messages",
88
+    # Oscar specific
89
+    'oscar.apps.search.context_processors.search_form',
90
+    'oscar.apps.promotions.context_processors.promotions',
91
+    'oscar.apps.checkout.context_processors.checkout',
92
+) 
93
+
94
+MIDDLEWARE_CLASSES = (
95
+    'django.middleware.common.CommonMiddleware',
96
+    'django.contrib.sessions.middleware.SessionMiddleware',
97
+    'django.middleware.csrf.CsrfViewMiddleware',
98
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
99
+    'django.contrib.messages.middleware.MessageMiddleware',
100
+    'django.middleware.transaction.TransactionMiddleware',
101
+    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
102
+    'oscar.apps.basket.middleware.BasketMiddleware',
103
+)
104
+
105
+INTERNAL_IPS = ('127.0.0.1',)
106
+
107
+ROOT_URLCONF = 'urls'
108
+
109
+TEMPLATE_DIRS = (
110
+    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
111
+    # Always use forward slashes, even on Windows.
112
+    # Don't forget to use absolute paths, not relative paths.
113
+    location('templates')
114
+)
115
+
116
+# A sample logging configuration. The only tangible logging
117
+# performed by this configuration is to send an email to
118
+# the site admins on every HTTP 500 error.
119
+# See http://docs.djangoproject.com/en/dev/topics/logging for
120
+# more details on how to customize your logging configuration.
121
+LOGGING = {
122
+    'version': 1,
123
+    'disable_existing_loggers': False,
124
+    'formatters': {
125
+        'verbose': {
126
+            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
127
+        },
128
+        'simple': {
129
+            'format': '%(levelname)s %(message)s'
130
+        },
131
+    },
132
+    'handlers': {
133
+        'null': {
134
+            'level':'DEBUG',
135
+            'class':'django.utils.log.NullHandler',
136
+        },
137
+        'console':{
138
+            'level':'DEBUG',
139
+            'class':'logging.StreamHandler',
140
+            'formatter': 'verbose'
141
+        },
142
+        'file': {
143
+             'level': 'INFO',
144
+             'class': 'logging.FileHandler',
145
+             'filename': '/tmp/oscar.log',
146
+             'formatter': 'verbose'
147
+        },
148
+        'mail_admins': {
149
+            'level': 'ERROR',
150
+            'class': 'django.utils.log.AdminEmailHandler',
151
+        },
152
+    },
153
+    'loggers': {
154
+        'django': {
155
+            'handlers':['null'],
156
+            'propagate': True,
157
+            'level':'INFO',
158
+        },
159
+        'django.request': {
160
+            'handlers': ['mail_admins'],
161
+            'level': 'ERROR',
162
+            'propagate': False,
163
+        },
164
+        'oscar.checkout': {
165
+            'handlers': ['console', 'file'],
166
+            'propagate': True,
167
+            'level':'INFO',
168
+        },
169
+        'django.db.backends': {
170
+            'handlers':['null'],
171
+            'propagate': False,
172
+            'level':'DEBUG',
173
+        },
174
+    }
175
+}
176
+
177
+
178
+INSTALLED_APPS = (
179
+    'django.contrib.auth',
180
+    'django.contrib.contenttypes',
181
+    'django.contrib.sessions',
182
+    'django.contrib.sites',
183
+    'django.contrib.messages',
184
+    'django.contrib.admin',
185
+    'django.contrib.flatpages',
186
+    'django.contrib.staticfiles',
187
+    # External apps
188
+    'haystack',
189
+    'south',
190
+    # Apps from oscar
191
+    'oscar',
192
+    'oscar.apps.analytics',
193
+    'oscar.apps.discount',
194
+    'oscar.apps.order',
195
+    'oscar.apps.checkout',
196
+    'oscar.apps.shipping',
197
+    'oscar.apps.catalogue',
198
+    'oscar.apps.catalogue.reviews',
199
+    'oscar.apps.basket',
200
+    'oscar.apps.payment',
201
+    'oscar.apps.offer',
202
+    'oscar.apps.address',
203
+    'oscar.apps.partner',
204
+    'oscar.apps.customer',
205
+    'oscar.apps.promotions',
206
+    'oscar.apps.search',
207
+    'oscar.apps.voucher',
208
+    'oscar.apps.dashboard',
209
+    'oscar.apps.dashboard.reports',
210
+    'oscar.apps.dashboard.users',
211
+    'oscar.apps.dashboard.orders',
212
+    'oscar.apps.dashboard.promotions',
213
+    'sorl.thumbnail',
214
+)
215
+
216
+AUTHENTICATION_BACKENDS = (
217
+    'oscar.apps.customer.auth_backends.Emailbackend',
218
+    'django.contrib.auth.backends.ModelBackend',
219
+)
220
+
221
+LOGIN_REDIRECT_URL = '/accounts/'
222
+APPEND_SLASH = True
223
+
224
+# Haystack settings
225
+HAYSTACK_SITECONF = 'oscar.search_sites'
226
+HAYSTACK_SEARCH_ENGINE = 'dummy'
227
+
228
+# Oscar settings
229
+from oscar.defaults import *
230
+
231
+OSCAR_ALLOW_ANON_CHECKOUT = True
232
+OSCAR_INITIAL_ORDER_STATUS = 'Pending'
233
+OSCAR_INITIAL_LINE_STATUS = 'Pending'
234
+OSCAR_ORDER_STATUS_PIPELINE = {
235
+    'Pending': ('Being processed', 'Cancelled',),
236
+    'Being processed': ('Processed', 'Cancelled',),
237
+    'Cancelled': (),
238
+}

+ 1
- 0
setup.py Zobrazit soubor

@@ -26,6 +26,7 @@ setup(name='django-oscar',
26 26
       install_requires=[
27 27
           'django>=1.3',
28 28
           'PIL',
29
+          'South>=0.7.3',
29 30
           'django-extra-views>=0.1.0',
30 31
           'django-haystack>=1.2.0',
31 32
           'django-treebeard>=1.6.1',

Načítá se…
Zrušit
Uložit