Sfoglia il codice sorgente

Clean up sandbox site

Remove customisation which now lives in the 'demo' site.
master
David Winterbottom 13 anni fa
parent
commit
163721f337

+ 5
- 4
README.rst Vedi File

@@ -5,9 +5,9 @@ Domain-driven e-commerce for Django
5 5
 ===================================
6 6
 
7 7
 Oscar is an e-commerce framework for Django designed for building domain-driven
8
-sites.  It is structured such that any part of the core functionality
9
-can be customised to suit the needs of your project.  This allows it to handle a
10
-wide range of e-commerce requirements, from large-scale B2C sites to complex B2B
8
+sites.  It is structured such that any part of the core functionality can be
9
+customised to suit the needs of your project.  This allows a wide range of
10
+e-commerce requirements to be handled, from large-scale B2C sites to complex B2B
11 11
 sites rich in domain-specific business logic.
12 12
 
13 13
 Further reading:
@@ -17,7 +17,8 @@ Further reading:
17 17
   experimental but feel free to explore and get a feel for the base Oscar
18 18
   install.  Dashboard access coming soon!) 
19 19
 * `Documentation`_ on the excellent `readthedocs.org`_
20
-* `Trello board managing current tasks`_
20
+* `Trello board managing current tasks`_ - note for features that you'd like
21
+  prioritsed!
21 22
 * `Google Group`_ - the mailing list is django-oscar@googlegroups.com
22 23
 * `Continuous integration homepage`_ on `travis-ci.org`_
23 24
 * `Twitter account for news and updates`_

+ 1
- 1
oscar/__init__.py Vedi File

@@ -54,7 +54,7 @@ OSCAR_CORE_APPS = [
54 54
     'oscar.apps.dashboard.ranges',
55 55
     'oscar.apps.dashboard.vouchers',
56 56
     # 3rd-party apps that oscar depends on
57
-    'django.contrib.flatpages',
57
+    'haystack',
58 58
     'treebeard',
59 59
     'sorl.thumbnail',
60 60
 ]

+ 20
- 0
sites/sandbox/README.rst Vedi File

@@ -0,0 +1,20 @@
1
+============
2
+Sandbox site
3
+============
4
+
5
+This site is deployed to two locations:
6
+
7
+http://sandbox.oscar.tangentlabs.co.uk/
8
+---------------------------------------
9
+
10
+This site is used for testing the vanilla Oscar functionality, that is, Oscar
11
+without any customisation.  It is not a demo site for clients or potential Oscar
12
+users.  It is built automatically from the HEAD of the master branch every 20
13
+minutes.
14
+
15
+http://qa.oscar.tangentlabs.co.uk/
16
+----------------------------------
17
+
18
+This site is for Tangent's QA team to test release candidates.  Like the sandbox
19
+site, it is not customised but is built from fixed tags rather than continually
20
+updated.

+ 0
- 0
sites/sandbox/apps/shipping/__init__.py Vedi File


+ 0
- 1
sites/sandbox/apps/shipping/admin.py Vedi File

@@ -1 +0,0 @@
1
-from oscar.apps.shipping.admin import *

+ 0
- 83
sites/sandbox/apps/shipping/migrations/0001_initial.py Vedi File

