mbtronics / BAB

BUDA::lab Administrative Backend
GNU General Public License v2.0
1 stars 0 forks source link

BAB

BUDA::lab Administrative Backend

Instalation

getting the code

$ git clone https://github.com/mbtronics/BAB.git <appdir>

virtualenv

$ cd <appdir>
$ virtualenv venv
$ source venv/bin/activate

python dependencies

$ pip install -r requirements.txt

configuration

Copy env.example to .env and fill in the variables:

If you choose development for FLASK_CONFIG, you need to fill in DEV_DATABASE_URL.
If you choose production for FLASK_CONFIG, you need to fill in DATABASE_URL.

It is best to create a seperate user with it's own database.

deployment

$ ./manage.py deploy

Running

manually

$ ./manage.py runserver

nginx & ubuntu service

ubuntu service

/etc/init/flaskapp.conf (replace and make changes where necessary)

description "uWSGI server instance configured to serve flask app"

start on runlevel [2345]
stop on runlevel [!2345]

setuid www-data
setgid www-data

chdir <appdir>
exec uwsgi --ini uwsgi.ini --virtualenv <appdir>/venv

Start service:

$ service flaskapp restart

uwsgi gateway configuration

location /APP_URL_PREFIX {
    include uwsgi_params;
    uwsgi_pass unix:/tmp/flask_app.sock;
}