Django体能测试成绩管理平台之xadmin安装
安装xadmin
pip install -i https://pypi.douban.com/simple xadmin
下面都库也需要安装一下
django-crispy-forms>=1.6.0
django-import-export>=0.5.1
django-reversion>=2.0.0
django-formtools==2.1
future==0.15.2
httplib2==0.9.2
six==1.10.0
配置一下url和settings
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#'CheckOracleApp',
#'bootstrapform',
'xadmin',
'crispy_forms',
'reversion',
]
url
# -*- coding: utf-8 -*-
# from django.conf.urls import include, url
from django.urls import include, path
# Uncomment the next two lines to enable the admin:
import xadmin
xadmin.autodiscover()
# version模块自动注册需要版本控制的 Model
from xadmin.plugins import xversion
xversion.register_models()
from django.contrib import admin
urlpatterns = [
path(r'', xadmin.site.urls)
]
创建一个超级用户
python manage.py createsuperuser
重启一下uwsgi
systemctl restart uwsgi
完成,运行效果
切换到中文模式
是不是看着英文是在不爽,好吧,咱们就替换为中文。
还是在settings.py 文件中,加入如下代码
LANGUAGE_CODE = 'zh-CN'
TIME_ZONE = 'Asia/Shanghai'