Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A view decorator to keep url specifications in

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 inlineurls
Octocat-spinner-32 .hgignore

Django Inline Urls

django-inlineurls defines a decorator, view(), which define what URL a view will be accessible by. It also has options for what template to render, whether the view requires login, and any other url kwargs.

If a template is specified, you can simply return a context for it to be rendered with.


from inlineurls.decorators import view

@view('/search/(?P<query>[^/]+/') # A view with no template
def search(request, query):
    return render(request, 'search.html', {'query': query})

@view('/home/', 'home.html') # A view with a template defined. Note only the context is returned
def home(request):
    return {'date': now()}

@view('/dashboard/', 'dashboard.html', True) # A login_required view
def home(request):
    return {'user': request.user}
Something went wrong with that request. Please try again.