@@ -1,83 +0,0 @@
1
-# encoding: utf-8
2
-import datetime
3
-from south.db import db
4
-from south.v2 import SchemaMigration
5
-from django.db import models
6
-
7
-class Migration(SchemaMigration):
8
-
9
-    def forwards(self, orm):
10
-
11
-        # Adding model 'OrderAndItemCharges'
12
-        db.create_table('shipping_orderanditemcharges', (
13
-            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14
-            ('code', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=128, db_index=True)),
15
-            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)),
16
-            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
17
-            ('price_per_order', self.gf('django.db.models.fields.DecimalField')(default='0.00', max_digits=12, decimal_places=2)),
18
-            ('price_per_item', self.gf('django.db.models.fields.DecimalField')(default='0.00', max_digits=12, decimal_places=2)),
19
-            ('free_shipping_threshold', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=12, decimal_places=2, blank=True)),
20
-        ))
21
-        db.send_create_signal('shipping', ['OrderAndItemCharges'])
22
-
23
-        # Adding model 'WeightBased'
24
-        db.create_table('shipping_weightbased', (
25
-            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
26
-            ('code', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=128, db_index=True)),
27
-            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)),
28
-            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
29
-            ('upper_charge', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=12, decimal_places=2)),
30
-        ))
31
-        db.send_create_signal('shipping', ['WeightBased'])
32
-
33
-        # Adding model 'WeightBand'
34
-        db.create_table('shipping_weightband', (
35
-            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
36
-            ('method', self.gf('django.db.models.fields.related.ForeignKey')(related_name='bands', to=orm['shipping.WeightBased'])),
37
-            ('upper_limit', self.gf('django.db.models.fields.FloatField')()),
38
-            ('charge', self.gf('django.db.models.fields.DecimalField')(max_digits=12, decimal_places=2)),
39
-        ))
40
-        db.send_create_signal('shipping', ['WeightBand'])
41
-
42
-
43
-    def backwards(self, orm):
44
-
45
-        # Deleting model 'OrderAndItemCharges'
46
-        db.delete_table('shipping_orderanditemcharges')
47
-
48
-        # Deleting model 'WeightBased'
49
-        db.delete_table('shipping_weightbased')
50
-
51
-        # Deleting model 'WeightBand'
52
-        db.delete_table('shipping_weightband')
53
-
54
-
55
-    models = {
56
-        'shipping.orderanditemcharges': {
57
-            'Meta': {'object_name': 'OrderAndItemCharges'},
58
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
59
-            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
60
-            'free_shipping_threshold': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
61
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
62
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
63
-            'price_per_item': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
64
-            'price_per_order': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
65
-        },
66
-        'shipping.weightband': {
67
-            'Meta': {'ordering': "['upper_limit']", 'object_name': 'WeightBand'},
68
-            'charge': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
69
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70
-            'method': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bands'", 'to': "orm['shipping.WeightBased']"}),
71
-            'upper_limit': ('django.db.models.fields.FloatField', [], {})
72
-        },
73
-        'shipping.weightbased': {
74
-            'Meta': {'object_name': 'WeightBased'},
75
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
76
-            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
77
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
78
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
79
-            'upper_charge': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2'})
80
-        }
81
-    }
82
-
83
-    complete_apps = ['shipping']

+ 0
- 50
sites/sandbox/apps/shipping/migrations/0002_auto__add_field_weightbased_default_weight.py Vedi File

@@ -1,50 +0,0 @@
1
-# encoding: utf-8
2
-import datetime
3
-from south.db import db
4
-from south.v2 import SchemaMigration
5
-from django.db import models
6
-
7
-class Migration(SchemaMigration):
8
-
9
-    def forwards(self, orm):
10
-
11
-        # Adding field 'WeightBased.default_weight'
12
-        db.add_column('shipping_weightbased', 'default_weight', self.gf('django.db.models.fields.DecimalField')(default='0.00', max_digits=12, decimal_places=2), keep_default=False)
13
-
14
-
15
-    def backwards(self, orm):
16
-
17
-        # Deleting field 'WeightBased.default_weight'
18
-        db.delete_column('shipping_weightbased', 'default_weight')
19
-
20
-
21
-    models = {
22
-        'shipping.orderanditemcharges': {
23
-            'Meta': {'object_name': 'OrderAndItemCharges'},
24
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
25
-            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
26
-            'free_shipping_threshold': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
27
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
28
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
29
-            'price_per_item': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
30
-            'price_per_order': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
31
-        },
32
-        'shipping.weightband': {
33
-            'Meta': {'ordering': "['upper_limit']", 'object_name': 'WeightBand'},
34
-            'charge': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
35
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
36
-            'method': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bands'", 'to': "orm['shipping.WeightBased']"}),
37
-            'upper_limit': ('django.db.models.fields.FloatField', [], {})
38
-        },
39
-        'shipping.weightbased': {
40
-            'Meta': {'object_name': 'WeightBased'},
41
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
42
-            'default_weight': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
43
-            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
44
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
46
-            'upper_charge': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2'})
47
-        }
48
-    }
49
-
50
-    complete_apps = ['shipping']

+ 0
- 77
sites/sandbox/apps/shipping/migrations/0003_auto.py Vedi File

