Skip to content

Commit a08288f

Browse files
committed
Add MakeFile target for creating demo site
1 parent fef8e57 commit a08288f

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ sandbox: install
1616
sites/sandbox/manage.py loaddata countries.json sites/_fixtures/pages.json sites/_fixtures/auth.json
1717
sites/sandbox/manage.py rebuild_index --noinput
1818

19+
demo: install
20+
[ -f sites/demo/db.sqlite ] && rm sites/demo/db.sqlite || true
21+
# Create database
22+
sites/demo/manage.py syncdb --noinput
23+
sites/demo/manage.py migrate
24+
# Import some fixtures
25+
sites/demo/manage.py oscar_import_catalogue sites/_fixtures/books-catalogue.csv
26+
sites/demo/manage.py oscar_import_catalogue_images sites/_fixtures/books-images.tar.gz
27+
sites/demo/manage.py loaddata countries.json sites/_fixtures/pages.json sites/_fixtures/auth.json
28+
sites/demo/manage.py rebuild_index --noinput
29+
1930
test:
2031
./runtests.py tests/
2132

sites/demo/settings.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
DATABASES = {
2121
'default': {
22-
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
23-
'NAME': '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.
22+
'ENGINE': 'django.db.backends.sqlite3',
23+
'NAME': os.path.join(os.path.dirname(__file__), 'db.sqlite'),
24+
'USER': '',
25+
'PASSWORD': '',
26+
'HOST': '',
27+
'PORT': '',
2828
}
2929
}
3030

@@ -250,6 +250,8 @@
250250

251251
THUMBNAIL_DEBUG = False
252252

253+
USE_TZ = True
254+
253255
# Must be within MEDIA_ROOT for sorl to work
254256
OSCAR_MISSING_IMAGE_URL = 'image_not_found.jpg'
255257

0 commit comments

Comments
 (0)