Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Timo Heikkilä
PET-rating
Commits
d2274f14
Commit
d2274f14
authored
Jun 13, 2019
by
Ossi Laine
Browse files
Updated readme
parent
2b6167a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
d2274f14
testi
\ No newline at end of file
# Online survey creation tool
### Prerequisites
Flask app with MariaDB
Check requirements.txt
### Installing
Install python packages with pip and preferably in virtual environment:
```
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
```
### Deployment
There are multiple deployment options, but one working solution is:
nginx + gunicorn (with gevent worker)
Create systemd startup script in '/etc/systemd/system/gunicorn.service'
```
[Unit]
Description=Gunicorn instance to serve flask application
After=network.target
[Service]
User=nginx
WorkingDirectory=/srv/rating
Environment="PATH=/srv/rating/venv/bin"
ExecStart=/srv/rating/venv/bin/gunicorn run:app -b localhost:8000 -k gevent -w 1
[Install]
WantedBy=multi-user.target
```
Run 'systemctl daemon-reload' to reload units.
Enable and start gunicorn service:
```
service gunicorn enable
service gunicorn start
```
### Logs
Error logs are saved to application folder (/srv/rating/logs/)
Optionally with journalctl:
journalctl -u gunicorn.service
### Restart server after updates
```
service gunicorn restart
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment