安装

安装前先确保你已经安装了以下程序:

  • Python 3.6+

  • pip 10+

  • git

  • libjpeg,zlib – pillow包的依赖

  • ubuntu: apt-get install libjpeg8-dev zlib1g-dev libfreetype6-dev
  • centos: yum -y install python-devel zlib-devel libjpeg-turbo-devel

另外安装之前建议配置虚拟环境

  1. python3 -m venv deeru_env
  2. source deeru_env/bin/activate
  3. # in windows, run this:
  4. # deeru_env/Scripts/activate

使用pip安装

  1. pip install deeru
  2. deeru-admin install DeerU

从git仓库安装(不推荐)

  1. git clone -b dev https://github.com/gojuukaze/DeerU.git
  2. cd DeerU
  3. pip install -r requirements.txt

从git安装需要手动创建两个文件:

  • deeru/urls_local.py ,内容如下:
  1. from django.contrib import admin
  2. from django.urls import path, include
  3.  
  4. urlpatterns = [
  5. path('admin/', admin.site.urls),
  6. path('', include('app.urls')),
  7. ]
  • deeru/settings_local.py ,内容如下:
  1. # v2版本开始需要配置
  2. SECRET_KEY = 'xxx'
  3.  
  4. DEBUG = True
  5.  
  6. ALLOWED_HOSTS = ['*']
  7.  
  8. CUSTOM_EXPRESSION = []
  9.  
  10. CUSTOM_APPS = []
  11.  
  12. CUSTOM_CONFIG_HANDLER = []

v2版本需要设置你自己的 SECRET_KEY ,可以使用命令 python manage.py gen_secret_key 生成