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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ======================================
  2. Setting up the development environment
  3. ======================================
  4. Fork the repository 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 ``python3-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 python3-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. $ sandbox/manage.py makemigrations
  29. Writing LESS/CSS
  30. ----------------
  31. Oscar's CSS files are built using LESS_. 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. OSCAR_USE_LESS = True
  36. in ``sandbox/settings_local.py``. This will include the on-the-fly
  37. ``less`` pre-processor. That will allow you to see changes to the LESS
  38. files after a page reload.
  39. You can manually compile static assets files by running::
  40. npm run build
  41. For this to work, you will need to ensure that the pre-processor binary
  42. ``lessc`` is installed. Using npm_, install LESS using::
  43. npm install less
  44. .. warning::
  45. If you do submit a pull request that changes the LESS files. Please also
  46. recompile the CSS files and include them in your pull request.
  47. .. _npm: https://www.npmjs.com/
  48. Testing migrations
  49. ------------------
  50. To test the migrations against PostgreSQL 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 PostgreSQL and rebuild it using ``migrate``.