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 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ================================
  2. Installing 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 development::
  15. mkvirtualenv --no-site-packages oscar
  16. workon oscar
  17. Forking 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 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 (i.e., ``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 e-commerce 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.