undefined uploads using django cms cmsplugin_filer_file and cmsplugin_filer_image

不问归期 提交于 2020-01-11 07:36:51

问题


I have just started using django-cms so please forgive my newbieness.

  1. Every time i try to upload a file in the admin area, for example an image file using cmsplugin_filer_file' / cmsplugin_filer_image it comes up as undefined in the clipboard area. It’s strange because the running dots appear as if it is loading the image then bang image undefined. It allows me to create folders but I cannot view uploaded files.

    On closer inspection the image has been uploaded to a directory under today’s date in media / filer dir (i.e media/filer/2012/03/27) however, no files are displayed in admin. Could it be a problem related to easy thumbnails and it is in fact that the thumbnail doesn’t display?

  2. Also, would you recommend using the default django-cms filer and image plug-ins instead? It says in the documentation that it only works for local storages, does this mean that you will not be able to upload files from your local computer in to your application in a production / shared hosting setting?

I would be very grateful for any help with these two questions.

Thanks

        SETTINGS
    MEDIA_ROOT = os.path.join(PROJECT_PATH, "media")
    MEDIA_URL = '/media/'
    STATIC_ROOT = os.path.join(PROJECT_PATH, "static")
    STATIC_URL = '/static/'
    ADMIN_MEDIA_PREFIX = '/static/admin/'
THUMBNAIL_PROCESSORS = (
    'easy_thumbnails.processors.colorspace',
    'easy_thumbnails.processors.autocrop',
    #'easy_thumbnails.processors.scale_and_crop',
    'filer.thumbnail_processors.scale_and_crop_with_subject_location',
    'easy_thumbnails.processors.filters',
)
    INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'django.contrib.admin',
        'easy_thumbnails',
        'cms',
        'mptt',
        'menus',
        'south',
        'sekizai',
        'filer',
        'cmsplugin_filer_file',
        'cmsplugin_filer_folder',
        'cmsplugin_filer_image',
        'cmsplugin_filer_teaser',
        'cmsplugin_filer_video',    
        'cms.plugins.twitter',
        'cms.plugins.text',
        'cms.plugins.flash',
        'cms.plugins.googlemap',
        'cms.plugins.link',

    URLS
    from django.conf.urls.defaults import *
    from django.contrib import admin
    from django.conf import settings

    admin.autodiscover()

    urlpatterns = patterns('',
        (r'^admin/', include(admin.site.urls)),
        url(r'^', include('cms.urls')),
    )

    if settings.DEBUG:
        urlpatterns = patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
        url(r'', include('django.contrib.staticfiles.urls')),
    ) + urlpatterns

回答1:


Another solution for posterity: I solved this issue twice by verifying the server could write to the storage.

First time the bucket policy was broken. In another case the server time was so skewed (as EC2 doesn't sync time) that S3 wouldn't accept the upload. After using NTP and forcing a sync it worked again.




回答2:


Yep Timmy O'Mahony was correct. A JS directory was missing. Firebug sorted it.



来源:https://stackoverflow.com/questions/9885312/undefined-uploads-using-django-cms-cmsplugin-filer-file-and-cmsplugin-filer-imag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!