Follow DeepSource reccommendations

Nolonger binding to the address, by default it is always localhost
This commit is contained in:
Michał Gdula 2023-04-02 23:20:34 +00:00
parent 6f759bb678
commit 36a7f83db6
7 changed files with 15 additions and 22 deletions

15
run.py
View file

@ -24,19 +24,14 @@ Configuration()
if DEBUG:
from gallery import create_app
# If no address is specified, use localhost
if not ADDRESS:
ADDRESS = 'localhost'
create_app().run(host=ADDRESS, port=PORT, debug=True, threaded=True)
else:
from setup.runner import OnlyLegs # pylint: disable=C0412
# If no address is specified, bind the server to all interfaces
if not ADDRESS:
ADDRESS = '0.0.0.0'
import sys
# Stop Gunicorn from reading the command line arguments as it causes errors
sys.argv = [sys.argv[0]]
options = {
'bind': f'{ADDRESS}:{PORT}',
'workers': WORKERS,