Configuration
- Add
issues
to yourINSTALLED_APPS
in yoursettings.py
file:
- Include the
django-online-issues
URLs in your mainurls.py
file:
# urls.py
from django.urls import path, include
urlpatterns = [
# ...
path("ticketing/", include("issues.urls", namespace="issues")),
]
You can now access the ticket creation form at `/ticketing/issue/create/`.
- Configure the backend in your
settings.py
. By default, tickets are printed to the console. To use a different backend, like GitLab, define theISSUES
configuration:
# settings.py
ISSUES = {
"BACKEND": "issues.backends.gitlab.Backend",
"RENDERER": "html2canvas-pro",
"OPTIONS": {
"API_TOKEN": "your_gitlab_private_access_token",
"PROJECT": "your_project_id_or_path",
},
"ANNOTATIONS": {
"get_client_ip": "issues.utils.get_client_ip",
"get_extra_info": "issues.utils.get_extra_info",
"get_labels": "issues.utils.get_labels",
"get_user": "issues.utils.get_user",
"get_user_agent": "issues.utils.get_user_agent",
"get_version": "issues.utils.get_version",
}
}
Important: Avoid hardcoding sensitive information like API tokens directly in your settings.py
file. Consider
using environment variables or a dedicated secrets management solution for production environments.
Screenshot Renderer
The RENDERER
option allows you to choose the JavaScript library used to capture screenshots of the web page when a user submits an issue. You can set this option within the ISSUES
dictionary in your settings.py
.
The available options are:
"html2canvas"
(Default): Uses the html2canvas library. It is the default option and is generally reliable for most use cases."dom-to-image"
: Uses the dom-to-image library. This can be a good alternative if you encounter issues withhtml2canvas
."html2canvas-pro"
: Uses the html2canvas-pro library, which is a fork ofhtml2canvas
with additional features and improvements. It can be more accurate in rendering complex CSS and layouts.None
: Disables screenshot functionality. No screenshot will be taken or included in the issue.
Example Configuration:
If the RENDERER
option is not specified, it defaults to "html2canvas"
. If you wish to disable screenshots, you must explicitly set it to None
.