Read from doc url mapping file at load time, rather than once per request

This commit is contained in:
David Baumgold
2014-01-29 15:28:40 -05:00
parent b25b3e1bef
commit e7c5e62da7

View File

@@ -1,12 +1,12 @@
import ConfigParser
from django.conf import settings
config_file = open(settings.REPO_ROOT / "docs" / "config.ini")
config = ConfigParser.ConfigParser()
config.readfp(config_file)
def doc_url(request):
config_file = open(settings.REPO_ROOT / "docs" / "config.ini")
config = ConfigParser.ConfigParser()
config.readfp(config_file)
# in the future, we will detect the locale; for now, we will
# hardcode en_us, since we only have English documentation
locale = "en_us"