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-4.1.3.tar.gz (440.1 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.1.3-py3-none-any.whl (458.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-qr-toolkit-core-4.1.3.tar.gz
  • Upload date:
  • Size: 440.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for django-qr-toolkit-core-4.1.3.tar.gz
Algorithm Hash digest
SHA256 a563c549d0560c15f2b2372f15859ae93e5ae1589f92b77ac18fde71550098b1
MD5 d669979ebd519f328176580012dde213
BLAKE2b-256 fdb8faf49f8cbcd9969b283db1a18e93b6cd797fe035633dbd3d97d0847bf131

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_qr_toolkit_core-4.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fefab70b3c52fe08a65b4b1b7488c1dfdb9f3d10ff4aaa305258b69a13bf919e
MD5 553b06c4929393fb9809be6fc4cf9e89
BLAKE2b-256 3085d87e773cb359ec70b587456487554613c966660bf647a2964e622b534a59

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