Skip to main content

URL decorator for django views

Project description

Build Status PyPI - License PyPI - Downloads

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_urls.extend(extra_urls_list)
# app/views/foo.py

from app.urls import app_urls

@app_urls.path('path/', name='MyView', importance=5) # the bigger the importance higher in the list it goes
class MyView(View):
    ...
    
@app_urls.re_path('path2/', name='my_view', importance=1)
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.1.4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

django_urls-1.1.4-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file django_urls-1.1.4.tar.gz.

File metadata

  • Download URL: django_urls-1.1.4.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for django_urls-1.1.4.tar.gz
Algorithm Hash digest
SHA256 0eeafed8873c8bce802d58a82ece1c33e2174af6331f2cc018a610413f44854b
MD5 50a68531b4e66f10aa8306e8c4ebf093
BLAKE2b-256 f53f8ce81b95849685ae8a5f6cf6eb5a11a6f18e3bafc2956bb38a4ff7ec8c97

See more details on using hashes here.

File details

Details for the file django_urls-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: django_urls-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for django_urls-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bf3c1785dfd53b640aac3f46054d5e423355b145bf9796105191cca12493b1a4
MD5 b7687ff6c033eb4f5019bd062e42810d
BLAKE2b-256 980efba9f97bb63524c274b9125feb6480a0e47efc111ed699c9b5b4601850bc

See more details on using hashes here.

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