简体   繁体   中英

Saved image cannot be displayed in Django filer

I'm having a problem viewing uploaded images in Django filer.

The images can be uploaded without any problems and will also be saved in the specified folder.

After that it will be shown as follows: Screenshot filer page

When I then click on expand I get the following error: Screenshot Error

My urls.py looks like this:

from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include, re_path, path
from django.views.i18n import JavaScriptCatalog
from django.contrib.sitemaps.views import sitemap
from cms.sitemaps import CMSSitemap
from djangocms_blog.sitemaps import BlogSitemap

urlpatterns = i18n_patterns(
    re_path(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
)

urlpatterns += staticfiles_urlpatterns()

urlpatterns += i18n_patterns(
    re_path(r'^admin/', admin.site.urls),
    re_path(r'^', include('cms.urls')),
    re_path(r'^sitemap\.xml$', sitemap, {'sitemaps': {'cmspages': CMSSitemap, 'blog': BlogSitemap,}}),
    re_path(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
    re_path(r'^filer/', include('filer.urls')),
    )

admin.site.enable_nav_sidebar = False

I installed django-filer according to the documentation. But apparently it doesn't work.

How can I solve this problem?

Examine the error page closely, you can see it's a 404 error, meaning you're requesting a non existing path.

The current path .../example.jpg/ , didn't match any of these.

Remove the trailing slash after example.jpg from your requesting url, then it should work properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM