Merge pull request #498 from gwasser/demo

Add a demo project and update docs
This commit is contained in:
Jonathan Barratt 2017-03-31 18:23:17 +07:00 committed by GitHub
commit 88eb1202ee
19 changed files with 939 additions and 83 deletions

14
.gitignore vendored
View File

@ -1,9 +1,23 @@
*.pyc
/dist/
django_helpdesk.egg-info
demo/*.egg-info
demo/demodesk/*.sqlite3
docs/html/*
docs/doctrees/*
.coverage
.project
.pydevproject
.directory
# ignore demo attachments that user might have added
demo/demodesk/media/helpdesk/attachments/*
!demo/demodesk/media/helpdesk/attachments/DH-3
demo/demodesk/media/helpdesk/attachments/DH-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/*
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

View File

@ -2,16 +2,23 @@ Contributing
============
django-helpdesk is an open-source project and as such contributions from the
community are welcomed and encouraged.
community are welcomed and encouraged!
Please read these guidelines to get up to speed quickly. If you have any
questions, please file an issue ticket on GitHub. Our main project
repository is available at:
https://github.com/django-helpdesk/django-helpdesk
Licensing
---------
All contributions to django-helpdesk must be under the BSD license documented in
the LICENSE file in the top-level directory of this project. By submitting a
contribution to this project (in any way: via e-mail, via GitHub forks,
attachments, etc), you acknowledge that your contribution is open-source and
licensed under the BSD license.
the LICENSE file in the top-level directory of this project.
By submitting a contribution to this project (in any way: via e-mail,
via GitHub forks, attachments, etc), you acknowledge that your contribution is
open-source and licensed under the BSD license.
If you or your organisation does not accept these license terms then we cannot
accept your contribution. Please reconsider!
@ -20,8 +27,8 @@ Translations
------------
Although django-helpdesk has originally been written for the English language,
there are already multiple translations to Spanish, Polish, and German and more
translations are welcomed.
there are already multiple translations to Spanish, Polish, German and Russian.
More translations are welcomed!
Translations are handled using the excellent Transifex service which is much
easier for most users than manually editing .po files. It also allows

View File

@ -26,6 +26,3 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EXCEPTIONS
This software is distributed with some third-party software which is not distributed under the above license. See LICENSE.3RDPARTY for further details.

125
Makefile Normal file
View File

@ -0,0 +1,125 @@
# Shortcuts for django-helpdesk testing and development using make
#
# For standard installation of django-helpdesk as a library,
# see INSTALL and the documentation in docs/.
#
# For details about how to develop django-helpdesk,
# see CONTRIBUTING.rst.
PIP = pip3
TOX = tox
#: help - Display callable targets.
.PHONY: help
help:
@echo "django-helpdesk make shortcuts"
@echo "Here are available targets:"
@egrep -o "^#: (.+)" [Mm]akefile | sed 's/#: /* /'
#: develop - Install minimal development utilities for Python3
.PHONY: develop
develop:
$(PIP) install -e .
#: develop - Install minimal development utilities for Python2
.PHONY: develop2
develop2:
pip2 install -e .
#: clean - Basic cleanup, mostly temporary files.
.PHONY: clean
clean:
find . -name "*.pyc" -delete
find . -name '*.pyo' -delete
find . -name "__pycache__" -delete
#: distclean - Remove local builds, such as *.egg-info.
.PHONY: distclean
distclean: clean
rm -rf *.egg
rm -rf *.egg-info
rm -rf demo/*.egg-info
# remove the django-created database
rm -f demo/demodesk/*.sqlite3
#: maintainer-clean - Remove almost everything that can be re-generated.
.PHONY: maintainer-clean
maintainer-clean: distclean
rm -rf build/
rm -rf dist/
rm -rf .tox/
#: test - Run test suites.
.PHONY: test
test:
mkdir -p var
$(PIP) install -e .[test]
$(TOX)
#: documentation - Build documentation (Sphinx, README, ...)
.PHONY: documentation
documentation: sphinx readme
#: sphinx - Build Sphinx documentation (docs).
.PHONY: sphinx
sphinx:
$(TOX) -e sphinx
#: readme - Build standalone documentation files (README, CONTRIBUTING...).
.PHONY: readme
readme:
$(TOX) -e readme
#: demo - Setup demo project using Python3.
.PHONY: demo
demo:
$(PIP) install -e .
$(PIP) install -e demo
demodesk migrate --noinput
# Create superuser; user will be prompted to manually set a password
# When you get a prompt, enter a password of your choosing.
# We suggest a default of 'Test1234' for the demo project.
demodesk createsuperuser --username admin --email helpdesk@example.com
# Install fixtures
demodesk loaddata emailtemplate.json
demodesk loaddata demo.json
#: demo - Setup demo project using Python2.
.PHONY: demo2
demo2:
pip2 install -e .
pip2 install -e demo
demodesk migrate --noinput
# Create superuser; user will be prompted to manually set a password.
# When you get a prompt, enter a password of your choosing.
# We suggest a default of 'Test1234' for the demo project.
demodesk createsuperuser --username admin --email helpdesk@example.com
# Install fixtures (helpdesk templates as well as demo ticket data)
demodesk loaddata emailtemplate.json
demodesk loaddata demo.json
#: runserver - Run demo server using Python3
.PHONY: rundemo
rundemo: demo
demodesk runserver 8080
#: runserver - Run demo server using Python2
.PHONY: rundemo2
rundemo2: demo2
demodesk runserver 8080
#: release - Tag and push to PyPI.
.PHONY: release
release:
$(TOX) -e release

View File

@ -7,65 +7,74 @@ django-helpdesk - A Django powered ticket tracker for small businesses.
.. image:: https://codecov.io/gh/django-helpdesk/django-helpdesk/branch/master/graph/badge.svg
:target: https://codecov.io/gh/django-helpdesk/django-helpdesk
Copyright 2009- Ross Poulton and contributors. All Rights Reserved. See LICENSE for details.
Copyright 2009- Ross Poulton and contributors. All Rights Reserved.
See LICENSE for details.
django-helpdesk was formerly known as Jutda Helpdesk, named after the
company which originally created it. As of January 2011 the name has been
changed to reflect what it really is: a Django-powered ticket tracker with
contributors reaching far beyond Jutda.
Complete documentation is available in the docs/ directory, or online at http://django-helpdesk.readthedocs.org/.
Complete documentation is available in the docs/ directory,
or online at http://django-helpdesk.readthedocs.org/.
You can see a demo installation at http://django-helpdesk-demo.herokuapp.com/
You can see a demo installation at http://django-helpdesk-demo.herokuapp.com/,
or run a demo locally in just a couple steps!
Licensing
---------
See the file 'LICENSE' for licensing terms. Note that django-helpdesk is
distributed with 3rd party products which have their own licenses. See
LICENSE.3RDPARTY for license terms for included packages.
django-helpdesk is licensed under terms of the BSD 3-clause license.
See the file 'LICENSE' for full licensing terms.
Dependencies (pre-flight checklist)
-----------------------------------
Note that django-helpdesk is distributed with 3rd party products which
have their own licenses. See LICENSE.3RDPARTY for license terms for
included packages.
1. Python 2.7 or 3.4+ (3.4+ support is new, please let us know how it goes)
2. Django (1.8+, preferably 1.10)
3. An existing WORKING Django project with database etc. If you
cannot log into the Admin, you won't get this product working.
4. `pip install django-bootstrap-form` and add `bootstrapform` to `settings.INSTALLED_APPS`
5. `pip install django-markdown-deux` and add `markdown_deux` to `settings.INSTALLED_APPS`
6. `pip install email-reply-parser` to get smart email reply handling
7. Add 'django.contrib.sites' to settings.INSTALLED_APPS, ensure there is at least 1 site created.
Demo Quickstart
---------------
django-helpdesk includes a basic demo Django project so that you may easily
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:
sudo make rundemo
then pointing your web browser at localhost:8080.
For more information and options, please read the demo/README.rst file.
**NOTE REGARDING SQLITE AND SEARCHING:**
If you use sqlite as your database, the search function will not work as
effectively as it will with other databases due to its inability to do
case-insensitive searches. It's recommended that you use PostgreSQL or MySQL
if possible. For more information, see this note in the Django documentation:
The demo project uses sqlite as its database. Sqlite does not allow
case-insensitive searches and so the search function may not work as
effectively as it would on other database such as PostgreSQL or MySQL
that does support case-insensitive searches.
For more information, see this note in the Django documentation:
http://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching
When you try to do a keyword search using sqlite, a message will be displayed
to alert you to this shortcoming. There is no way around it, sorry.
**NOTE REGARDING MySQL:**
If you use MySQL, with most default configurations you will receive an error
when creating the database tables as we populate a number of default templates
in languages other than English.
Installation
------------
You must create the database the holds the django-helpdesk tables using the
UTF-8 collation; see the MySQL manual for more information:
http://dev.mysql.com/doc/refman/5.1/en/charset-database.html
django-helpdesk requires either Python 2.7 or 3.4+, as well as Django 1.8+.
The recommended combination is Python 3.4+ with Django 1.10.
If you do NOT do this step, and you only want to use English-language templates,
you can continue however you will receive a warning when running the 'migrate'
commands.
You can quickly install the latest stable version of django-helpdesk app via pip:
Fresh Django Installations
--------------------------
pip install django-helpdesk
If you're on a brand new Django installation, make sure you do a ``migrate``
**before** adding ``helpdesk`` to your ``INSTALLED_APPS``. This will avoid
errors with trying to create User settings.
You may also check out the master branch on GitHub, and install manually:
python setup.py install
Either way, you will need to add django-helpdesk to an existing Django project.
For further installation information see docs/install.html and docs/configuration.html
Upgrading from previous versions
--------------------------------
@ -80,25 +89,16 @@ migrations, get an up to date version of the code base (eg by using
Lastly, restart your web server software (eg Apache) or FastCGI instance, to
ensure the latest changes are in use.
If you are using django-helpdesk pre-migrations (ie pre-2011) then you're
on your own, sorry.
Unfortunately we are unable to assist if you are upgrading from a
version of django-helpdesk prior to migrations (ie pre-2011).
You can continue to the 'Initial Configuration' area, if needed.
Installation
------------
``pip install django-helpdesk``
For further installation information see docs/install.html and docs/configuration.html
Contributing
------------
If you want to help translate django-helpdesk into languages other than English, we encourage you to make use of our Transifex project.
We're happy to include any type of contribution! This can be back-end
python/django code development, front-end web development
(HTML/Javascript, especially jQuery), or even language translations.
https://www.transifex.com/django-helpdesk/django-helpdesk/
Feel free to request access to contribute your translations.
Pull requests for all other changes are welcome. We're currently trying to add test cases wherever possible, so please continue to include tests with pull requests.
For more information on contributing, please see the CONTRIBUTING.rst file.

110
demo/README.rst Normal file
View File

@ -0,0 +1,110 @@
django-helpdesk Demo Project
============================
This folder contains a demo Django project that
illustrates a simple django-helpdesk installation
with common settings.
This project is *NOT* production ready, but can be
used as a template to get started.
In particular, this should be useful for testing
purposes and for those that want to contribute
to development of django-helpdesk. For more information
on contributing, see the CONTRIBUTING.rst file
in the top level of the django-helpdesk directory.
Running the demo
----------------
By default, the demo is configured for Python 3.
While not recommended, the simplest way to get
started is to simply install django-helpdesk
to your system python package directory.
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:
sudo make rundemo
Once the console gives a prompt that the HTTP
server is listening, open your web browser
and navigate to:
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:
sudo make distclean
You may need to use sudo with other make targets too.
*NOTE ON USING VIRTUALENV*
Rather than using the system python, you probably
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:
make rundemo
*NOTE ON USING PYTHON 2*
By default, the demo uses Python 3, as Python 3
will be the recommended version of python for
django-helpdesk and even Django itself in the near future.
However, if you wish to use Python 2, you can
instead run the following:
sudo make rundemo2
Then navigate to the site in a browser as above.
*NOTE ON DJANGO VERISON*
The demo project was also created with Django 1.10
in mind. If you are using a different version of Django,
slight tweaks might be necessary to make the demo work.
*NOTE ON ATTACHMENTS*
The folder:
demo/demodesk/media/helpdesk/attachments
comes pre-populated with a couple of attachments,
to demo how django-helpdesk deals with attachments.
You can look in this folder to see the raw data.
You can also create a different folder for this
and update settings.py, but note that this will
break the demo as some attachments may not be available
unless you migrate the existing data to the
new location.
The demodesk project
--------------------
"demodesk" is the name of our demo Django project.
You probably will want to look at demo/demodesk/config/settings.py
and read the comments, which walk you through a basic
installation with common configuration options.
The top-level Makefile also gives a list of commands so you
can see how to get the project running. Of course,
when you plan to deploy this project, it is recommended
to use a "real" HTTP server like apache or nginx,
and so further configuration will be necessary.
More information can be found in the top-level docs/ folder.

View File

View File

@ -0,0 +1,208 @@
"""
Django settings for django-helpdesk demodesk project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_crkn1+fnzu5$vns_-d+^ayiq%z4k*s!!ag0!mfy36(y!vrazd'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.humanize',
'bootstrapform',
'helpdesk'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'demodesk.config.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'demodesk.config.wsgi.application'
# django-helpdesk configuration settings
# You can override django-helpdesk's defaults by redefining them here.
# To see what settings are available, see the docs/configuration.rst
# file for more information.
# Some common settings are below.
HELPDESK_DEFAULT_SETTINGS = {
'use_email_as_submitter': True,
'email_on_ticket_assign': True,
'email_on_ticket_change': True,
'login_view_ticketlist': True,
'email_on_ticket_apichange': True,
'preset_replies': True,
'tickets_per_page': 25
}
# Should the public web portal be enabled?
HELPDESK_PUBLIC_ENABLED = True
HELPDESK_VIEW_A_TICKET_PUBLIC = True
HELPDESK_SUBMIT_A_TICKET_PUBLIC = True
# Should the Knowledgebase be enabled?
HELPDESK_KB_ENABLED = True
# Instead of showing the public web portal first,
# we can instead redirect users straight to the login page.
HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = False
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/login/'
# Database
# - by default, we use SQLite3 for the demo, but you can also
# configure MySQL or PostgreSQL, see the docs for more:
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Sites
# - this allows hosting of more than one site from a single server,
# in practice you can probably just leave this default if you only
# host a single site, but read more in the docs:
# https://docs.djangoproject.com/en/1.10/ref/contrib/sites/
SITE_ID = 1
# Sessions
# https://docs.djangoproject.com/en/1.10/topics/http/sessions
SESSION_COOKIE_AGE = 86400 # = 1 day
# For better default security, set these cookie flags, but
# these are likely to cause problems when testing locally
#CSRF_COOKIE_SECURE = True
#SESSION_COOKIE_SECURE = True
#CSRF_COOKIE_HTTPONLY = True
#SESSION_COOKIE_HTTPONLY = True
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Email
# https://docs.djangoproject.com/en/1.10/topics/email/
# This demo uses the console backend, which simply prints emails to the console
# rather than actually sending them out.
DEFAULT_FROM_EMAIL = 'helpdesk@example.com'
SERVER_EMAIL = 'helpdesk@example.com'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# If you want to test sending real emails, uncomment and modify the following:
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#EMAIL_HOST = 'smtp.example.com'
#EMAIL_PORT = '25'
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
# By default, django-helpdesk uses en, but other languages are also available.
# The most complete translations are: es-MX, ru
# Contribute to our translations via Transifex if you can!
# See CONTRIBUTING.rst for more info.
LANGUAGE_CODE = 'en-US'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
STATIC_URL = '/static/'
# MEDIA_ROOT is where media uploads are stored.
# We set this to a directory to host file attachments created
# with tickets.
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Fixtures
# https://docs.djangoproject.com/en/1.10/ref/settings/#std:setting-FIXTURE_DIRS
# - This is only necessary to make the demo project work, not needed for
# your own projects unless you make your own fixtures
FIXTURE_DIRS = [os.path.join(BASE_DIR, 'fixtures')]

View File

@ -0,0 +1,31 @@
"""django-helpdesk demodesk URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
# The following uses the static() helper function,
# which only works when in development mode (using DEBUG).
# For a real deployment, you'd have to properly configure a media server.
# For more information, see:
# https://docs.djangoproject.com/en/1.10/howto/static-files/
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('helpdesk.urls', namespace='helpdesk')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -0,0 +1,16 @@
"""
WSGI config for django-helpdesk demodesk project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demodesk.config.settings")
application = get_wsgi_application()

View File

@ -0,0 +1,13 @@
[
{"model": "helpdesk.queue", "pk": 1, "fields": {"title": "Django Helpdesk", "slug": "DH", "email_address": "django-helpdesk@example.com", "locale": "en-US", "allow_public_submission": true, "allow_email_submission": true, "escalate_days": 5, "new_ticket_cc": "", "updated_ticket_cc": "", "email_box_type": null, "email_box_host": "", "email_box_port": null, "email_box_ssl": false, "email_box_user": "", "email_box_pass": "", "email_box_imap_folder": "", "email_box_local_dir": "", "permission_name": "helpdesk.queue_access_DH", "email_box_interval": 5, "email_box_last_check": null, "socks_proxy_type": null, "socks_proxy_host": null, "socks_proxy_port": null, "logging_type": null, "logging_dir": "", "default_owner": null}},
{"model": "helpdesk.queue", "pk": 2, "fields": {"title": "Some Product", "slug": "SP", "email_address": "sp-help@example.com", "locale": "en-US", "allow_public_submission": true, "allow_email_submission": true, "escalate_days": null, "new_ticket_cc": "", "updated_ticket_cc": "", "email_box_type": null, "email_box_host": "", "email_box_port": null, "email_box_ssl": false, "email_box_user": "", "email_box_pass": "", "email_box_imap_folder": "", "email_box_local_dir": "", "permission_name": "helpdesk.queue_access_SP", "email_box_interval": 5, "email_box_last_check": null, "socks_proxy_type": null, "socks_proxy_host": null, "socks_proxy_port": null, "logging_type": null, "logging_dir": "", "default_owner": null}},
{"model": "helpdesk.ticket", "pk": 1, "fields": {"title": "Some django-helpdesk Problem", "queue": 1, "created": "2017-03-20T04:52:18.321Z", "modified": "2017-03-20T04:52:18.561Z", "submitter_email": "helpdesk@example.com", "assigned_to": null, "status": 1, "on_hold": false, "description": "I'm having some problem with django-helpdesk that I need help with.", "resolution": null, "priority": 3, "due_date": "2017-03-04T00:00:00Z", "last_escalation": null}},
{"model": "helpdesk.followup", "pk": 1, "fields": {"ticket": 1, "date": "2017-03-20T04:52:18.561Z", "title": "Ticket Opened", "comment": "I'm having some problem with django-helpdesk that I need help with.", "public": true, "user": 1, "new_status": null}},
{"model": "helpdesk.ticket", "pk": 2, "fields": {"title": "Something else", "queue": 2, "created": "2017-03-20T04:54:53.001Z", "modified": "2017-03-20T04:54:53.031Z", "submitter_email": "helpdesk@example.com", "assigned_to": null, "status": 1, "on_hold": false, "description": "Something else with some other product. Not a big deal.", "resolution": null, "priority": 4, "due_date": "2017-03-01T00:00:00Z", "last_escalation": null}},
{"model": "helpdesk.followup", "pk": 2, "fields": {"ticket": 2, "date": "2017-03-20T04:54:53.031Z", "title": "Ticket Opened", "comment": "Something else with some other product. Not a big deal.", "public": true, "user": 1, "new_status": null}},
{"model": "helpdesk.ticket", "pk": 3, "fields": {"title": "Something with an attachment", "queue": 1, "created": "2017-03-20T05:14:36.320Z", "modified": "2017-03-20T05:28:28.695Z", "submitter_email": "helpdesk@example.com", "assigned_to": null, "status": 1, "on_hold": false, "description": "WHOA!", "resolution": null, "priority": 1, "due_date": null, "last_escalation": null}},
{"model": "helpdesk.followup", "pk": 3, "fields": {"ticket": 3, "date": "2017-03-20T05:14:36.345Z", "title": "Ticket Opened", "comment": "WHOA!", "public": true, "user": 1, "new_status": null}},
{"model": "helpdesk.attachment", "pk": 1, "fields": {"followup": 3, "file": "helpdesk/attachments/DH-3/3/someinfo.txt", "filename": "someinfo.txt", "mime_type": "text/plain", "size": 56}},
{"model": "helpdesk.followup", "pk": 4, "fields": {"ticket": 3, "date": "2017-03-20T05:28:28.458Z", "title": "Comment", "comment": "An image attachment goes here!", "public": true, "user": 1, "new_status": null}},
{"model": "helpdesk.attachment", "pk": 2, "fields": {"followup": 4, "file": "helpdesk/attachments/DH-3/4/helpdesk.png", "filename": "helpdesk.png", "mime_type": "image/png", "size": 30229}}
]

25
demo/demodesk/manage.py Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demodesk.config.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,3 @@
Here's a report about a bug.
Some stuff would go here.

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

51
demo/setup.py Normal file
View File

@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
"""Python packaging."""
from __future__ import unicode_literals
from setuptools import setup
import os
here = os.path.abspath(os.path.dirname(__file__))
project_root = os.path.dirname(here)
NAME = 'django-helpdesk-demodesk'
DESCRIPTION = 'A demo Django project using django-helpdesk'
README = open(os.path.join(here, 'README.rst')).read()
VERSION = '0.2.0'
#VERSION = open(os.path.join(project_root, 'VERSION')).read().strip()
AUTHOR = 'django-helpdesk team'
URL = 'https://github.com/django-helpdesk/django-helpdesk'
CLASSIFIERS = ['Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Framework :: Django']
KEYWORDS = []
PACKAGES = ['demodesk']
REQUIREMENTS = [
'django-helpdesk'
]
ENTRY_POINTS = {
'console_scripts': ['demodesk = demodesk.manage:main']
}
if __name__ == '__main__': # Don't run setup() when we import this module.
setup(name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=README,
classifiers=CLASSIFIERS,
keywords=' '.join(KEYWORDS),
author=AUTHOR,
url=URL,
license='BSD',
packages=PACKAGES,
include_package_data=True,
zip_safe=False,
install_requires=REQUIREMENTS,
entry_points=ENTRY_POINTS)

View File

@ -29,6 +29,10 @@ Download, extract, and drop ``helpdesk`` into your ``PYTHONPATH``
Adding To Your Django Project
-----------------------------
If you're on a brand new Django installation, make sure you do a ``migrate``
**before** adding ``helpdesk`` to your ``INSTALLED_APPS``. This will avoid
errors with trying to create User settings.
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 = (
@ -115,3 +119,46 @@ Adding To Your Django Project
Also, be aware that if a disk error occurs and the local file is not deleted, the mail may be processed multiple times and generate duplicate tickets until the file is removed. It is recommended to monitor log files for ERRORS when a file is unable to be deleted.
Upgrading from previous versions
--------------------------------
If you are upgrading from a previous version of django-helpdesk that used
migrations, get an up to date version of the code base (eg by using
`git pull` or `pip install --upgrade django-helpdesk`) then migrate the database::
python manage.py migrate helpdesk --db-dry-run # DB untouched
python manage.py migrate helpdesk
Lastly, restart your web server software (eg Apache) or FastCGI instance, to
ensure the latest changes are in use.
Unfortunately we are unable to assist if you are upgrading from a
version of django-helpdesk prior to migrations (ie pre-2011).
You can continue to the 'Initial Configuration' area, if needed.
Notes on database backends
--------------------------
**NOTE REGARDING SQLITE AND SEARCHING:**
If you use sqlite as your database, the search function will not work as
effectively as it will with other databases due to its inability to do
case-insensitive searches. It's recommended that you use PostgreSQL or MySQL
if possible. For more information, see this note in the Django documentation:
http://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching
When you try to do a keyword search using sqlite, a message will be displayed
to alert you to this shortcoming. There is no way around it, sorry.
**NOTE REGARDING MySQL:**
If you use MySQL, with most default configurations you will receive an error
when creating the database tables as we populate a number of default templates
in languages other than English.
You must create the database the holds the django-helpdesk tables using the
UTF-8 collation; see the MySQL manual for more information:
http://dev.mysql.com/doc/refman/5.1/en/charset-database.html
If you do NOT do this step, and you only want to use English-language templates,
you can continue however you will receive a warning when running the 'migrate'
commands.

View File

@ -130,3 +130,212 @@ License for jqPlot
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License for StartBootstrap SB Admin v2.0 theme
----------------------------------------------
::
The MIT License (MIT)
Copyright (c) 2013-2016 Blackrock Digital LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License for Raphael
-------------------
::
The MIT License
Copyright (c) 2008-2010 Dmitry Baranovskiy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License for Morris.js
---------------------
::
Copyright (c) 2013, Olly Smith
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License for DataTables
----------------------
::
Copyright (C) 2008-2016, SpryMedia Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License for Flot
----------------
::
Copyright (c) 2007-2014 IOLA and Ole Laursen
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
License for Metis Menu
----------------------
::
Copyright (C) 2016, Osman Nuri Okumuş
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License for Bootstrap CSS
-------------------------
::
Copyright (c) 2011-2016 Twitter, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License for Font Awesome
------------------------
::
Font License
Applies to all desktop and webfont files in the following directory:
font-awesome/fonts/.
License: SIL OFL 1.1
URL: http://scripts.sil.org/OFL
Code License
Applies to all CSS and LESS files in the following directories:
font-awesome/css/, font-awesome/less/, and font-awesome/scss/.
License: MIT License
URL: http://opensource.org/licenses/mit-license.html
Documentation License
Applies to all Font Awesome project files that are not a part of the Font or
Code licenses.
License: CC BY 3.0
URL: http://creativecommons.org/licenses/by/3.0/
Brand Icons
All brand icons are trademarks of their respective owners.
The use of these trademarks does not indicate endorsement of the trademark
holder by Font Awesome, nor vice versa.
Brand icons should only be used to represent the company or product to which
they refer.

View File

@ -1,15 +1,7 @@
Settings
========
First, django-helpdesk needs ``django.core.context_processors.request`` activated, so you must add it to the ``settings.py``. For Django 1.7, add::
from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = (
global_settings.TEMPLATE_CONTEXT_PROCESSORS +
('django.core.context_processors.request',)
)
For Django 1.8 and onwards, the settings are located in the ``TEMPLATES``, and the ``request`` module has moved. Add the following instead::
First, django-helpdesk needs ``django.core.context_processors.request`` activated, so you must add it to the ``settings.py``. Add the following::
TEMPLATES = [
{

View File

@ -126,16 +126,24 @@ setup(
description="Django-powered ticket tracker for your helpdesk",
long_description=LONG_DESCRIPTION,
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Framework :: Django",
"Framework :: Django :: 1.8",
"Framework :: Django :: 1.9",
"Framework :: Django :: 1.10",
"Environment :: Web Environment",
"Operating System :: OS Independent",
"Intended Audience :: Customer Service",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Topic :: Office/Business",
"Topic :: Software Development :: Bug Tracking",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Office/Business",
"Natural Language :: English",
],
keywords=['django', 'helpdesk', 'django-helpdesk', 'tickets', 'incidents',
'cases', 'bugs', 'track', 'support'],