Skip to main content

URL decorator for django views

Project description

What is django_urls?

It is flask style urls for django.

How to use it?

# app/urls.py or where-ever you want really.
from django_urls import UrlManager
app_urls = UrlManager(views_root='dotted.path.to.app.views.module')
# app/views/foo.py

from app.urls import app_urls

@app_urls.path('path/', name='MyView')
class MyView(View):
    ...
    
@app_urls.re_path('path2/', name='my_view')
def my_view(request):
    ...    
# project/urls.py
from django.urls import include, path
from app.urls import app_urls

url_patterns = [
    path('some_path/', include(app_urls.url_patterns))
]

That's it, not too much setup, right?

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_urls-1.0.0.tar.gz (1.9 kB view hashes)

Uploaded Source

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