Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

development-environment.rst 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 SCSS/CSS
  30. ----------------
  31. Oscar's CSS files are built using SASS.
  32. If you want to develop the SCSS files, run::
  33. npm run watch
  34. Which will watch for and compile changes to the source files into output CSS.
  35. You can manually compile static assets files by running::
  36. npm run build
  37. Testing migrations
  38. ------------------
  39. To test the migrations against PostgreSQL you will need to set
  40. up an environment with both installed and do the following:
  41. 1. Change to sandbox folder and activate your virtualenv
  42. 2. Run helper script::
  43. ./test_migrations.sh
  44. This will recreate the Oscar database in PostgreSQL and rebuild it using ``migrate``.