|
|
@@ -21,38 +21,38 @@ Create a new virtual env::
|
|
21
|
21
|
A nice extension now is to edit your ``~/.virtualenv/$PROJECTNAME/bin/postactivate`` file to contain::
|
|
22
|
22
|
|
|
23
|
23
|
cd ~/path/to/my/workspace/$PROJECTNAME
|
|
24
|
|
-
|
|
|
24
|
+
|
|
25
|
25
|
so that you can simply type ``workon $PROJECTNAME`` to jump into your project folder with the virtual
|
|
26
|
26
|
environment set-up.
|
|
27
|
27
|
|
|
28
|
28
|
Installation
|
|
29
|
29
|
------------
|
|
30
|
|
-
|
|
31
|
|
-Install oscar and its dependencies::
|
|
32
|
|
-
|
|
|
30
|
+
|
|
|
31
|
+Install oscar and its dependencies::
|
|
|
32
|
+
|
|
33
|
33
|
pip install -e git+git://github.com/tangentlabs/django-oscar.git#egg=django-oscar
|
|
34
|
|
-
|
|
|
34
|
+
|
|
35
|
35
|
You will also need to install the appropriate python module for your database of choice.
|
|
36
|
36
|
If you are using MySQL, then run the following::
|
|
37
|
37
|
|
|
38
|
38
|
pip install MySQL-python
|
|
39
|
39
|
|
|
40
|
|
-Also, depending on your search backend for haystack, you'll need to install further
|
|
|
40
|
+Also, depending on your search backend for haystack, you'll need to install further
|
|
41
|
41
|
packages::
|
|
42
|
42
|
|
|
43
|
43
|
pip install pysolr
|
|
44
|
44
|
|
|
45
|
45
|
Now create the project::
|
|
46
|
|
-
|
|
|
46
|
+
|
|
47
|
47
|
cd /path/to/my/workspace
|
|
48
|
48
|
django-admin.py startproject $PROJECTNAME
|
|
49
|
49
|
|
|
50
|
50
|
Configure ``settings.py``
|
|
51
|
51
|
-------------------------
|
|
52
|
52
|
|
|
53
|
|
-* Add ``'django.middleware.transaction.TransactionMiddleware'`` to your ``MIDDLEWARE_CLASSES`` tuple, making
|
|
|
53
|
+* Add ``'django.middleware.transaction.TransactionMiddleware'`` to your ``MIDDLEWARE_CLASSES`` tuple, making
|
|
54
|
54
|
sure it comes AFTER ``'django.contrib.auth.middleware.AuthenticationMiddleware'``.
|
|
55
|
|
-
|
|
|
55
|
+
|
|
56
|
56
|
* Add the following to your `INSTALLED_APPS`::
|
|
57
|
57
|
|
|
58
|
58
|
'haystack',
|
|
|
@@ -75,25 +75,29 @@ Configure ``settings.py``
|
|
75
|
75
|
'oscar.apps.reports',
|
|
76
|
76
|
'oscar.apps.search',
|
|
77
|
77
|
'oscar.apps.catalogue_import',
|
|
78
|
|
-
|
|
|
78
|
+
|
|
|
79
|
+* Add the following to your `INSTALLED_APPS` if you intend to use the default oscar dashboard templates::
|
|
|
80
|
+
|
|
|
81
|
+ 'django_sorting',
|
|
|
82
|
+
|
|
79
|
83
|
* Add these to ``TEMPLATE_CONTECT_PROCESSORS``::
|
|
80
|
84
|
|
|
81
|
85
|
'oscar.apps.search.context_processors.search_form',
|
|
82
|
86
|
'oscar.apps.promotions.context_processors.promotions',
|
|
83
|
|
- 'oscar.apps.promotions.context_processors.merchandising_blocks',
|
|
84
|
|
-
|
|
|
87
|
+ 'oscar.apps.promotions.context_processors.merchandising_blocks',
|
|
|
88
|
+
|
|
85
|
89
|
* Import default settings::
|
|
86
|
90
|
|
|
87
|
91
|
from oscar.defaults import *
|
|
88
|
|
-
|
|
|
92
|
+
|
|
89
|
93
|
* If using Solr, configure it::
|
|
90
|
94
|
|
|
91
|
95
|
HAYSTACK_SITECONF = 'oscar.search_sites'
|
|
92
|
96
|
HAYSTACK_SEARCH_ENGINE = 'solr'
|
|
93
|
97
|
HAYSTACK_SOLR_URL = 'http://127.0.0.1:8080/solr'
|
|
94
|
98
|
HAYSTACK_INCLUDE_SPELLING = True
|
|
95
|
|
-
|
|
96
|
|
-Now fill in the normal settings (not related to django-oscar) within ``settings.py`` - eg ``DATABASES``, ``TIME_ZONE`` etc
|
|
|
99
|
+
|
|
|
100
|
+Now fill in the normal settings (not related to django-oscar) within ``settings.py`` - eg ``DATABASES``, ``TIME_ZONE`` etc
|
|
97
|
101
|
|
|
98
|
102
|
A vanilla install of django-oscar is now ready, you could now finish the process by running::
|
|
99
|
103
|
|