python - why i can't use django admin app's resource -


i want reuse django's contrib "admin" resource in project, "admin" has static directory, "static/admin/image/selector-icons.svg" want reuse.

i have such settings.py:

staticfiles_finders = (     'django.contrib.staticfiles.finders.filesystemfinder',     'django.contrib.staticfiles.finders.appdirectoriesfinder', ) 

i tried:

staticfiles_dirs = (     os.path.join(project_root,'static'),     file path of admin's static ) 

failed again.

"admin" can use "static/admin/image/selector-icons.svg" in "widgets.css" like

.selector-add {     background: url(../img/selector-icons.svg) 0 -96px no-repeat;     cursor: default; } 

but cant in project this:

.selector-add {     background: url(admin/img/selector-icons.svg) 0 -96px no-repeat;     cursor: default; } 

console of chrome said 404 error!

.selector-add {     background: url(admin/img/selector-icons.gif) 0 -96px no-repeat;     cursor: default; } 

worked.

and find in "admin" render html, "selector-icons.svg" transform "selector-icons.gif", below picture: in red circle css shows "selector-icons.gif", not "selector-icons.csv"

so question is:

first: how reuse "admin" resource?

second:why "selector-icons.svg" "selector-icons.svg"?

the icons have been changed svg in django 1.9, hasn't been released yet (see ticket 20597).

on older versions of django, including current release 1.8, icons gifs.

you either use gifs until upgrade, or if need svgs now, clone repository , add the svgs static files.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -