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

installation.rst 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.