File size: 280 Bytes
cc97dd8
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import fileinput
import sys

# Read app.py and replace the BASE_DIR line
for line in fileinput.input('app.py', inplace=True):
    if line.startswith('BASE_DIR = '):
        print('BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + "/"')
    else:
        print(line, end='')