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.

development-environment.rst 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ======================================
  2. Setting up the development environment
  3. ======================================
  4. Fork the repo and run::
  5. $ git clone git@github.com:<username>/django-oscar.git
  6. $ cd django-oscar
  7. $ mkvirtualenv oscar # needs virtualenvwrapper
  8. $ make install
  9. If using Ubuntu, the ``python-dev`` package is required for some packages to
  10. compile.
  11. The :doc:`sandbox </internals/sandbox>` site can be used to examine changes
  12. locally. It is easily created by running::
  13. $ make sandbox
  14. JPEG Support
  15. ------------
  16. On Ubuntu, you need to install a few libraries to get JPEG support with
  17. Pillow::
  18. $ sudo apt-get install python-dev libjpeg-dev libfreetype6-dev zlib1g-dev
  19. If you already installed PIL (you did if you ran ``make install`` previously),
  20. reinstall it::
  21. $ pip uninstall Pillow
  22. $ pip install Pillow
  23. Creating migrations
  24. -------------------
  25. As the sandbox is a vanilla Oscar site, it is what we use to build migrations
  26. against::
  27. $ make sandbox
  28. $ sites/sandbox/manage.py schemamigration $YOURAPP --auto
  29. Writing LESS/CSS
  30. ----------------
  31. Oscar's CSS files are built using LESS_ V1. However, the sandbox defaults to
  32. serving CSS files directly, bypassing LESS compilation.
  33. .. _LESS: http://lesscss.org/
  34. If you want to develop the LESS files, set::
  35. USE_LESS = True
  36. COMPRESS_ENABLED = False
  37. in ``sites/sandbox/settings_local.py``. This will cause Oscar to use
  38. `django-compressor`_ to compile the LESS files as they are requested. For this to
  39. work, you will need to ensure that the LESS compiler ``lessc`` is installed.
  40. Using npm, install LESS using::
  41. npm install less@'<2.0.0'
  42. .. _`django-compressor`: http://django_compressor.readthedocs.org/en/latest/
  43. You can manually compile the CSS files by running::
  44. make css
  45. .. warning::
  46. If you do submit a pull request that changes the LESS files. Please also
  47. recompile the CSS files and include them in your pull request.
  48. Testing migrations against MySQL and Postgres
  49. ---------------------------------------------
  50. To test the migrations against MySQL and Postgres you will need to set
  51. up an environment with both installed and do the following:
  52. 1. Change to sandbox folder and activate your virtualenv
  53. 2. Run helper script::
  54. ./test_migrations.sh
  55. This will recreate the Oscar database in both MySQL and Postgres and rebuild
  56. it using ``migrate``.