- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.py
More file actions
Latest commit
17 lines (14 loc) · 526 Bytes
/
Copy pathdebug.py
File metadata and controls
17 lines (14 loc) · 526 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
importsys
if__name__=='__main__':
settings=""
withopen("mysite/settings.py", 'r') asinput:
forlineininput.readlines():
l=line.strip().split("=")
ifline.split("=")[0].strip() =="DEBUG":
iflen(sys.argv) >1andsys.argv[1] =="f":
line="DEBUG = False\n"
else:
line="DEBUG = True\n"
settings+=line
withopen("mysite/settings.py", 'w') asoutput:
output.write(settings)