Django體能測(cè)試成績(jī)管理平臺(tái)之xadmin安裝
- 《我為何又開(kāi)始用Django了(內(nèi)含安裝和配置超詳細(xì)文檔)》
- 《Django體能測(cè)試成績(jī)管理平臺(tái)之環(huán)境和服務(wù)器準(zhǔn)備》
安裝xadmin
pip install -i https://pypi.douban.com/simple xadmin
下面都庫(kù)也需要安裝一下
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模塊自動(dòng)注冊(cè)需要版本控制的 Model
from xadmin.plugins import xversion
xversion.register_models()
from django.contrib import admin
urlpatterns = [
path(r'', xadmin.site.urls)
]
創(chuàng)建一個(gè)超級(jí)用戶
python manage.py createsuperuser
重啟一下uwsgi
systemctl restart uwsgi
完成弹澎,運(yùn)行效果
切換到中文模式
是不是看著英文是在不爽叹侄,好吧礁芦,咱們就替換為中文盹舞。
還是在settings.py 文件中杂穷,加入如下代碼
LANGUAGE_CODE = 'zh-CN'
TIME_ZONE = 'Asia/Shanghai'