2011-02-05 00:13:37 +01:00
Installation
============
django-helpdesk installation isn't difficult, but it requires you have a bit of existing know-how about Django.
Getting The Code
----------------
Installing using PIP
~~~~~~~~~~~~~~~~~~~~
Try using `` pip install django-helpdesk `` . Go and have a beer to celebrate Python packaging.
GIT Checkout (Cutting Edge)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-10-12 02:14:10 +02:00
If you're planning on editing the code or just want to get whatever is the latest and greatest, you can clone the official Git repository with `` git clone git://github.com/django-helpdesk/django-helpdesk.git ``
2011-02-05 00:13:37 +01:00
Copy the `` helpdesk `` folder into your `` PYTHONPATH `` .
I just want a .tar.gz!
~~~~~~~~~~~~~~~~~~~~~~
You can download the latest PyPi package from http://pypi.python.org/pypi/django-helpdesk/
Download, extract, and drop `` helpdesk `` into your `` PYTHONPATH ``
Adding To Your Django Project
-----------------------------
2015-02-23 04:22:28 +01:00
1. Edit your `` settings.py `` file and add `` helpdesk `` to the `` INSTALLED_APPS `` setting. You also need `` django.contrib.admin `` in `` INSTALLED_APPS `` if you haven't already added it. eg::
2014-07-21 10:21:33 +02:00
2011-02-05 00:13:37 +01:00
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
2016-06-23 06:58:27 +02:00
'django.contrib.sites', # Required for determing domain url for use in emails
2014-07-21 10:21:33 +02:00
'django.contrib.admin', # Required for helpdesk admin/maintenance
'django.contrib.humanize', # Required for elapsed time formatting
'markdown_deux', # Required for Knowledgebase item formatting
2015-02-23 04:24:53 +01:00
'bootstrapform', # Required for nicer formatting of forms with the default templates
'helpdesk', # This is us!
2011-02-05 00:13:37 +01:00
)
2. Make sure django-helpdesk is accessible via `` urls.py `` . Add the following line to `` urls.py `` ::
2015-06-03 08:04:46 +02:00
url(r'helpdesk/', include('helpdesk.urls')),
2011-02-05 00:13:37 +01:00
2011-02-08 08:45:42 +01:00
Note that you can change 'helpdesk/' to anything you like, such as 'support/' or 'help/'. If you want django-helpdesk to be available at the root of your site (for example at http://support.mysite.tld/) then the line will be as follows::
2014-07-21 10:21:33 +02:00
2015-12-22 10:29:48 +01:00
url(r'', include('helpdesk.urls', namespace='helpdesk')),
2011-02-08 08:45:42 +01:00
This line will have to come *after* any other lines in your urls.py such as those used by the Django admin.
2015-12-22 10:29:48 +01:00
Note that the `helpdesk` namespace is no longer required for Django 1.9 and you can use a different namespace.
However, it is recommended to use the default namespace name for clarity.
2015-12-16 00:35:00 +01:00
3. Create the required database tables.
2011-02-05 00:13:37 +01:00
2015-12-16 00:35:00 +01:00
Migrate using Django migrations::
2011-04-27 11:57:03 +02:00
./manage.py migrate helpdesk
2011-02-05 00:13:37 +01:00
2012-08-08 07:21:29 +02:00
4. Include your static files in your public web path::
2011-02-05 00:13:37 +01:00
2012-08-08 07:21:29 +02:00
python manage.py collectstatic
2011-02-05 00:13:37 +01:00
5. Inside your `` MEDIA_ROOT `` folder, inside the `` helpdesk `` folder, is a folder called `` attachments `` . Ensure your web server software can write to this folder - something like this should do the trick::
2011-02-05 05:29:50 +01:00
chown www-data:www-data attachments/
chmod 700 attachments
2011-02-05 00:13:37 +01:00
2011-02-05 05:29:50 +01:00
(substitute www-data for the user / group that your web server runs as, eg 'apache' or 'httpd')
2011-02-05 00:13:37 +01:00
2011-02-05 05:29:50 +01:00
If all else fails ensure all users can write to it::
2011-02-05 00:13:37 +01:00
2011-02-05 05:29:50 +01:00
chmod 777 attachments/
2011-02-05 00:13:37 +01:00
2011-02-05 05:29:50 +01:00
This is NOT recommended, especially if you're on a shared server.
2011-02-05 00:13:37 +01:00
6. Ensure that your `` attachments `` folder has directory listings turned off, to ensure users don't download files that they are not specifically linked to from their tickets.
2011-02-05 05:29:50 +01:00
If you are using Apache, put a `` .htaccess `` file in the `` attachments `` folder with the following content::
2011-02-05 00:13:37 +01:00
2011-02-05 05:29:50 +01:00
Options -Indexes
2011-02-05 00:13:37 +01:00
2011-02-12 02:21:34 +01:00
You will also have to make sure that `` .htaccess `` files aren't being ignored.
2011-02-05 00:13:37 +01:00
2011-02-12 02:21:34 +01:00
Ideally, accessing http://MEDIA_URL/helpdesk/attachments/ will give you a 403 access denied error.
2011-02-05 00:13:37 +01:00
2014-07-07 04:10:53 +02:00
7. If it's not already installed, install `` django-markdown-deux `` and ensure it's in your `` INSTALLED_APPS `` ::
2011-02-12 02:21:34 +01:00
2014-07-07 04:10:53 +02:00
pip install django-markdown-deux
2011-03-05 04:19:15 +01:00
8. If you already have a view handling your logins, then great! If not, add the following to `` settings.py `` to get your Django installation to use the login view included in `` django-helpdesk `` ::
LOGIN_URL = '/helpdesk/login/'
Alter the URL to suit your installation path.
2015-02-14 01:10:20 +01:00
2016-05-15 09:55:59 +02:00
9. Load initial e-mail templates, otherwise you will not be able to send e-mail::
2015-02-14 01:10:20 +01:00
python manage.py loaddata emailtemplate.json