当前位置: 首页 > 工具软件 > Mezzanine > 使用案例 >

Mezzanine

陈志
2023-12-01

安装mezzanine

#首先准备安装pip(pip用来安装python软件包)
#用的Linux自带python2环境,所以在此安装python2的pip
yum install python2-pip -y
#(修改pip源为阿里源)在文件~/.pip/pip.conf中添加或修改:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
#
pip install mezzanine
cd /opt
#创建一个LIUlaoLiu的项目
mezzanine-project LIUlaoLiu
cd LIUlaoLiu
vim LIUlaoLiu/local_settings.py 
#修改
"ENGINE": "django.db.backends.sqlite3",
#改为
"ENGINE": "django.db.backends.mysql",
#将
"NAME": "dev.db",
改为liu(数据库的名字)
"NAME": "liu",
#修改完成之后的
DATABASES = {
    "default": {
        # Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
        "ENGINE": "django.db.backends.mysql",
        # DB name or path to database file if using sqlite3.
        "NAME": "liu",
        # Not used with sqlite3.
        "USER": "liu",
        # Not used with sqlite3.
        "PASSWORD": "123456",
        # Set to empty string for localhost. Not used with sqlite3.
        "HOST": "localhost",
        # Set to empty string for default. Not used with sqlite3.
        "PORT": "3306",
    }





 类似资料:

相关阅读

相关文章

相关问答