Skip to main content

Simply build a powerful JSON-REST-API with django

Project description


djsonREST provides simple powerful features to implement your own REST-API (data encoded as json) within minutes.

The routes are versioned by default.

It also includes an addon for authentication using JWTs using consumers and users.

Base Structure of a rest route url: your_path/ + VersionMajor.Minor + /endpoint_url


Use the python package manager pip to install djsonrest.

pip install djsonrest




Add djsonrest to the end of INSTALLED_APPS.


Add a path for the api endpoints to your's urlpatterns.

from djsonrest.urls import urlpatterns as rest_urlpatterns

urlpatterns = [
    path('api/', include(rest_urlpatterns)),

Define your own rest route using the route decorator @rest.route(...).

from djsonrest import rest

class Users(rest.RESTRouteGroup):
    @rest.route('/users', version=1.0, method='GET')
    def users_get(self, request, *args, **kwargs):
        return [...] # Return any json-encodable object

Using routes defined as classmethods, you can override them in inherited classes. This way you can provide extendable routes. To override the existing route, keep the route decorator the same. Change the route decorator if you want to add a second route.

class MyUsers(Users):
    @rest.route('/users', version=1.0, method='GET')
    def users_get(self, request, *args, **kwargs):
        result = super().users_get(request, *args, **kwargs)
        return result

class MyUsersV2(Users):
    @rest.route('/users', version=2.0, method='GET')
    def users_get(self, request, *args, **kwargs):
        result = super().users_get(request, *args, **kwargs)
        return {"users": result}




This package is maintained by Manuel Stingl. For more information see

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

djsonREST-0.1.1.tar.gz (7.2 kB view hashes)

Uploaded source

Built Distribution

djsonREST-0.1.1-py3-none-any.whl (22.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page