安装xadmin后台管理

安装xadmin后台管理

下载xadmin源码包

https://github.com/sshwsfc/xadmin
得到 xadmin-master.zip

安装xadmin-master.zip

注意:需要先加入压缩包,把README.rst用一个同名的空文件替换
(Django_login) D:\>pip install xadmin-master.zip
Processing d:\xadmin-master.zip
Requirement already satisfied: setuptools in e:\venv\django_login\lib\site-packages\setuptools-39.1.0-py3.6.egg (from xadmin==0.6.1) (39.1.0)

Requirement already satisfied: django>=1.9.0 in e:\venv\django_login\lib\site-packages (from xadmin==0.6.1) (1.11.12)
Collecting django-crispy-forms>=1.6.0 (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/9a/05/6bad05742d185ec2fabfa4deab05cafde286eb3f383fba24b3674340aca2/django_crispy_forms
-1.7.2-py2.py3-none-any.whl
Collecting django-reversion>=2.0.0 (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/df/df/8f049266fe2b1cf6e33129b0368cbf1aa55a5813300c44226190f7b7c3f8/django_reversion-3.
0.0-py2.py3-none-any.whl
Collecting django-formtools>=1.0 (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/97/3f/b8e04c41c028d5cdad651393abea1f686d846c717d8ab5d5ebe2974f711c/django_formtools-2.
1-py2.py3-none-any.whl
Collecting django-import-export>=0.5.1 (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/60/f7/0cbec58d990fa8eeab1ef6988cde79a8aab6bb5c2cf93a8d4f831992e6ab/django_import_expor
t-1.0.1-py2.py3-none-any.whl
Collecting httplib2==0.9.2 (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/ff/a9/5751cdf17a70ea89f6dde23ceb1705bfb638fd8cee00f845308bf8d26397/httplib2-0.9.2.tar.
gz
Collecting future (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.g
z
Collecting six (from xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-
none-any.whl
Requirement already satisfied: pytz in e:\venv\django_login\lib\site-packages (from django>=1.9.0->xadmin==0.6.1) (2018.5)
Collecting diff-match-patch (from django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/22/82/46eaeab04805b4fac17630b59f30c4f2c8860988bcefd730ff4f1992908b/diff-match-patch-20
121119.tar.gz
Collecting tablib (from django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/e4/9f/cba4e1145ca9ec84d9326f7ce38c6b5f37d9be8bc1af1bd8b19c20374095/tablib-0.12.1.tar.g
z
Collecting odfpy (from tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/01/0f/c9971c99d0d06024a1652f467427ff3f1a1136237e5740da715c5b208a48/odfpy-1.3.6.tar.gz
Collecting openpyxl (from tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/ef/2b/d61297ec61caddfe2935459e6c4600f37f74ebf4b794c4d28863958715bd/openpyxl-2.5.7.tar.
gz
Collecting unicodecsv (from tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/6f/a4/691ab63b17505a26096608cc309960b5a6bdf39e4ba1a793d5f9b1a53270/unicodecsv-0.14.1.t
ar.gz
Collecting xlrd (from tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/07/e6/e95c4eec6221bfd8528bcc4ea252a850bffcc4be88ebc367e23a1a84b0bb/xlrd-1.1.0-py2.py3-
none-any.whl
Collecting xlwt (from tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/44/48/def306413b25c3d01753603b1a222a011b8621aed27cd7f89cbc27e6b0f4/xlwt-1.3.0-py2.py3-
none-any.whl
Collecting pyyaml (from tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/4f/ca/5fad249c5032270540c24d2189b0ddf1396aac49b0bdc548162edcf14131/PyYAML-3.13-cp36-cp
36m-win_amd64.whl
Collecting jdcal (from openpyxl->tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/a0/38/dcf83532480f25284f3ef13f8ed63e03c58a65c9d3ba2a6a894ed9497207/jdcal-1.4-py2.py3-n
one-any.whl
Collecting et_xmlfile (from openpyxl->tablib->django-import-export>=0.5.1->xadmin==0.6.1)
  Using cached https://files.pythonhosted.org/packages/22/28/a99c42aea746e18382ad9fb36f64c1c1f04216f41797f2f0fa567da11388/et_xmlfile-1.0.1.ta
r.gz
Installing collected packages: django-crispy-forms, django-reversion, django-formtools, diff-match-patch, odfpy, jdcal, et-xmlfile, openpyxl,
 unicodecsv, xlrd, xlwt, pyyaml, tablib, django-import-export, httplib2, future, six, xadmin
  Running setup.py install for diff-match-patch ... done
  Running setup.py install for odfpy ... done
  Running setup.py install for et-xmlfile ... done
  Running setup.py install for openpyxl ... done
  Running setup.py install for unicodecsv ... done
  Running setup.py install for tablib ... done
  Running setup.py install for httplib2 ... done
  Running setup.py install for future ... done
  Running setup.py install for xadmin ... done
Successfully installed diff-match-patch-20121119 django-crispy-forms-1.7.2 django-formtools-2.1 django-import-export-1.0.1 django-reversion-3
.0.0 et-xmlfile-1.0.1 future-0.16.0 httplib2-0.9.2 jdcal-1.4 odfpy-1.3.6 openpyxl-2.5.7 pyyaml-3.13 six-1.11.0 tablib-0.12.1 unicodecsv-0.14.
1 xadmin-0.6.1 xlrd-1.1.0 xlwt-1.3.0

查看包的情况
(Django_login) D:\>pip list
Package              Version
-------------------- --------
diff-match-patch     20121119
Django               1.11.12
django-crispy-forms  1.7.2
django-formtools     2.1
django-import-export 1.0.1
django-reversion     3.0.0
et-xmlfile           1.0.1
future               0.16.0
httplib2             0.9.2
jdcal                1.4
odfpy                1.3.6
openpyxl             2.5.7
pip                  10.0.1
pytz                 2018.5
PyYAML               3.13
setuptools           39.1.0
six                  1.11.0
tablib               0.12.1
unicodecsv           0.14.1
xadmin               0.6.1
xlrd                 1.1.0
xlwt                 1.3.0

将包解压,获取里面的xadmin文件

拷贝到项目的根目录下

修改urls.py文件

from django.conf.urls import url
import xadmin

urlpatterns = [
    # url('admin/', admin.site.urls),
    url('xadmin/',xadmin.site.urls),
]

注册app

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'app_login',
    'xadmin',
    'crispy_forms'
]

数据库中创建相关表

(Django_login) D:\demo\Django_login>python manage.py makemigrations
No changes detected

(Django_login) D:\demo\Django_login>python manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions, xadmin
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying sessions.0001_initial... OK
  Applying xadmin.0001_initial... OK
  Applying xadmin.0002_log... OK
  Applying xadmin.0003_auto_20160715_0100... OK

(Django_login) D:\demo\Django_login>python manage.py createsuperuser
Username (leave blank to use 'spider'): admin
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.

登陆后台

原文地址:https://www.cnblogs.com/endmoon/p/9744723.html

时间: 2024-11-09 12:36:57

安装xadmin后台管理的相关文章

第三百八十节,Django+Xadmin打造上线标准的在线教育平台—将所有app下的models数据库表注册到xadmin后台管理

第三百八十节,Django+Xadmin打造上线标准的在线教育平台-将所有app下的models数据库表注册到xadmin后台管理 将一个app下的models数据库表注册到xadmin后台管理 重点:xadmin的数据表注册,是到app下查找的adminx文件,所以我们必须在app下创建一个adminx.py文件,所有关于数据表注册到xadmin后台的代码都是写在adminx.py文件里 adminx.py文件编写 1.自定义一个类来继承object对象,这个类叫做数据表管理器 数据表管理器里

django学习之xadmin后台管理部署

首先看下admin的后台管理界面(默认,未做任何设置) 都说xadmin很吊,吊炸天,我就拿过来撸了一把,发现事实并不是这样的,我只能说一句,最合适自己的才是最好的,还是自己撸吧,偶尔借鉴下还是可以的~ 不要太沉迷于这些框架~ 开工~ xadmin官方地址 http://xadmin.io/ xadmin github地址:https://github.com/sshwsfc/django-xadmin xadmin文档介绍:https://xadmin.readthedocs.org/en/l

Django扩展xadmin后台管理

python:3.7.2django:2.1.2 githup:https://github.com/sshwsfc/xadmin 安装xadmin django版本2.0及以上一不能使用pip install xadmin进行安装,根据作者的安装说明使用一下命令直接从githup安装 pip install git+git://github.com/sshwsfc/xadmin.git@django2 现有项目引入xadmin settings.py设置引入xadmin应用 INSTALLED

xadmin后台管理

安装 # >: pip install https://codeload.github.com/sshwsfc/xadmin/zip/django2 配置文件注册app: INSTALLED_APPS = [ # ... # xamin主体模块 'xadmin', # 渲染表格模块 'crispy_forms', # 为模型通过版本控制,可以回滚数据 'reversion', ] 完成自己数据库模型类数据库迁移 python manage.py makemigrations python man

5.3 将users表添加到xadmin后台

在users模块中添加adminx.py文件,是xadmin后台管理默认的文件名,内容是: from .models import EmailVerifyRecord, Banner import xadmin class EmailVerifyRecordAdmin(object): list_display = ('name', 'email', 'send_type', 'add_time') search_fields = ('name', 'email', 'send_type') l

Django 后台管理xadmin

一. xadmin的使用 后台管理在开发中可以给我们提供很大的便利,django自带了一个后台管理admin,不过还有一个xadmin比django自带的好用一些,功能更加强大,为模型提供了版本控制,可以回滚数据.django中权限主要靠六表实现,首先是基础的user.group.permission三表,然后分别是user与group的多对多关系表.group与permission的多对多关系表,最后django特有的user与permission的多对多关系表.django基于用户user.

JAVAEE——Solr:安装及配置、后台管理索引库、 使用SolrJ管理索引库、仿京东的电商搜索案例实现

1 学习回顾 1. Lucene  是Apache开源的全文检索的工具包 创建索引 查询索引 2. 遇到问题? 文件名 及文件内容  顺序扫描法  全文检索 3. 什么是全文检索? 这种先创建索引 再对索引进行搜索的过程叫全文检索 4. 索引是什么? 非结构数据中提取一个数据.并重新组合的过程叫索引 5. Lucene实现 6. 入门程序 磁盘文件为原始文件 创建索引 第一步:获取文件 第二步:创建文档对象 第三步:创建分析器 第四步:保存索引及文档到索引库 搜索索引 第一步:用户接口(百度)

前端后台管理模板(x-admin)和画图工具(图表展示)

X-admin提供免费的后台管理前端页面模板,节约开发时间 X-admin的使用 1.从网站http://x.xuebingsi.com/下载相应的版本 2.下载后放入django的templates文件夹下 常用的绘图工具目前有2种 HighCharts  # https://www.highcharts.com.cn/ 使用方法 1.把js和html代码复制到自己的文件内 这些是必须的加载库,必须拷贝到自己的文件下 这个div就是显示的区域 js代码就是拷贝在图内红圈区域 红圈的是功能键,可

django入门5使用xadmin搭建管理后台

环境搭建: pip install django==1.9.8 pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl pip install future requests django-import-export six pip install  django-simple-captcha==0.4.6 pip install pillow pip install xadmin 然后再次 pip uninstall xadmin 把dja