Skip to main content

A Django app to service.

Project description

Service is a Django app. For each question,

Detailed documentation is in the “docs” directory.

Quick start

  1. Add “service” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'service.apps.ServiceConfig',
    ]
  2. Include the service URLconf in your project urls.py like this:

    path('api/', include(service.urls)),
  3. Add the following configuration to settings:

    # Name and description of the application
    SERVICE_APP_ID = 'test'
    SERVICE_APP_NAME = 'Testing service'
    SERVICE_APP_DESCRIBE = 'Testing service for reference only.'
    
    # The protocol, address, and port of the service
    SERVICE_API_PROTOCOL = ['http']
    SERVICE_API_IP = '192.168.X.X'
    SERVICE_API_PORT = '80'
    
    # Default service name, request method
    SERVICE_DEFAULT_SERVICE = 'test'
    SERVICE_DEFAULT_METHODS = ['GET', 'POST', 'PUT', 'DELETE']
  4. Add register decorator to an API class view or function:

    @register('demo', ['/api/demo'], methods=['GET'], hans='demo')
    def demo(request):
        return ''
  5. Visit http://127.0.0.1:8000/api/endpoint.

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

ubox-service-0.2.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file ubox-service-0.2.tar.gz.

File metadata

  • Download URL: ubox-service-0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8

File hashes

Hashes for ubox-service-0.2.tar.gz
Algorithm Hash digest
SHA256 34aa8f21ab1de7c7cb5eca38a914379c8cf50f7e3668e6b414bea34b04e11ca6
MD5 d0c1f15e159d343a9e3facdbc120c600
BLAKE2b-256 d257d1315ea5348c97c5677be30b9f8b8e163d5269732f56aa52c753ff440149

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