setup.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. _setting-up:
  2. Setting up Distro Tracker
  3. =========================
  4. .. _requirements:
  5. Requirements
  6. ------------
  7. Distro Tracker currently depends on the following Debian packages:
  8. - python-django (>= 1.8)
  9. - python-requests
  10. - python-django-jsonfield (>= 1.0.0)
  11. - python-django-debug-toolbar (in development mode only)
  12. - python-django-captcha (optional)
  13. - python-debian
  14. - python-apt
  15. - python-gpgme
  16. - python-yaml
  17. - python-bs4
  18. - python-pyinotify
  19. - python-soappy (optional)
  20. - python-ldap (optional)
  21. - python-tox (for development only)
  22. For Python2.7, the following additional packages are required:
  23. - python-mock (for development only)
  24. - python-lzma
  25. Here is the list of required packages for development on Debian Jessie::
  26. $ sudo aptitude install python-django python-requests python-django-jsonfield python-django-debug-toolbar python-debian python-apt python-gpgme python-yaml python-bs4 python-soappy python-ldap python-pyinotify python-tox python-mock python-lzma python3-django python3-requests python3-django-jsonfield python3-django-debug-toolbar python3-debian python3-apt python3-gpgme python3-yaml python3-bs4 python3-pyinotify
  27. .. _database_setup:
  28. Database
  29. --------
  30. Distro Tracker does not rely on any database specific features and as such should be
  31. able to run on top of any database server. The only possible known issue is when
  32. using sqlite3 which has a limit on the number of query parameters of 999 on
  33. some systems.
  34. When you choose your database flavor, you must install the Python bindings,
  35. i.e. psycopg2 for PostgreSQL and MySQL-Python for MySQL, etc.
  36. To create the database you must run the following commands::
  37. $ ./manage.py migrate
  38. See also the Debian package's README.Debian for some details about the setup.
  39. .. _localsettings_setup:
  40. Local Settings
  41. --------------
  42. While Distro Tracker tries to guess as much as needed, you generally will
  43. want to customize some of its parameters. You can do so by copying
  44. ``distro_tracker/project/settings/local.py.sample`` to
  45. ``distro_tracker/project/settings/local.py`` and then editing the latter
  46. file. Have a look at :py:mod:`distro_tracker.project.settings.defaults`
  47. to learn about all the variables that you can override and extend.
  48. To make things easier, Distro Tracker provides default configuration suitable
  49. for production use (installed from the Debian package) or for development
  50. use (running out of a git checkout). Depending on the case, the
  51. ``selected.py`` symlink points either to ``production.py`` or to
  52. ``development.py``.
  53. Keyrings
  54. --------
  55. The ``DISTRO_TRACKER_KEYRING_DIRECTORY`` lets you define a
  56. path to a directory containing known public PGP keys. These keys are used when
  57. verifying various signed content, such as news.
  58. You may add a ``gpg.conf`` file in this directory with additional ``keyring``
  59. directives if you want to include more keys than the ones found in
  60. ``pubring.gpg`` file.
  61. .. _tests_setup:
  62. Tests
  63. -----
  64. Once everything is set up, be sure to run the test suite to make sure
  65. everything is actually working as expected. You can do this by issuing the
  66. following command from the Distro Tracker root directory::
  67. $ ./manage.py test
  68. Cron tasks
  69. ----------
  70. The data used by distro-tracker needs to be regularly updated/refreshed.
  71. For this you must put “./manage.py tracker_run_all_tasks” in cron.