Skip to content

Commit

Permalink
Merge branch 'main' into view_protectors
Browse files Browse the repository at this point in the history
  • Loading branch information
timthelion committed Apr 22, 2024
2 parents b637389 + 9f7c18e commit bc52d2c
Show file tree
Hide file tree
Showing 24 changed files with 864 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -13,6 +13,7 @@ docs/doctrees/*
*.swp
.idea
.tox/**
.venv

# ignore demo attachments that user might have added
helpdesk/attachments/
Expand All @@ -25,4 +26,3 @@ demo/demodesk/media/helpdesk/attachments/DH-3/3/*
demo/demodesk/media/helpdesk/attachments/DH-3/4/*
!demo/demodesk/media/helpdesk/attachments/DH-3/3/someinfo.txt
!demo/demodesk/media/helpdesk/attachments/DH-3/4/helpdesk.png

31 changes: 20 additions & 11 deletions README.rst
Expand Up @@ -28,11 +28,11 @@ get started with testing or developing `django-helpdesk`. The demo project
resides in the `demo/` top-level folder.

It's likely that you can start up a demo project server by running
only the command:
only the command (consider creating a virtualenv before):

make rundemo

or with docker:
or with docker::

docker build . -t demodesk
docker run --rm -v "$PWD:/app" -p 8080:8080 demodesk
Expand Down Expand Up @@ -74,27 +74,33 @@ Developer Environment

Follow these steps to set up your development environment to contribute to helpdesk:
- check out the helpdesk app to your local file system::
git clone https://github.com/django-helpdesk/django-helpdesk.git

git clone https://github.com/django-helpdesk/django-helpdesk.git
- install a virtual environment
- using virtualenv from the helpdesk base folder do::
virtualenv .venv && source .venv/bin/activate
- install a virtual environment and activate it::
python -m venv .venv && source .venv/bin/activate

- install the requirements for development::

pip install -r requirements.txt -r requirements-dev.txt

- install the requirements for testing as well::
pip install -r requirements.txt -r requirements-dev.txt -r requirements-testing.txt
- you can install the requirements for testing as well::

pip install -r requirements-testing.txt

To deactivate the virtual environment, use ``deactivate``. Then to reactivate it, just run::

To reactivate a VENV just run:
source .venv/bin/activate
source .venv/bin/activate

To see option for the Makefile run: `make`

The project enforces a standardized formatting in the CI/CD pipeline. To ensure you have the correct formatting run::

make checkformat
To auto format any code use this::

make format

Testing
Expand All @@ -104,6 +110,9 @@ From the command line you can run the tests using: `make test`

See `quicktest.py` for usage details.

If you need to create tests for new features, add your tests in a test file to the `tests` module and call them in the test VENV with::
python quicktest.py helpdesk.tests.test_my_new_features -v 2

Upgrading from previous versions
--------------------------------

Expand Down Expand Up @@ -145,5 +154,5 @@ Note that django-helpdesk is distributed with 3rd party products which
have their own licenses. See LICENSE.3RDPARTY for license terms for
included packages.

.. _note: http://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching
.. _note: https://docs.djangoproject.com/en/dev/ref/databases/#substring-matching-and-case-sensitivity

10 changes: 4 additions & 6 deletions demo/README.rst
Expand Up @@ -24,23 +24,21 @@ Ideally, you'd use a virtualenv instead
(see below for details).

To use your system directory, from the top-level
django-helpdesk directory, simply run:
django-helpdesk directory, simply run::

make rundemo

Once the console gives a prompt that the HTTP
server is listening, open your web browser
and navigate to:

localhost:8080
and navigate to http://localhost:8080

You should see the django-helpdesk public web portal!

If you shut down the server, you can't immediately
re-run the demo because the make commands would
encounter problems trying to re-write the database.
Instead, before running the demo, you will need
to first clean the demo:
to first clean the demo::

sudo make distclean

Expand All @@ -53,7 +51,7 @@ want to use a virtualenv.

If so, you might change the pip in the makefile
to point to your virtualenv's pip instead
before running:
before running::

make rundemo

Expand Down
4 changes: 2 additions & 2 deletions demo/demodesk/config/settings.py
Expand Up @@ -68,7 +68,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'demo.demodesk.config.urls'
ROOT_URLCONF = 'demodesk.config.urls'

TEMPLATES = [
{
Expand All @@ -87,7 +87,7 @@
},
]

WSGI_APPLICATION = 'demo.demodesk.config.wsgi.application'
WSGI_APPLICATION = 'demodesk.config.wsgi.application'


# django-helpdesk configuration settings
Expand Down
14 changes: 7 additions & 7 deletions docs/configuration.rst
Expand Up @@ -13,7 +13,7 @@ Before django-helpdesk will be much use, you need to do some basic configuration

Don't forget to set the relevant Django environment variables in your crontab::

*/5 * * * * /path/to/helpdesksite/manage.py get_email
*/5 * * * * /path/to/helpdesksite/manage.py get_email

