Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Installing django-oscar for development
  2. =======================================
  3. Set up `virtualenv` if you haven't already done so::
  4. sudo apt-get install python-setuptools
  5. sudo easy_install pip
  6. sudo pip install virtualenv virtualenvwrapper
  7. echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
  8. Note: Fedora (and possibly other Red Hat based distros) installs virtualenvwrapper.sh in /usr/bin path, so the last line above should read::
  9. echo "source /usr/bin/virtualenvwrapper.sh" >> ~/.basrc
  10. Reload bash with the following command::
  11. ~/.bashrc
  12. Do the following from your workspace folder::
  13. mkdir oscar
  14. cd oscar
  15. mkvirtualenv --no-site-packages oscar
  16. workon oscar
  17. After checking out your fork, install the latest version of Django into your virtualenv (currenty a beta of 1.3)::
  18. pip install django
  19. Install all packages from the requirements file (optional)::
  20. pip install -r requirements-dev.txt
  21. This just provides some useful tooling for developing a django project - the installed
  22. modules are not mandatory to run oscar.
  23. Install oscar in development mode within your virtual env::
  24. python setup.py develop
  25. Note: In case of gcc crashing and complaining in-between installation process,
  26. make sure you have appropriate -devel packages installed (ie. mysql-devel) in
  27. your system.
  28. Now create a `local_settings.py` file which contains details of your local database
  29. that you want to use for development. Be sure to create two databases: one for development
  30. and one for running the unit tests (prefix `test_` on the normal db name).
  31. Developing
  32. ----------
  33. Developing oscar normally involves working on a django project which uses oscar
  34. as a installed app. There are several such projects within the `examples` folder - the
  35. `defaultshop` project does not customise oscar at all and uses everything in its
  36. default format.
  37. Each example shop has its own `manage.py` executable which you can use to create
  38. your database::
  39. ./manage.py syncdb
  40. There is a shortcut script for dropping all of a projects's apps and rerunning `syncdb` in
  41. the `examples` folder - you need to specify which project to act on::
  42. ./recreate_project_tables.sh defaultshop
  43. There is a similar script for running tests::
  44. ./run_tests.sh defaultshop
  45. This specifies a sqlite3 database to use for testing and filters out the useless output.