@@ -1,77 +0,0 @@
1
-# -*- coding: utf-8 -*-
2
-import datetime
3
-from south.db import db
4
-from south.v2 import SchemaMigration
5
-from django.db import models
6
-
7
-
8
-class Migration(SchemaMigration):
9
-
10
-    def forwards(self, orm):
11
-        # Adding M2M table for field countries on 'OrderAndItemCharges'
12
-        db.create_table('shipping_orderanditemcharges_countries', (
13
-            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
14
-            ('orderanditemcharges', models.ForeignKey(orm['shipping.orderanditemcharges'], null=False)),
15
-            ('country', models.ForeignKey(orm['address.country'], null=False))
16
-        ))
17
-        db.create_unique('shipping_orderanditemcharges_countries', ['orderanditemcharges_id', 'country_id'])
18
-
19
-        # Adding M2M table for field countries on 'WeightBased'
20
-        db.create_table('shipping_weightbased_countries', (
21
-            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
22
-            ('weightbased', models.ForeignKey(orm['shipping.weightbased'], null=False)),
23
-            ('country', models.ForeignKey(orm['address.country'], null=False))
24
-        ))
25
-        db.create_unique('shipping_weightbased_countries', ['weightbased_id', 'country_id'])
26
-
27
-
28
-    def backwards(self, orm):
29
-        # Removing M2M table for field countries on 'OrderAndItemCharges'
30
-        db.delete_table('shipping_orderanditemcharges_countries')
31
-
32
-        # Removing M2M table for field countries on 'WeightBased'
33
-        db.delete_table('shipping_weightbased_countries')
34
-
35
-
36
-    models = {
37
-        'address.country': {
38
-            'Meta': {'ordering': "('-is_highlighted', 'name')", 'object_name': 'Country'},
39
-            'is_highlighted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
40
-            'is_shipping_country': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
41
-            'iso_3166_1_a2': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
42
-            'iso_3166_1_a3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'db_index': 'True'}),
43
-            'iso_3166_1_numeric': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'db_index': 'True'}),
44
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
45
-            'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
46
-        },
47
-        'shipping.orderanditemcharges': {
48
-            'Meta': {'object_name': 'OrderAndItemCharges'},
49
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
50
-            'countries': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['address.Country']", 'null': 'True', 'blank': 'True'}),
51
-            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
52
-            'free_shipping_threshold': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
53
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
55
-            'price_per_item': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
56
-            'price_per_order': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
57
-        },
58
-        'shipping.weightband': {
59
-            'Meta': {'ordering': "['upper_limit']", 'object_name': 'WeightBand'},
60
-            'charge': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
61
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
62
-            'method': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bands'", 'to': "orm['shipping.WeightBased']"}),
63
-            'upper_limit': ('django.db.models.fields.FloatField', [], {})
64
-        },
65
-        'shipping.weightbased': {
66
-            'Meta': {'object_name': 'WeightBased'},
67
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
68
-            'countries': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['address.Country']", 'null': 'True', 'blank': 'True'}),
69
-            'default_weight': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
70
-            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
71
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
72
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
73
-            'upper_charge': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2'})
74
-        }
75
-    }
76
-
77
-    complete_apps = ['shipping']

+ 0
- 0
sites/sandbox/apps/shipping/migrations/__init__.py Vedi File


+ 0
- 1
sites/sandbox/apps/shipping/models.py Vedi File

@@ -1 +0,0 @@
1
-from oscar.apps.shipping.models import *

+ 0
- 28
sites/sandbox/apps/shipping/repository.py Vedi File

@@ -1,28 +0,0 @@
1
-from oscar.apps.shipping.methods import Free, NoShippingRequired
2
-from oscar.apps.shipping.repository import Repository as CoreRepository
3
-
4
-# Dummy shipping methods
5
-free1 = Free()
6
-free1.code = 'free1'
7
-free1.description = 'Ship by van'
8
-
9
-free2 = Free()
10
-free2.code = 'free2'
11
-free2.description = 'Ship by boat'
12
-
13
-
14
-class Repository(CoreRepository):
15
-
16
-    methods = {
17
-        free1.code: free1,
18
-        free2.code: free2
19
-    }
20
-
21
-    def get_shipping_methods(self, user, basket, shipping_addr=None, **kwargs):
22
-        methods = self.methods.values()
23
-        return self.add_basket_to_methods(basket, methods)
24
-
25
-    def find_by_code(self, code):
26
-        if code == NoShippingRequired.code:
27
-            return NoShippingRequired()
28
-        return self.methods.get(code, None)

+ 26
- 28
sites/sandbox/settings.py Vedi File

@@ -2,7 +2,8 @@ import os
2 2
 
3 3
 # Django settings for oscar project.
4 4
 PROJECT_DIR = os.path.dirname(__file__)
5
-location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
5
+location = lambda x: os.path.join(
6
+    os.path.dirname(os.path.realpath(__file__)), x)
6 7
 
7 8
 DEBUG = True
8 9
 TEMPLATE_DEBUG = True
@@ -10,7 +11,7 @@ SQL_DEBUG = True
10 11
 SEND_BROKEN_LINK_EMAILS = True
11 12
 
12 13
 ADMINS = (
13
-    ('David', 'david.winterbottom@tangentlabs.co.uk'),
14
+    ('David Winterbottom', 'david.winterbottom@tangentlabs.co.uk'),
14 15
 )