This will run the e-mail import every 5 minutes

Expand All @@ -32,23 +32,23 @@ Before django-helpdesk will be much use, you need to do some basic configuration

4. If you wish to automatically escalate tickets based on their age, set up a cronjob to run the escalation command on a regular basis::

0 * * * * /path/to/helpdesksite/manage.py escalate_tickets
0 * * * * /path/to/helpdesksite/manage.py escalate_tickets

This will run the escalation process hourly, using the 'Escalation Days' setting for each queue to determine which tickets to escalate.

5. If you wish to exclude some days (eg, weekends) from escalation calculations, enter the dates manually via the Admin, or setup a cronjob to run a management command on a regular basis::

0 0 * * 0 /path/to/helpdesksite/manage.py create_escalation_exclusions --days saturday,sunday --escalate-verbosely
0 0 * * 0 /path/to/helpdesksite/manage.py create_escalation_exclusions --days saturday,sunday --escalate-verbosely

This will, on a weekly basis, create exclusions for the coming weekend.

6. Log in to your Django admin screen, and go to the 'Sites' module. If the site ``example.com`` is listed, click it and update the details so they are relevant for your website.

7. If you do not send mail directly from your web server (eg, you need to use an SMTP server) then edit your ``settings.py`` file so it contains your mail server details::

EMAIL_HOST = 'XXXXX'
EMAIL_HOST_USER = 'YYYYYY@ZZZZ.PPP'
EMAIL_HOST_PASSWORD = '123456'
EMAIL_HOST = 'XXXXX'
EMAIL_HOST_USER = 'YYYYYY@ZZZZ.PPP'
EMAIL_HOST_PASSWORD = '123456'

8. If you wish to use SOCKS4/5 proxy with Helpdesk Queue email operations, install PySocks manually. Please note that mixing both SOCKS and non-SOCKS email sources for different queues is only supported under Python 2; on Python 3, SOCKS proxy support is all-or-nothing: either all queue email sources must use SOCKS or none may use it. If you need this functionality on Python 3 please `let us know <https://github.com/django-helpdesk/django-helpdesk/issues/new>`_.

Expand Down Expand Up @@ -88,6 +88,6 @@ You may add your own site specific navigation header to be included inside the <

1. Create an override template in your project's templates directory::

helpdesk/custom_navigation_header.html
helpdesk/custom_navigation_header.html

2. Update the contents to display your custom navigation.
2 changes: 0 additions & 2 deletions docs/custom_fields.rst
Expand Up @@ -3,6 +3,4 @@ Custom Fields

django-helpdesk supports custom fields on the ``Ticket`` model. These fields are created by using the Django administration tool, and are shown on both the public and staff submission forms. You can use most Django field types including text, integer, boolean, and list.

The demo at http://django-helpdesk-demo.herokuapp.com contains an example of each type of custom field, including a mix of mandatory and optional fields.

Custom fields are relatively inefficient; you can search them, but this might degrade performance of your installation if you make use of custom fields. They can be useful for tracking extra information that your organisation needs but that isn't supported out of the box.
1 change: 0 additions & 1 deletion docs/custom_templates.rst
Expand Up @@ -6,4 +6,3 @@ django-helpdesk supports custom HTML templates that can be styled with CSS.
In particular, users can include a file named `helpdesk-customize.css` in their django project directory to provide CSS overrides easily.

In general, entire HTML and CSS templates may be overriden by including a file of the same name in the project directory. Django automatically searches the project directory before searching for default templates included with django-helpdesk.

2 changes: 1 addition & 1 deletion docs/iframe_submission.rst
@@ -1,5 +1,5 @@
Ticket submission with embeded iframe
-------------------------------------
=====================================

Django-helpdesk associates an email address with each submitted ticket. If you integrate django-helpdesk directly into your django application, logged in users will automatically have their email address set when they visit the `/tickets/submit/` form. If you wish to pre-fill fields in this form, you can do so simply by setting the following query parameters:

Expand Down
9 changes: 1 addition & 8 deletions docs/index.rst
Expand Up @@ -16,18 +16,13 @@ Contents
settings
spam
custom_fields
custom_templates
api
webhooks
iframe_submission
teams
license


How Does It Look?
-----------------

You can see a demo installation at http://django-helpdesk-demo.herokuapp.com/

Quick Start
-----------

Expand Down Expand Up @@ -72,5 +67,3 @@ Optionally, their access to view tickets, both on the dashboard and through sear
Licensing
---------
django-helpdesk is released under the BSD license, however it packages 3rd party applications which may be using a different license. More details can be found in the :doc:`license` documentation.


0 comments on commit bc52d2c

Please sign in to comment.