标签:本地 listen forms stand sch boa contents span python
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
参考 大专栏 如何安装及使用honmaple社区程序 · honmaple‘s blog · 风落花语风落天,花落风雨花落田.i-standalone/">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
如何安装及使用honmaple社区程序 · honmaple‘s blog · 风落花语风落天,花落风雨花落田.
标签:本地 listen forms stand sch boa contents span python
原文地址:https://www.cnblogs.com/lijianming180/p/12239724.html