Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

installation.rst 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. =======================================
  2. Installing django-oscar for development
  3. =======================================
  4. Note that these instructions assume you are developing on Ubuntu.
  5. Virtual environment
  6. -------------------
  7. Set up ``pip`` and ``virtualenv`` if you haven't already done so::
  8. sudo apt-get install python-setuptools
  9. sudo easy_install pip
  10. sudo pip install virtualenv virtualenvwrapper
  11. echo "source `which virtualenvwrapper`" >> ~/.bashrc
  12. Reload bash to add the virtualenvwrapper commands to your path::
  13. . ~/.bashrc
  14. Create a virtualenv for developement::
  15. mkvirtualenv --no-site-packages oscar
  16. workon oscar
  17. Forking django-oscar
  18. --------------------
  19. Sign in to github, navigate to https://github.com/tangentlabs/django-oscar and click "Fork". This will create a
  20. copy of the repository in your account.
  21. Now clone the remote repository to your machine::
  22. cd workspace
  23. git clone git@github.com:username/django-oscar.git
  24. See the github guide to forking for more details (http://help.github.com/fork-a-repo/).
  25. Install django-oscar and dependencies
  26. -------------------------------------
  27. Install django and the packages from the requirements file, which aren't essential but are useful
  28. for testing and development::
  29. pip install django
  30. pip install -r requirements-dev.txt
  31. Install oscar in development mode within your virtualenv::
  32. cd django-oscar
  33. python setup.py develop
  34. Note: In case of gcc crashing and complaining in-between installation process,
  35. make sure you have appropriate -devel packages installed (ie. mysql-devel) in
  36. your system.
  37. Now create a ``settings_local.py`` file which contains details of your local database
  38. that you want to use for development. At a minimum, this needs to define the ``DATABASES`` tuple.
  39. Developing
  40. ----------
  41. Developing oscar normally involves working on a django project which uses oscar
  42. as a installed app. There are several such projects within the ``examples`` folder:
  43. * The ``vanilla`` project does not customise oscar at all and uses everything in its
  44. default format. It represents a blank canvas for an ecommerce shop.
  45. * The ``demo`` project does customise oscar, and is intended to demonstrate the range
  46. of features in oscar.
  47. Each example shop has its own ``manage.py`` executable which you can use to create
  48. your database::
  49. ./manage.py syncdb
  50. Install sample data
  51. -------------------
  52. Oscar ships with sample data for a simple bookshop. Load the product data and images using the
  53. following commands::
  54. cd examples/vanilla
  55. ./manage.py import_catalogue ../sample-data/books.csv
  56. ./manage.py import_images ../sample-data/book-images/
  57. ./manage.py update_index
  58. Helper scripts
  59. --------------
  60. There is a shortcut script for dropping all of a projects's apps and rerunning `syncdb` in
  61. the `examples` folder - you need to specify which project to act on::
  62. ./recreate_project_tables.sh vanilla
  63. There is a similar script for running tests::
  64. ./run_tests.sh vanilla
  65. This specifies a sqlite3 database to use for testing and filters out the useless output.