您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

installation.rst 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 django project (this assume you have a version of django installed in your global site-packages)::
  11. cd /path/to/my/workspace
  12. django-admin startproject myshop
  13. Create a new virtual env::
  14. mkvirtualenv --not-site-packages myshop
  15. A nice extension now is to edit your ``~/.virtualenv/myshop/bin/postactivate`` file to contain::
  16. cd ~/path/to/myshop
  17. so that you can simply type ``workon myshop`` to jump into your project folder with the virtual
  18. environment set-up.
  19. Install ``django-oscar``
  20. ------------------------
  21. Install django-oscar using pip::
  22. pip install -e git+git://github.com/codeinthehole/django-oscar.git#egg=django-oscar
  23. Make the following changes to your ``settings.py``:
  24. Configure settings
  25. ------------------
  26. * Add ``'django.middleware.transaction.TransactionMiddleware'`` to your ``MIDDLEWARE_CLASSES`` tuple, making
  27. sure it comes BEFORE ``'django.contrib.auth.middleware.AuthenticationMiddleware'``.
  28. * Uncomment ``django.contrib.admin`` from ``INSTALLED_APPS``
  29. Add the following to your `INSTALLED_APPS`::
  30. 'oscar',
  31. 'oscar.order',
  32. 'oscar.checkout',
  33. 'oscar.order_management',
  34. 'oscar.product',
  35. 'oscar.basket',
  36. 'oscar.payment',
  37. 'oscar.offer',
  38. 'oscar.address',
  39. 'oscar.stock',
  40. 'oscar.image',
  41. 'oscar.shipping',
  42. 'oscar.customer',
  43. Now fill in the normal settings (not related to django-oscar) within ``settings.py`` - eg ``DATABASES``, ``TIME_ZONE`` etc
  44. A vanilla install of django-oscar is now ready, you could now finish the process by running::
  45. ./manage.py syncdb
  46. However, in reality you will need to start extending the models to match your domain. It's best to do
  47. this before creating your initial schema.