You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

installation.rst 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Installing django-oscar
  2. =======================
  3. Environment
  4. -----------
  5. Install pip and virtualenv (if you haven't already)::
  6. sudo apt-get install python-setuptools
  7. sudo easy_install pip
  8. sudo pip install virtualenv virtualenvwrapper
  9. echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
  10. Create a new virtual env::
  11. mkvirtualenv --no-site-packages $PROJECTNAME
  12. Install oscar and its dependencies::
  13. pip install -e git+git://github.com/codeinthehole/django-oscar.git#egg=django-oscar
  14. This will install Django and a few other packages. Now create the project
  15. cd /path/to/my/workspace
  16. django-admin.py startproject $PROJECTNAME
  17. A nice extension now is to edit your ``~/.virtualenv/$PROJECTNAME/bin/postactivate`` file to contain::
  18. cd ~/path/to/my/workspace/$PROJECTNAME
  19. so that you can simply type ``workon $PROJECTNAME`` to jump into your project folder with the virtual
  20. environment set-up.
  21. Configure settings
  22. ------------------
  23. * Add ``'django.middleware.transaction.TransactionMiddleware'`` to your ``MIDDLEWARE_CLASSES`` tuple, making
  24. sure it comes BEFORE ``'django.contrib.auth.middleware.AuthenticationMiddleware'``.
  25. * Uncomment ``django.contrib.admin`` from ``INSTALLED_APPS``.
  26. Add the following to your `INSTALLED_APPS`::
  27. 'oscar',
  28. 'oscar.order',
  29. 'oscar.checkout',
  30. 'oscar.order_management',
  31. 'oscar.product',
  32. 'oscar.basket',
  33. 'oscar.payment',
  34. 'oscar.offer',
  35. 'oscar.address',
  36. 'oscar.stock',
  37. 'oscar.image',
  38. 'oscar.shipping',
  39. 'oscar.customer',
  40. Now fill in the normal settings (not related to django-oscar) within ``settings.py`` - eg ``DATABASES``, ``TIME_ZONE`` etc
  41. A vanilla install of django-oscar is now ready, you could now finish the process by running::
  42. ./manage.py syncdb
  43. However, in reality you will need to start extending the models to match your domain. It's best to do
  44. this before creating your initial schema.
  45. Configure urls
  46. --------------
  47. Oscar comes with a number of urls and views out of the box. These are
  48. recommendations rather than a requirement but you easily use them in your
  49. e-commerce site by adding the oscar urls to your projects local ``urls.py``
  50. (r'^', include('oscar.urls')),
  51. This will bring in all of oscar's defined urls. Of course you can pull in the
  52. urls for the individual apps if you prefer or simply define your own