Skip to main content

A Django app to use qr-toolkit models

Project description

QR-Toolkit Core package

Documentation

Installation

python3 -m pip install django-qr-toolkit-core

usage

  1. Add the package to INSTALLED_APPS
INSTALLED_APPS = [
    # ... your other apps
    'qrtoolkit_core'
]
  1. Add the following settings
API_URL = '/api/'  # Url to the api endpoint (change this if you are setting up api and public redirect service seperatly)
REDIRECT_SERVICE_URL = ''  # Url to the redirect service endpoint (change this if you are setting up api and public redirect service seperatly)
ENVIRONMENT = 'DV'  # Env the service is deployed in. (DV,QA,PR, etc)
  1. urls.py setup
from django.contrib import admin
from django.urls import path, include
from qrtoolkit_core import urls as qr_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include(qr_urls.api_routes)),
    path('', include(qr_urls.code_routes))
]

The code routes and api routes are split up, so that you can deploy the api and public service seperatly, and optionally deploy the api behind an api gateway. The api does not do authentication by default, but can also be configured with django-rest-framework settings.

If you include the admin urls, the qrtoolkit models will automatically appear in the admin dashboard

The following paths will be installed:

code_routes

path parameters description
<slug:short_uuid>/ slug (uuid or short_uuid of a QrCode) This is the route that will take care of routing a user (on scan)
<slug:short_uuid>.[json/html]/ same as route above This is the same route as the above route, but suffixed with .html or .json. .html will return the same as above, while .json will redirect to the API_URL setting
call/<int:pk>/ LinkUrl id This is the route which is called when the user selects a url in Kiosk mode

api_routes

path parameters description
qrcodes/ int:id This is a standard REST endpoint for QrCodes, all rest routes are included
apihits/ int:id This is a ReadOnlyViewset, meaning you can only do read operations on the ApiHit model (GET + GET with id)
departments/ int:id This is a standard REST endpoint for Departments, all rest routes are included
urls/ int:id This is a standard REST endpoint for LinkUrls, all rest routes are included
openapi/ - This route contains the generated openapi schema, with more documentation on the api

working with this repo

building the package

python ./setup.py sdist bdist_wheel

upload package

python -m twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_qr_toolkit_core-4.3.2.tar.gz (441.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_qr_toolkit_core-4.3.2-py3-none-any.whl (461.0 kB view details)

Uploaded Python 3

File details

Details for the file django_qr_toolkit_core-4.3.2.tar.gz.

File metadata

  • Download URL: django_qr_toolkit_core-4.3.2.tar.gz
  • Upload date:
  • Size: 441.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_qr_toolkit_core-4.3.2.tar.gz
Algorithm Hash digest
SHA256 c8b49a8037523478994d504310c18b25895513d99a26a7a114587ac6aac310a5
MD5 0b44b0dc377b447bc34965a789104251
BLAKE2b-256 dbc4640c44373dd5499a2243e78879c687a3c092e0c589a033e7e4ce0db78916

See more details on using hashes here.

File details

Details for the file django_qr_toolkit_core-4.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_qr_toolkit_core-4.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9b71ae6d105c74cd1163827209c9c8733caa8f0628373854a82eecebfbd90af
MD5 ab00cb8285bf1f76140eb9a5227f9fa2
BLAKE2b-256 45b4aa702c7d7106e305e0f315e871ac6e4c0ccfd542886c37c1cbea7870f954

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page