diff --git a/docs/conf.py b/docs/conf.py
index 49e70fa..d12cb44 100644
a
|
b
|
|
13 | 13 | |
14 | 14 | from __future__ import unicode_literals |
15 | 15 | |
| 16 | import re |
16 | 17 | import sys |
17 | 18 | from os.path import abspath, dirname, join |
18 | 19 | |
… |
… |
copyright = 'Django Software Foundation and contributors'
|
58 | 59 | version = '1.7' |
59 | 60 | # The full version, including alpha/beta/rc tags. |
60 | 61 | try: |
61 | | from django import VERSION, get_version |
| 62 | from django import get_version |
62 | 63 | except ImportError: |
63 | 64 | release = version |
64 | 65 | else: |
65 | 66 | def django_release(): |
| 67 | VERSION = () |
| 68 | path = join(dirname(dirname(__file__)), 'django', '__init__.py') |
| 69 | with open(path) as f: |
| 70 | for line in f: |
| 71 | if line.startswith('VERSION'): |
| 72 | VERSION = eval(re.findall(r'\(.*\)', line)[0]) |
| 73 | break |
| 74 | |
66 | 75 | pep386ver = get_version() |
67 | | if VERSION[3:5] == ('alpha', 0) and 'dev' not in pep386ver: |
| 76 | if VERSION and VERSION[3:5] == ('alpha', 0) and 'dev' not in pep386ver: |
68 | 77 | return pep386ver + '.dev' |
69 | 78 | return pep386ver |
70 | 79 | |