reshape the folder structure. Add conf files
22
README.rst
|
@ -8,3 +8,25 @@ Budget-manager
|
|||
This is a really tiny app to ease the shared houses budget management. Keep
|
||||
track of who bought what, when, and for who to then compute the balance of each
|
||||
person.
|
||||
|
||||
Make it run!
|
||||
============
|
||||
|
||||
To make it run, you just have to do something like::
|
||||
|
||||
$ virtualenv venv
|
||||
$ source budget/bin/activate
|
||||
$ pip install flask flask-wtf flask-sqlalchemy
|
||||
$ cd budget
|
||||
$ python budget.py
|
||||
|
||||
Deploy it
|
||||
=========
|
||||
|
||||
To deploy it, I'm using gunicorn and supervisord::
|
||||
|
||||
1. Add the lines in conf/supervisord.conf to your supervisord.conf file.
|
||||
**adapt them to your paths!**
|
||||
2. Copy and paste the content of conf/nginx.conf in your nginx conf file.
|
||||
**adapt them to your paths!**
|
||||
3. reload both nginx and supervisord. It should be working ;)
|
||||
|
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 691 B |
Before Width: | Height: | Size: 741 B After Width: | Height: | Size: 741 B |
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 195 B |
7
conf/gunicorn.conf.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
backlog = 2048
|
||||
daemon = False
|
||||
debug = True
|
||||
workers = 3
|
||||
logfile = "/usr/local/www/notmyidea.org/fractals/fractals.gunicorn.log"
|
||||
loglevel = "info"
|
||||
bind = "unix:/usr/local/www/notmyidea.org/fractals/fractals.gunicorn.sock"
|
28
conf/nginx.conf
Normal file
|
@ -0,0 +1,28 @@
|
|||
server {
|
||||
server_name yourur;
|
||||
keepalive_timeout 5;
|
||||
|
||||
location /static/ {
|
||||
alias /path/to/app/budget/static/;
|
||||
}
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_send_timeout 180;
|
||||
proxy_read_timeout 180;
|
||||
proxy_buffer_size 16k;
|
||||
proxy_buffers 8 16k;
|
||||
proxy_busy_buffers_size 32k;
|
||||
proxy_intercept_errors on;
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://fractals_backend;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
upstream fractals_backend {
|
||||
server unix:/path/to/app/budget.gunicorn.sock;
|
||||
}
|
7
conf/supervisord.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
[program:fractals]
|
||||
command=/usr/local/www/notmyidea.org/fractals/venv/bin/gunicorn -c /usr/local/www/notmyidea.org/fractals/gunicorn.conf.py budget:app
|
||||
directory=/usr/local/www/notmyidea.org/fractals/budget/
|
||||
user=www
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=True
|