Skip to main content

No project description provided

Project description

django-urlman

URL manager for Django

Django is powerful, we want it to be as simple as possible without sacrificing flexibility.

Usage

Assume the django project is named 'mysite', in the project's url-config file (mysite/urls.py):

from django_urlman import mount

urlpatterns = [
    # original django urls
    path('polls/', include('polls.urls')),
    path('admin/', admin.site.urls),

    # django-urlman aware apps
    * mount('mysite', # main project name 
       {
        'app1': 'app1/', # mount app1 at anchor 'app1/'
        'app2': 'app2/', # mount app2 at anchor 'app2/'
       }),
]

In app1 module:

from django_urlman import url

@url
def hi(_):
    return HttpResponse('Hello World')

Then the api endpoint "app1/hi" should return "Hello World".

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-urlman-0.2.0.tar.gz (2.6 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