Created
August 27, 2012 18:14
-
-
Save ericmoritz/3491001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "relux.settings.local") | |
import inspect | |
from django.conf import settings | |
from django.core import urlresolvers | |
urlconf = settings.ROOT_URLCONF | |
urlresolvers.set_urlconf(urlconf) | |
resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) | |
url = "/" | |
callback, callback_args, callback_kwargs = resolver.resolve(url) | |
# The filename of the module that the view is defined in | |
view_filename = inspect.getsourcefile(callback) | |
print "%s:%s" % (view_filename, callback.__name__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment