Skip to main content

A flask-style decorator for Django views

Project description

Djecorator

Write Django routes in the same style as Flask.

Installation

pip install djecorator

Usage

views.py

from django.shortcuts import render
from djecorator import Route

route = Route()

@route("/")
def index(request):
    return render(request, "index.html")

urls.py

import views

urlpatterns = [
    ...
]

urlpatterns += views.route.patterns

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

djecorator-1.0.3.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

djecorator-1.0.3-py2.py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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