15 16
 EMAIL_SUBJECT_PREFIX = '[Oscar sandbox] '
16 17
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
@@ -19,12 +20,12 @@ MANAGERS = ADMINS
19 20
 
20 21
 DATABASES = {
21 22
     'default': {
22
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
23
-        'NAME': os.path.join(os.path.dirname(__file__), 'db.sqlite'),                      # Or path to database file if using sqlite3.
24
-        'USER': '',                      # Not used with sqlite3.
25
-        'PASSWORD': '',                  # Not used with sqlite3.
26
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
27
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
23
+        'ENGINE': 'django.db.backends.sqlite3',
24
+        'NAME': os.path.join(os.path.dirname(__file__), 'db.sqlite'),
25
+        'USER': '',
26
+        'PASSWORD': '',
27
+        'HOST': '',
28
+        'PORT': '',
28 29
     }
29 30
 }
30 31
 
@@ -141,7 +142,7 @@ LOGGING = {
141 142
     'disable_existing_loggers': False,
142 143
     'formatters': {
143 144
         'verbose': {
144
-            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
145
+            'format': '%(levelname)s %(asctime)s %(module)s %(message)s',
145 146
         },
146 147
         'simple': {
147 148
             'format': '[%(asctime)s] %(message)s'
@@ -149,12 +150,12 @@ LOGGING = {
149 150
     },
150 151
     'handlers': {
151 152
         'null': {
152
-            'level':'DEBUG',
153
-            'class':'django.utils.log.NullHandler',
153
+            'level': 'DEBUG',
154
+            'class': 'django.utils.log.NullHandler',
154 155
         },
155
-        'console':{
156
-            'level':'DEBUG',
157
-            'class':'logging.StreamHandler',
156
+        'console': {
157
+            'level': 'DEBUG',
158
+            'class': 'logging.StreamHandler',
158 159
             'formatter': 'verbose'
159 160
         },
160 161
         'checkout_file': {
@@ -182,9 +183,9 @@ LOGGING = {
182 183
     },
183 184
     'loggers': {
184 185
         'django': {
185
-            'handlers':['null'],
186
+            'handlers': ['null'],
186 187
             'propagate': True,
187
-            'level':'INFO',
188
+            'level': 'INFO',
188 189
         },
189 190
         'django.request': {
190 191
             'handlers': ['mail_admins', 'error_file'],
@@ -194,17 +195,17 @@ LOGGING = {
194 195
         'oscar.checkout': {
195 196
             'handlers': ['console', 'checkout_file'],
196 197
             'propagate': True,
197
-            'level':'INFO',
198
+            'level': 'INFO',
198 199
         },
199 200
         'gateway': {
200 201
             'handlers': ['gateway_file'],
201 202
             'propagate': True,
202
-            'level':'INFO',
203
+            'level': 'INFO',
203 204
         },
204 205
         'django.db.backends': {
205
-            'handlers':['null'],
206
+            'handlers': ['null'],
206 207
             'propagate': False,
207
-            'level':'DEBUG',
208
+            'level': 'DEBUG',
208 209
         },
209 210
     }
210 211
 }
@@ -219,18 +220,15 @@ INSTALLED_APPS = [
219 220
     'django.contrib.admin',
220 221
     'django.contrib.flatpages',
221 222
     'django.contrib.staticfiles',
222
-    # External apps
223 223
     'django_extensions',
224
-    'haystack',
225 224
     'debug_toolbar',
226 225
     'south',
227
-    'rosetta',
228
-    # For profile testing
229
-    'apps.user',
230
-    'apps.gateway',
226
+    'rosetta',  # For i18n testing
227
+    'apps.user',  # For profile testing
228
+    'apps.gateway',  # For allowing dashboard access
231 229
 ]
232 230
 from oscar import get_core_apps
233
-INSTALLED_APPS = INSTALLED_APPS + get_core_apps(['apps.shipping'])
231
+INSTALLED_APPS = INSTALLED_APPS + get_core_apps()
234 232
 
235 233
 AUTHENTICATION_BACKENDS = (
236 234
     'oscar.apps.customer.auth_backends.Emailbackend',
@@ -249,7 +247,7 @@ HAYSTACK_CONNECTIONS = {
249 247
 }
250 248
 
251 249
 DEBUG_TOOLBAR_CONFIG = {
252
-    'INTERCEPT_REDIRECTS': False
250
+    'INTERCEPT_REDIRECTS': False,
253 251
 }
254 252
 
255 253
 AUTH_PROFILE_MODULE = 'user.Profile'

+ 0
- 218
sites/sandbox/settings_simple.py Vedi File

@@ -1,218 +0,0 @@
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
-    'oscar.core.context_processors.metadata',
93
-)
94
-
95
-MIDDLEWARE_CLASSES = (
96
-    'django.middleware.common.CommonMiddleware',
97
-    'django.contrib.sessions.middleware.SessionMiddleware',
98
-    'django.middleware.csrf.CsrfViewMiddleware',
99
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
100
-    'django.contrib.messages.middleware.MessageMiddleware',
101
-    'django.middleware.transaction.TransactionMiddleware',
102
-    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
103
-    'oscar.apps.basket.middleware.BasketMiddleware',
104
-)
105
-
106
-INTERNAL_IPS = ('127.0.0.1',)
107
-
108
-ROOT_URLCONF = 'urls'
109
-
110
-TEMPLATE_DIRS = (
111
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
112
-    # Always use forward slashes, even on Windows.
113
-    # Don't forget to use absolute paths, not relative paths.
114
-    location('templates')
115
-)
116
-
117
-# A sample logging configuration. The only tangible logging
118
-# performed by this configuration is to send an email to
119
-# the site admins on every HTTP 500 error.
120
-# See http://docs.djangoproject.com/en/dev/topics/logging for
121
-# more details on how to customize your logging configuration.
122
-LOGGING = {
123
-    'version': 1,
124
-    'disable_existing_loggers': False,
125
-    'formatters': {
126
-        'verbose': {
127
-            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
128
-        },
129
-        'simple': {
130
-            'format': '%(levelname)s %(message)s'
131
-        },
132
-    },
133
-    'handlers': {
134
-        'null': {
135
-            'level':'DEBUG',
136
-            'class':'django.utils.log.NullHandler',
137
-        },
138
-        'console':{
139
-            'level':'DEBUG',
140
-            'class':'logging.StreamHandler',
141
-            'formatter': 'verbose'
142
-        },
143
-        'file': {
144
-             'level': 'INFO',
145
-             'class': 'logging.FileHandler',
146
-             'filename': '/tmp/oscar.log',
147
-             'formatter': 'verbose'
148
-        },
149
-        'mail_admins': {
150
-            'level': 'ERROR',
151
-            'class': 'django.utils.log.AdminEmailHandler',
152
-        },
153
-    },
154
-    'loggers': {
155
-        'django': {
156
-            'handlers':['null'],
157
-            'propagate': True,
158
-            'level':'INFO',
159
-        },
160
-        'django.request': {
161
-            'handlers': ['mail_admins'],
162
-            'level': 'ERROR',
163
-            'propagate': False,
164
-        },
165
-        'oscar.checkout': {
166
-            'handlers': ['console', 'file'],
167
-            'propagate': True,
168
-            'level':'INFO',
169
-        },
170
-        'django.db.backends': {
171
-            'handlers':['null'],
172
-            'propagate': False,
173
-            'level':'DEBUG',
174
-        },
175
-    }
176
-}
177
-
178
-
179
-INSTALLED_APPS = [
180
-    'django.contrib.auth',
181
-    'django.contrib.contenttypes',
182
-    'django.contrib.sessions',
183
-    'django.contrib.sites',
184
-    'django.contrib.messages',
185
-    'django.contrib.admin',
186
-    'django.contrib.flatpages',
187
-    'django.contrib.staticfiles',
188
-    # External apps
189
-    'haystack',
190
-    'south',
191
-    'sorl.thumbnail',
192
-]
193
-from oscar import get_core_apps
194
-INSTALLED_APPS = INSTALLED_APPS + get_core_apps()
195
-
196
-AUTHENTICATION_BACKENDS = (
197
-    'oscar.apps.customer.auth_backends.Emailbackend',
198
-    'django.contrib.auth.backends.ModelBackend',
199
-)
200
-
201
-LOGIN_REDIRECT_URL = '/accounts/'
202
-APPEND_SLASH = True
203
-
204
-# Haystack settings
205
-HAYSTACK_SITECONF = 'oscar.search_sites'
206
-HAYSTACK_SEARCH_ENGINE = 'dummy'
207
-
208
-# Oscar settings
209
-from oscar.defaults import *
210
-
211
-OSCAR_ALLOW_ANON_CHECKOUT = True
212
-OSCAR_INITIAL_ORDER_STATUS = 'Pending'
213
-OSCAR_INITIAL_LINE_STATUS = 'Pending'
214
-OSCAR_ORDER_STATUS_PIPELINE = {
215
-    'Pending': ('Being processed', 'Cancelled',),
216
-    'Being processed': ('Processed', 'Cancelled',),
217
-    'Cancelled': (),
218
-}

Loading…
Annulla
Salva