diff options
Diffstat (limited to 'flywheel/utils.py')
| -rw-r--r-- | flywheel/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/flywheel/utils.py b/flywheel/utils.py index 98d8e1ae..c0386871 100644 --- a/flywheel/utils.py +++ b/flywheel/utils.py @@ -2,11 +2,21 @@ import re import xml.etree.ElementTree as ET from django.utils.encoding import smart_unicode from django.utils.xmlutils import SimplerXMLGenerator +from django.core.urlresolvers import resolve try: import cStringIO as StringIO except ImportError: import StringIO + +def url_resolves(url): + """Return True if the given URL is mapped to a view in the urlconf, False otherwise.""" + try: + resolve(url) + except: + return False + return True + # From piston def coerce_put_post(request): """ |
