Port over easyconfig from the etesync server code.
Migrated by Tom, but kept the credit to daftaupemaster
parent
9c6a7e9428
commit
5785f803ac
@ -0,0 +1,17 @@
|
||||
[global]
|
||||
secret_file = secret.txt
|
||||
debug = false
|
||||
;Advanced options, only uncomment if you know what you're doing:
|
||||
;static_root = /path/to/static
|
||||
;static_url = /static/
|
||||
;media_root = /path/to/media
|
||||
;media_url = /user-media/
|
||||
;language_code = en-us
|
||||
;time_zone = UTC
|
||||
|
||||
[allowed_hosts]
|
||||
allowed_host1 = example.com
|
||||
|
||||
[database]
|
||||
engine = django.db.backends.sqlite3
|
||||
name = db.sqlite3
|
@ -0,0 +1,25 @@
|
||||
# Copyright © 2017 Tom Hacohen
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, version 3.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.core.management import utils
|
||||
|
||||
def get_secret_from_file(path):
|
||||
try:
|
||||
with open(path, "r") as f:
|
||||
return f.read().strip()
|
||||
except EnvironmentError:
|
||||
with open(path, "w") as f:
|
||||
secret_key = utils.get_random_secret_key()
|
||||
f.write(secret_key)
|
||||
return secret_key
|
Loading…
Reference in New Issue