mirror of
https://github.com/TakeusV1/flask_ipam.git
synced 2026-10-14 01:15:33 +02:00
1.5 KiB
1.5 KiB
Installation GUIDE
This documentation is very good, but needs a few changes to make it work (in our case) :
https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-22-04
Before starting the app ensure to install pip packages in requirements.txt Referrenced Section
pip install Flask-Login Flask-SQLAlchemy Flask-WTF mysql-connector-python SQLAlchemy cryptography- Update the configuration file under app/_config.py.
app_ip = '127.0.0.1'toapp_ip = '0.0.0.0'for easy web access.- Update SECRET_KEY='CHANGE_ME' variable,
openssl rand -hex 32can be used to create a random key.
- You don't need to create or continue with the
wsgi.pysection. When asked, replace:wsgi:appwith'app:create_app()'.- EX : For starting APP with gunicorn :
gunicorn --bind 0.0.0.0:5000 'app:create_app()'- For any troubleshooting, you can add
--preloadat the end of the command for verbose logging.
- For any troubleshooting, you can add
- In Service File, replace "ExecStart" line with :
ExecStart=/YOUR_ENV_LOCATION/bin/gunicorn --workers 1 --bind 0.0.0.0:5000 -m 007 'app:create_app()'
(Adjust the number of workers to your needs)
- EX : For starting APP with gunicorn :
- you must first run setup.py to create the admin user.
(it will create a second database in./var/setup-instance. It will have to be merged in the application database in./var/app-instance)