Django xdmin, djangoxdmin

Source: Internet
Author: User

Django xdmin, djangoxdmin

 

 

Let's take a look at what the admin background provided by django previously looks like.

 

 

 

Some people say, how is your interface so ugly? Do I say this is ugly? He said ugly, I said you are here, I will look at your,

 

After seeing the logon interface, I said, "Don't look at it. I'll modify and modify it. So, I started to modify it and find information, it's a pity that I couldn't install Python 2, so I went crazy and spent a lot of effort,

Better than others

pip install   xadmin

 

My 3, found the connection, link: https://pan.baidu.com/s/1qYkJy3q password: i42m

 

In this case, I put my code under the public directory, and then I configured my xadmin. Under the setting configuration

import osimport syssys.path.insert(0, BASE_DIR)sys.path.insert(0, os.path.join(BASE_DIR, 'public'))

 

 

Configure the following in INSTALLED_APPS:

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

 

When an error is reported during running, the following error occurs: how can this problem be solved? Baidu, Baidu,

Installation, installation is good, still not good, there is nothing to install, but an error is reported,

Download the package and use

The installation is successful,

 

After successful configuration, on the setting Configuration

'Crispy _ forms ',
'Version ',

But it is still wrong. There is still a lack of DjangoUeditor. The above link also exists. You can download it and install it directly. After the configuration is complete, it can be started normally ,.

In the url directory.
from django.conf.urls import urlfrom django.contrib import adminimport xadminurlpatterns = [    # url(r'^admin/', admin.site.urls),    url(r'^xadmin/', xadmin.site.urls),]
 

 

In this way, my xadmin also takes effect.
Python manage. py makemigrations
Python manage. py migrate

 


After the database is synchronized, some tables are added,
Let's start the access.
After Login

 


In this way, my background is as tall as others. Experience it. It feels good. It's quite quick to get started.




Setting configuration full text "" Django settings for blog_project project. generated by 'django-admin startproject' using django 1.10.1.For more information on this file, seehttps: // docs.djangoproject.com/en/1.10/topics/settings/For the full list of settings and their values, seehttps: // docs.djangoproject.com/en/1.10/ref/settings/ "import osimport sysimport osimport socket # Build paths inside the project like this: o S. path. join (BASE_DIR ,...) BASE_DIR = OS. path. dirname (OS. path. dirname (OS. path. abspath (_ file _) sys. path. insert (0, BASE_DIR) sys. path. insert (0, OS. path. join (BASE_DIR, 'public') # Quick-start development settings-unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/# security warning: keep the secret key used in production secret! SECRET_KEY = '2nq *) _ r9p-n (B ^) 07wf _ (6 * di6e3_1rt ^ ljfdb) 5sz-+ q @ hrd '# SECURITY WARNING: don't run with debug turned on in production! DEBUG = TrueALLOWED_HOSTS = [] # Application definitionINSTALLED_APPS = ['django. contrib. admin', 'django. contrib. auth ', 'django. contrib. contenttypes ', 'django. contrib. sessions ', 'django. contrib. messages ', 'django. contrib. staticfiles ', 'blog', 'xadmin', 'cripy _ Form', 'version', 'djangoueditor'] MIDDLEWARE = ['django. middleware. security. securityMiddleware ', 'django. contrib. sessions. middleware. sessionMiddleware ', 'django. middleware. locale. localeMiddleware ', 'django. middleware. common. commonMiddleware ', 'django. middleware. csrf. csrfViewMiddleware ', 'django. contrib. auth. middleware. authenticationMiddleware ', 'django. contrib. messages. middleware. messageMiddleware ', 'django. middleware. clickjacking. XFrameOptionsMiddleware ',] ROOT_URLCONF = 'blog _ project. urls 'templates = [{'backend': 'django. template. backends. django. djangoTemplates ', 'dirs': [OS. path. join (BASE_DIR, 'templates')], 'app _ dirs': True, 'options': {'Context _ processors ': ['django. template. context_processors.debug', 'django. template. context_processors.request ', 'django. contrib. auth. context_processors.auth ', 'django. contrib. messages. context_processors.messages ', 'blog. views. global_setting ',],},},] WSGI_APPLICATION = 'blog _ project. wsgi. application '# Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databasesDATABASES = {'default': {'Engine': 'django. db. backends. sqlite3 ', 'name': 'blog. db', 'user': '', 'Password':'', 'host': '', 'Port ':'',}} # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validatorsAUTH_PASSWORD_VALIDATORS = [{'name': 'django. contrib. auth. password_validation.UserAttributeSimilarityValidator ',}, {'name': 'django. contrib. auth. password_validation.MinimumLengthValidator ',}, {'name': 'django. contrib. auth. password_validation.CommonPasswordValidator ',}, {'name': 'django. contrib. auth. comment ',},] # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/LANGUAGE_CODE = 'en-us' TIME _ ZONE = 'Asia/Shanghai' USE _ I18N = TrueUSE_L10N = TrueUSE_TZ = False # Static files (CSS, javaScript, Images) # outputs (OS. path. join (BASE_DIR, 'uploads'),) STATIC_URL = '/static /'
 

 

 

 

Related Article

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.