du
django-urls
pypi i django-urls
du

django-urls

URL decorators for django

by Işık Kaplan

1.1.3 (see all)License:MIT LICENSE
pypi i django-urls
Readme

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?

VersionTagPublished
1.1.3
2yrs ago
1.1.2
3yrs ago
1.1.1
3yrs ago
1.1.0
3yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate