Sfoglia il codice sorgente

print hint about heroku setup

Falko Schindler 3 anni fa
parent
commit
dc8eea5f25
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      nicegui/config.py

+ 6 - 0
nicegui/config.py

@@ -61,6 +61,12 @@ else:
         print('Could not find and pre-evaluate ui.run(). Starting interactive mode without auto-reload.', flush=True)
         config = Config(interactive=True)
 
+if os.environ.get('PYTHONHOME') == '/app/.heroku/python' and os.environ.get('WEB_CONCURRENCY') != '1':
+    print('***', flush=True)
+    print('NiceGUI seems to be running on Heroku.', flush=True)
+    print('Make sure to set WEB_CONCURRENCY=1 in your app > Settings > Config Vars.', flush=True)
+    print('***', flush=True)
+
 os.environ['HOST'] = config.host
 os.environ['PORT'] = str(config.port)
 os.environ["STATIC_DIRECTORY"] = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'static')