Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Flask-Style URL Patterns for Django

Project Description

Flask-Style URL Patterns for Django


pip install django-fsu


In change your regex patterns to flask-styled paths.

from django.conf.urls import include
from django_fsu import url

from . import views

urlpatterns = [
    url('login', views.login),
    url('user/<username>', views.profile),
    url('article/<int:pk>', views.article),
    url('projects/', include('projects.urls'),

Variable parts in the route can be specified with angular brackets (user/<username>). By default a variable part in the URL accepts a string without a slash however a different format code can be specified as well by using <code:name>.

Variable parts are passed to the view function as keyword arguments. In the above example, views.profile will be passed with a keyword argument: username.

Currently supported formats codes are:

  • string (the default, accepts string without a slash)
  • int
  • float
  • uuid
  • path (accepts any string)

Please note that int and float variables are still passed to the view function as a string.

To see how individual functions work, see the docstrings or type help('django_fsu') in the interactive prompt.

Credits to:

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.5 kB) Copy SHA256 Hash SHA256
Source None Jun 6, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting