-
Notifications
You must be signed in to change notification settings - Fork 171
Home
honmaple edited this page Jul 25, 2016
·
1 revision
Welcome to the maple-bbs wiki!
pip install -r requirements.txt
查看配置详细介绍
因为如果不注释的话 初始化数据库 会报错
文件位置: maple/topic/forms.py
category = SelectField(
_('Category:'),
choices=[(b.id, b.board + ' --' + b.parent_board)
for b in Board.query.all()],
coerce=int)
python manage.py db init
python manage.py db migrate -m "first migrate"
python manage.py db upgrade
ok,将第三步中注释的内容恢复
python manager.py create_user
python manager.py runserver
Visit http://forums.localhost:5000/admin
参考 http://flask.pocoo.org/docs/0.11/deploying/
以我的配置为例:
server {
listen 80;
server_name _;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
[program:forums]
user=www
command=/home/www/forums/venv/bin/gunicorn run:app -c /home/www/forums/gunicorn.conf
directory=/home/www/forums
autostart=true
autorestart=true
stdout_logfile=/home/www/forums/logs/gunicorn_supervisor.log
workers = 2
bind = '127.0.0.1:8000'
确定配置无误后
supervisord -c /etc/supervisord.conf
supervisorctl -c /etc/supervisord.conf reload