install.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ============
  2. Installation
  3. ============
  4. .. note::
  5. After following this instruction Django JET dashboard won't be active (as it is located into
  6. a separate application). If you want to make it work, you will have to enable dashboard application
  7. by following :doc:`install_dashboard` steps too.
  8. * Download and install latest version of Django JET:
  9. .. code:: python
  10. pip install django-jet
  11. # or
  12. easy_install django-jet
  13. * Add 'jet' application to the INSTALLED_APPS setting of your Django project settings.py file (note it should be before 'django.contrib.admin'):
  14. .. code:: python
  15. INSTALLED_APPS = (
  16. ...
  17. 'jet',
  18. 'django.contrib.admin',
  19. ...
  20. )
  21. * Make sure ``django.template.context_processors.request`` context processor is enabled in settings.py (Django 1.8+ way):
  22. .. code:: python
  23. TEMPLATES = [
  24. {
  25. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  26. 'DIRS': [],
  27. 'APP_DIRS': True,
  28. 'OPTIONS': {
  29. 'context_processors': [
  30. ...
  31. 'django.template.context_processors.request',
  32. ...
  33. ],
  34. },
  35. },
  36. ]
  37. .. warning::
  38. Before Django 1.8 you should specify context processors different way. Also use ``django.core.context_processors.request`` instead of ``django.template.context_processors.request``.
  39. .. code:: python
  40. from django.conf import global_settings
  41. TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
  42. 'django.core.context_processors.request',
  43. )
  44. * Add URL-pattern to the urlpatterns of your Django project urls.py file (they are needed for related–lookups and autocompletes):
  45. .. code:: python
  46. urlpatterns = patterns(
  47. '',
  48. url(r'^jet/', include('jet.urls', 'jet')), # Django JET URLS
  49. url(r'^admin/', include(admin.site.urls)),
  50. ...
  51. )
  52. * Create database tables:
  53. .. code:: python
  54. python manage.py migrate jet
  55. # or
  56. python manage.py syncdb
  57. * Collect static if you are in production environment:
  58. .. code:: python
  59. python manage.py collectstatic
  60. * Clear your browser cache