mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Revised program setup routine to work within the constrains of the
docker setup.
This commit is contained in:
25
configure
vendored
Executable file
25
configure
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
from django.core.management.utils import get_random_secret_key
|
||||
|
||||
def load_config():
|
||||
with open('config.json',"r") as file:
|
||||
config = json.load(file)
|
||||
file.close()
|
||||
return config
|
||||
|
||||
def write_config(config):
|
||||
with open('config.json',"w") as file:
|
||||
json.dump(config, file)
|
||||
file.close()
|
||||
|
||||
def set_secret(config=load_config()):
|
||||
if config["SECRET"] == "":
|
||||
config["SECRET"] = get_random_secret_key()
|
||||
write_config(config)
|
||||
print(config["SECRET"])
|
||||
else:
|
||||
print(config["SECRET"])
|
||||
|
||||
set_secret()
|
||||
Reference in New Issue
Block a user