Use of xadmin in python 3.5 and fix the source code bug, pythonxadmin

Source: Internet
Author: User

Use of xadmin in python 3.5 and fix the source code bug, pythonxadmin

Preface

Xadmin is a django management backend implementation. It uses a more flexible architecture design and Bootstrap UI framework to replace the existing admin, developed by Chinese people and has many new features:

• Compatible with Django Admin

• Use Bootstrap as the UI framework

• Flexible page layout editing

• Homepage dashboard and widgets

• Filter Enhancement

• Data Export

• Powerful plug-in mechanism

The following article will detail how to use xadmin in python 3.5 and how to solve possible problems. Let's take a look at the details below:

Installation Method

1. Copy the xadmin directory to your project.

2,pip install httplib2 django-formtools django-crispy-forms

# setting.pyINSTALLED_APPS = [ ..., 'xadmin', 'crispy_forms',]
# urls.pyimport xadminurlpatterns = [ url(r'^admin/', xadmin.site.urls)]

How to fix the "built-in" BUG of xadmin

After the Django User table is rewritten, a bug occurs in xadmin.

In the master Branch, I used UserProfile in users/models. py to overwrite the built-in auth_user table.

There will be two bugs:

1. xadmin cannot manage the rewritten User table

2. When you click Change Password in the upper right corner of the xadmin background page, an error is reported.

Repair procedure:

1. Add variables in settings. py

AUTH_USER_MODEL = "users.UserProfile"

2. Make the following changes in xadmin. plugins. auth.

from django.contrib.auth import get_user_modelUser = get_user_model()

An error will also be reported when the user changes the password. The password cannot be found on the 404 page.

 

Replace the url of register_view in xadmin. plugins. auth with the url with the error message.

site.register_view(r'^users/userprofile/(.+)/password/$',     ChangePasswordView, name='user_change_password')

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.