Django集成Xadmin时出现的问题(一)

问题一:

  • Django集成xadmin出现以下问题:主要缺少模块

    No module named 'future'

    pip3 install future
    

    No module named 'crispy_forms'

    pip3 install django-crispy-forms
    

    No module named 'reversion

    pip3 install django-reversion
    

    No module named 'django.contrib.formtools'

    pip3 install django-formtools
    

    No module named 'httplib2'

    pip3 install httplib2
    

    No module named 'six'

    pip3 install six
    

    No module named 'import_export'

    pip3 install django-import-export
    

问题二:

  • TypeError: render() got an unexpected keyword argument 'renderer'

    集成 xadmin时后台主页添加小组件不能用

    解决办法:修改Django源码

    位置:/lib/site-packages/django/forms/boundfield.py

    # renderer=self.form.renderer,(93行处注释掉,就能正常运行了)
    
    
  • django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None

    解决办法:

    确认安装pymysql

    pip3 install pymysql
    
    

    找到Python安装路劲下的Python36-32\Lib\site-packages\django\db\backends\mysql\base.py文件

    将文件中的如下代码注释

    if version < (1, 3, 3):
        raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)
    
    

你可能感兴趣的:(Django集成Xadmin时出现的问题(一))