File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change 10
10
# add these directories to sys.path here. If the directory is relative to the
11
11
# documentation root, use os.path.abspath to make it absolute, like shown here.
12
12
#
13
- import os
14
- import sys
15
- import json
16
- import django
17
-
18
- from pathlib import Path
19
13
14
+ import os
20
15
import recommonmark # noqa: F401
21
16
from recommonmark .transform import AutoStructify
22
17
23
18
os .environ ['USE_CHROME' ] = 'False'
24
19
25
- ROOT_DIR = os .path .abspath (os .path .join (os .path .dirname (os .path .abspath (__file__ )), '..' ))
26
- PACKAGE_DIR = os .path .join (ROOT_DIR , 'archivebox' )
27
-
28
- os .chdir (ROOT_DIR )
20
+ import archivebox
21
+ from archivebox .config .legacy import setup_django
29
22
30
- sys .path .insert (0 , os .path .abspath ('.' ))
31
- sys .path .insert (0 , os .path .abspath ('..' ))
32
- sys .path .insert (0 , PACKAGE_DIR )
33
- os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "core.settings" )
34
- django .setup ()
23
+ setup_django ()
35
24
36
- VERSION = json . loads (( Path ( ROOT_DIR ) / 'package.json' ). read_text (). strip ())[ 'version' ]
25
+ VERSION = archivebox . VERSION
37
26
38
27
# -- Project information -----------------------------------------------------
39
28
You can’t perform that action at this time.
0 commit comments