mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-12-29 18:18:49 +01:00
f8684e7b3f
Django 1.3 staticfiles
103 lines
4.0 KiB
ReStructuredText
103 lines
4.0 KiB
ReStructuredText
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)
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
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/rossp/django-helpdesk.git``
|
|
|
|
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
|
|
-----------------------------
|
|
|
|
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::
|
|
|
|
INSTALLED_APPS = (
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.sites',
|
|
'django.contrib.admin', # Required for helpdesk admin/maintenance
|
|
'django.contrib.markup', # Required for text display
|
|
'south', # Highly recommended to make database migrations simpler.
|
|
'helpdesk', # This is new!
|
|
)
|
|
|
|
2. Make sure django-helpdesk is accessible via ``urls.py``. Add the following line to ``urls.py``::
|
|
|
|
(r'helpdesk/', include('helpdesk.urls')),
|
|
|
|
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::
|
|
|
|
(r'', include('helpdesk.urls')),
|
|
|
|
This line will have to come *after* any other lines in your urls.py such as those used by the Django admin.
|
|
|
|
3. Create the required database tables. I'd suggest using *South*, however the following will work::
|
|
|
|
./manage.py syncdb
|
|
|
|
If you're wise enough to use South, the first migration will need to be a fake::
|
|
|
|
./manage.py migrate helpdesk 0001 --fake
|
|
|
|
After the initial migration, all others are done in the usual way::
|
|
|
|
./manage.py migrate helpdesk
|
|
|
|
4. [If you're not using django.contrib.staticfiles] Inside your ``STATIC_ROOT`` folder, create a new folder called ``helpdesk`` and copy the contents of ``helpdesk/static`` into it. Alternatively, create a symlink::
|
|
|
|
ln -s /path/to/helpdesk/static/helpdesk /path/to/static/helpdesk
|
|
|
|
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::
|
|
|
|
chown www-data:www-data attachments/
|
|
chmod 700 attachments
|
|
|
|
(substitute www-data for the user / group that your web server runs as, eg 'apache' or 'httpd')
|
|
|
|
If all else fails ensure all users can write to it::
|
|
|
|
chmod 777 attachments/
|
|
|
|
This is NOT recommended, especially if you're on a shared server.
|
|
|
|
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.
|
|
|
|
If you are using Apache, put a ``.htaccess`` file in the ``attachments`` folder with the following content::
|
|
|
|
Options -Indexes
|
|
|
|
You will also have to make sure that ``.htaccess`` files aren't being ignored.
|
|
|
|
Ideally, accessing http://MEDIA_URL/helpdesk/attachments/ will give you a 403 access denied error.
|
|
|
|
7. If it's not already installed, install ``python-markdown``::
|
|
|
|
pip install Markdown
|
|
|
|
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.
|