Django之virtualenv下安装xadmin

1.安装xadmin,通过pip

进入virtualenv
pip安装xadmin
pyyuc:~ yuchao$ source PycharmProjects/mxvenv/bin/activate
(mxvenv) pyyuc:~ yuchao$  pip install git+git://github.com/sshwsfc/xadmin.git

结果:

 2.配置xadmin

INSTALLED_APPS = [
    # django的admin也是一个app
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    "users",
    "operation",
    "organization",
    "courses",
    "xadmin",
    #xadmin依赖的app,写法注意
    "crispy_forms",
]

-

import xadmin

urlpatterns = [
    # url(r'^admin/', admin.site.urls),
    # 修改为xadmin
    url(r'^xadmin/', xadmin.site.urls),
]

 -

makemigrations
migrate

<!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff} span.s1 {font-variant-ligatures: no-common-ligatures} -->

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券