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

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-2.9.tar.gz (356.0 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-2.9-py3-none-any.whl (375.0 kB view details)

Uploaded Python 3

File details

Details for the file django-qr-toolkit-core-2.9.tar.gz.

File metadata

  • Download URL: django-qr-toolkit-core-2.9.tar.gz
  • Upload date:
  • Size: 356.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

File hashes

Hashes for django-qr-toolkit-core-2.9.tar.gz
Algorithm Hash digest
SHA256 14855a0cfeb8621cb6b5fa6e2c019a4aa91a28598c666c47bdeae8a0bc27f2b0
MD5 b3993c23b579cd5a3da1b1fc3a83b3dd
BLAKE2b-256 7c8952f5d3e7a514581e1a52ef72f4c385fc83e39d7e1079a96756e67097b96c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_qr_toolkit_core-2.9-py3-none-any.whl
  • Upload date:
  • Size: 375.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

File hashes

Hashes for django_qr_toolkit_core-2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bbe5c7cc72ff1e63b822e23704b9279ecf7ec81ac2a7e8e19b84cadb8d2c59c6
MD5 1179eae1f689276a925a171510d8fd6e
BLAKE2b-256 76710bb3ce99ae80d3d9239a5631cd04bcde5bc821e5bb95d6972ab3369c3ea6

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