Use grappelli to beautify the Django admin Background Management Interface

Source: Internet
Author: User

A Django app: grappelli was found online over the past few days. This app can be used to beautify the Django admin background management interface and make the ugly Django admin background interface very cool and nice.

The following is an article written by others for your reference:

References:

Improve the default Django-Admin background http://blog.sina.com.cn/s/blog_634bc2230100obx5.html with Django-grappelli

However, the above article still has some shortcomings, just because it has not kept up with the latest django1.3. in this example, the startup parameter 5.2 is configured, and the specified adminmedia is directed to the grapelli static file directory. I cannot achieve this on the basis of django1.3. therefore, I still need to find information on the Internet. The following is my record:

1. Download grappelli

Address: https://github.com/sehmaschine/django-grappelli point download, windows ZIP format, linuxtartar.gz format.

2. Install grappelli and configure 1). Set installed_apps in settings. py:

Installed_apps = ('django. contrib. auth ', 'django. contrib. contenttypes ', 'django. contrib. sessions ', 'django. contrib. sites ', 'django. contrib. messages ', 'django. contrib. staticfiles ', 'grappelli', # grapplli must be located in Django. contrib. 'django. contrib. admin', 'django. contrib. admindocs ',)

2) Set admin_media_prefix instead of setting adminmedia to grapplli in the references above.

#ADMIN_MEDIA_PREFIX = '/static/admin/'ADMIN_MEDIA_PREFIX = STATIC_URL + "grappelli/"

This function is to map the static admin file from the original Admin directory to grapplli under the static directory.

3) set the URL

    (r'^admin/doc/', include('django.contrib.admindocs.urls')),        (r'^grappelli/',include('grappelli.urls')),     # Uncomment the next line to enable the admin:    (r'^admin/', include(admin.site.urls)),

As configured in settings, grapplli URL ing must be prior to admin.

4) collect static Resources

Run the following command:

manage.py collectstatic 

This command collects all static resources (CSS, JS, and images) in the static directory under the grapplli app directory to the static directory you configured.
Go down to the grapplli directory.

3. Test grapplli applications

Manage. py runserver

Open http: // localhost: 8000/admin/and you will be able to see the logon interface. Is it cool?

Let's see:

I have prepared a demo for django1.3 and put it on Google Code later.

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.