Fixing an issue you couldn't create a configuration because one did not yet exist.
This commit is contained in:
parent
2856d13a4e
commit
eadfaaeed0
@ -62,8 +62,3 @@ def configure_hook(app):
|
||||
response.status_code = 403
|
||||
return response
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
24
lemur/default.conf.py
Normal file
24
lemur/default.conf.py
Normal file
@ -0,0 +1,24 @@
|
||||
# This is just Python which means you can inherit and tweak settings
|
||||
|
||||
import os
|
||||
_basedir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
ADMINS = frozenset([''])
|
||||
|
||||
THREADS_PER_PAGE = 8
|
||||
|
||||
#############
|
||||
## General ##
|
||||
#############
|
||||
|
||||
# These will need to be set to `True` if you are developing locally
|
||||
CORS = False
|
||||
debug = False
|
||||
|
||||
#############
|
||||
## Logging ##
|
||||
#############
|
||||
|
||||
LOG_LEVEL = "DEBUG"
|
||||
LOG_FILE = "lemur.log"
|
||||
|
@ -88,11 +88,11 @@ def configure_app(app, config=None):
|
||||
except RuntimeError:
|
||||
if config and config != 'None':
|
||||
app.config.from_object(from_file(config))
|
||||
else:
|
||||
elif os.path.isfile(os.path.expanduser("~/.lemur/lemur.conf.py")):
|
||||
app.config.from_object(from_file(os.path.expanduser("~/.lemur/lemur.conf.py")))
|
||||
else:
|
||||
app.config.from_object(from_file(os.path.join(os.getcwd(), 'default.conf.py')))
|
||||
|
||||
if not app.config.get('LEMUR_ENCRYPTION_KEY'):
|
||||
raise NoEncryptionKeyFound
|
||||
|
||||
|
||||
def configure_extensions(app):
|
||||
|
@ -495,7 +495,7 @@ def create_config(config_path=None):
|
||||
sys.stdout.write("Created a new configuration file {0}\n".format(config_path))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
manager.add_command("start", LemurServer())
|
||||
manager.add_command("runserver", Server(host='127.0.0.1'))
|
||||
manager.add_command("clean", Clean())
|
||||
@ -506,3 +506,7 @@ if __name__ == "__main__":
|
||||
manager.add_command('create_role', CreateRole())
|
||||
manager.add_command("sync", Sync())
|
||||
manager.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user