Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Django suit or Bootstrap to beautify admin templates

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article to share with you is about how to use Django suit or Bootstrap beautification admin template, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after harvest, not much to say, follow Xiaobian to see it.

Django features are very powerful, overall support should be very comprehensive, if some students do not know html,web front-end things, Django Admin template can also meet your needs, just do metadata management is enough.

For example, a personal knowledge base that I iterated quickly before, at least for the time being, liberated myself first and realized some basic functions, and then gradually deepened. I worked as a product manager and a developer at the same time. I had a basic idea in my mind about how to realize and plan the requirements. Think about it, it is true that after a certain degree of achievement, some potential problems will be discovered, or there will be some new requirements, and if we have not been able to step through that hurdle and have been staying at the previous level of requirements, I hope to compress this stage and complete some basic functions as soon as possible.

The screenshot of the knowledge base that was simply configured before is as follows. It is not too ugly.

Of course, if you want to implement something that looks slightly better, there are two shortcuts. One is to use Django Suit and the other is to configure Bootstrap.

The screenshot after configuring Django Suit is as follows. You can see that the interface seems to have some features. The color tone and layout have been greatly adjusted. The left side has the real menu above, and the previous filters are placed in the red box.

To achieve this function, the operation is faster and easier in 10 minutes.

1) Install django-suit library

pipinstalldjango-suit==0.2.25

2) Configure the settings.py file, put suit in front of the application list, and take precedence over the admin section, as follows:

INSTALLED_APPS=('suit','django.contrib.admin',)

3) If the version of Django is lower, you need to adjust the TEMPLATE_CONTEXT_PROCESSORS setting of settings.py.

TEMPLATE_CONTEXT_PROCESSORS=TCP+('django.core.context_processors.request',)

If the version is newer, you can focus on checking the red part.

TEMPLATES = [

{

。。。。

'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',

],

},

},

]

Then it was time to start the service and check the effect. Very simple steps. The effect was not bad.

If Bootstrap is enabled, the effect will be even more dazzling. I am very optimistic about this direction, because now the big front-end advantage is obvious. Yesterday in the ACOUG sharing, I simply mentioned a concept, that is, the current technical direction is divided into three layers, the lowest layer is the database, system, network and other infrastructure parts, similar to the saas layer, the middle layer is the logical implementation of some business systems, which is regarded as the backend of the program, the server side. The upper layer is the front end part, which has many forms of expression, such as visualization technology direction. My understanding is that the previous technology direction paid more attention to the backend and paid more attention to the underlying and application architecture. Just like the drum below, it is not enough attention for the front end, or the attention is still limited, because many people have the impression that the beautification part is something done by artists.

And now big changes have taken place. It can be called big front-end technology, because the current front-end technology has developed very mature, front-end hopes to be able to do some server-side things, so JS is very hot now. The underlying technology, at present, everyone still has a sense of crisis, will learn some development skills, which will have a certain impact on the existing server-side role, a bit similar to the drum below.

With that in mind, let's look at a basic improvement to bootstrap, and if we want to refine it, there should be a lot of work to confirm or refine it. We can simply experience it, add bootstrap library to settings.py file, you can see a better interface in minutes, of course, this is the screenshot I picked out to see.

Modify the app list in the settings.py file and add a bootstrap interface, such as this configuration.

INSTALLED_APPS = (

'bootstrap_admin',

The resulting interface is as follows, if you want to do refinement and customization, you need to do further analysis.

The above is how to use Django suit or Bootstrap to beautify the admin template, Xiaobian believes that some of the knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report