weijiang1994 / Blogin

A blog system depend on flask.使用flask框架开发的个人博客系统.
https://2dogz.cn
GNU General Public License v3.0
509 stars 99 forks source link

初始化数据库命令失败 #44

Closed zw1765 closed 3 weeks ago

zw1765 commented 1 year ago

(venv) (base) zw@DESKTOP-TIVUPRV:~/code/Blogin$ flask initdb Usage: flask [OPTIONS] COMMAND [ARGS]... Try 'flask --help' for help.

Error: No such command 'initdb'.

zw1765 commented 1 year ago

我已经安装了python-dotenv pip show python-dotenv Name: python-dotenv Version: 0.14.0

weijiang1994 commented 1 year ago

输入flask --help看看输出啥

zw1765 commented 1 year ago

File "/home/zw/Downloads/yes/lib/python3.10/site-packages/flask/cli.py", line 240, in locate_app import(module_name) File "/home/zw/code/Blogin/blogin/init.py", line 32, in from blogin.blueprint.front.rss import rss_bp File "/home/zw/code/Blogin/blogin/blueprint/front/rss.py", line 9, in from feedgen.feed import FeedGenerator File "/home/zw/Downloads/yes/lib/python3.10/site-packages/feedgen/feed.py", line 17, in from lxml import etree # nosec - not using this for parsing ImportError: /home/zw/Downloads/yes/lib/python3.10/site-packages/lxml/etree.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/zw/Downloads/yes/lib/python3.10/site-packages/flask/cli.py", line 556, in list_commands rv.update(info.load_app().cli.list_commands(ctx)) File "/home/zw/Downloads/yes/lib/python3.10/site-packages/flask/cli.py", line 388, in load_app app = locate_app(self, import_name, name) File "/home/zw/Downloads/yes/lib/python3.10/site-packages/flask/cli.py", line 245, in locate_app raise NoAppException( flask.cli.NoAppException: While importing "blogin", an ImportError was raised:

Traceback (most recent call last): File "/home/zw/Downloads/yes/lib/python3.10/site-packages/flask/cli.py", line 240, in locate_app import(module_name) File "/home/zw/code/Blogin/blogin/init.py", line 32, in from blogin.blueprint.front.rss import rss_bp File "/home/zw/code/Blogin/blogin/blueprint/front/rss.py", line 9, in from feedgen.feed import FeedGenerator File "/home/zw/Downloads/yes/lib/python3.10/site-packages/feedgen/feed.py", line 17, in from lxml import etree # nosec - not using this for parsing ImportError: /home/zw/Downloads/yes/lib/python3.10/site-packages/lxml/etree.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send

Usage: flask [OPTIONS] COMMAND [ARGS]...

A general utility script for Flask applications.

Provides commands from Flask, extensions, and the application. Loads the application defined in the FLASK_APP environment variable, or from a wsgi.py file. Setting the FLASK_ENV environment variable to 'development' will enable debug mode.

$ export FLASK_APP=hello.py
$ export FLASK_ENV=development
$ flask run

Options: --version Show the flask version --help Show this message and exit.

Commands: db Perform database migrations. routes Show the routes for the app. run Run a development server. shell Run a shell in the app context.

weijiang1994 commented 1 year ago

ImportError: /home/zw/Downloads/yes/lib/python3.10/site-packages/lxml/etree.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send 这里有问题

weijiang1994 commented 1 year ago

你升级一下feedgen这个的版本试试

zw1765 commented 1 year ago

上面的问题解决了,是我的python版本过高的问题。 现在我完成了上面的步骤,出现了登录界面打不开

zw1765 commented 1 year ago
weijiang1994 commented 1 year ago

redis配置不对

zw1765 commented 1 year ago

需要在哪里设置redis账号密码呢

weijiang1994 commented 1 year ago

你看ban_ip = rd.get(str(remote_ip))这句代码的rd在哪里定义的,就在那里配置。

zw1765 commented 1 year ago

好的,感谢指导

zw1765 commented 1 year ago

后台管理,怎么打开呀。我登录了管理员用户,找不到新建博客等内容

jingk-1992 commented 6 months ago

老铁找到了吗,我也没找到