Wagtail安装使用

Python · 2024-05-18

版本要求

django>=5.0
wagtail>=6.1
python>=3.10

基础设置

Install Python3

yum install python3
pip3 install --upgrade pip
python3 --version
pip3 --version
# 切换清华源
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

# 其他用户安装python包
chmod -R 777 /usr/local/lib/python3.6/site-packages/

Upgrade Sqlite3

yum install gcc wget -y

wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz

tar -zxvf sqlite-autoconf-3450300.tar.gz
cd sqlite-autoconf-3450300
./configure --prefix=/usr/local
make && make install

mv /usr/bin/sqlite3  /usr/bin/sqlite3_old
ln -s /usr/local/bin/sqlite3   /usr/bin/sqlite3

su - www

vim ~/.bashrc
export LD_LIBRARY_PATH="/usr/local/lib"  # 追加
source ~/.bashrc

BTPanel下SQLite3版本不对

cd /www/server/pyporject_evn/blog_venv/
./bin/pip install pysqlite3
./bin/pip install pysqlite3-binary

cd lib/python3.6/site-packages/django/db/backends/sqlite3/

修改base.py

vim base.py
#from sqlite3 import dbapi2 as Database
from pysqlite3 import dbapi2 as Database

安装Wagtail

pip3 install wagtail

wagtail start blog

cd blog

pip3 install -r requirements.txt

python3 manage.py migrate
python3 manage.py createsuperuser

测试运行

python3 manage.py runserver
Python Django Wagtail
Theme Jasmine by Kent Liao