snout

Django URL pattern generation via inspection
Download

snout Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Mark Neyer
  • Publisher web site:
  • https://github.com/neyer/

snout Tags


snout Description

snout is an app that provides Django URL pattern generation via inspection.WhatUse snout to generate routes for your Django apps using inspection, so you can do more interesting things.Instead of this:# breakfast/urls.pyfrom django.conf.urls import patterns, urlurlpatterns = patterns('', url(r'^$','breakfast.views.index'), url(r'^order/$''', 'breakfast.views.order'), url(r'^waffles/$''', 'breakfast.views.waffles'), url(r'^sausage/$''', 'breakfast.views.sausage'), url(r'^toast/(?P< num_slices >\d+)$''', 'breakfast.views.toast'),)Now you can do this:# breakfast/urls.pyimport viewsimport snouturlpatterns = snout.make_django_patterns(views)awww yeahHowInstall it like this:pip install snoutmake_django_patterns creates a route for all functions in the given module, except those starting with "_"underscores (_) are replaced with dashes (-) because why not?A view named "index" is given the route "^$" by defaultAny arguments to your view (other than "requests") are assigned regular expression match groups.Product's homepage


snout Related Software