使用 django cms cmsplugin_filer_file 和 cmsplugin_filer_image 未定义的上传 [英] undefined uploads using django cms cmsplugin_filer_file and cmsplugin_filer_image

查看:11
本文介绍了使用 django cms cmsplugin_filer_file 和 cmsplugin_filer_image 未定义的上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 django-cms,所以请原谅我的新手.

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

  1. 每次我尝试在管理区域上传文件时,例如使用 cmsplugin_filer_file'/cmsplugin_filer_image 的图像文件在剪贴板区域中显示为未定义.这很奇怪,因为运行的点看起来好像正在加载图像然后爆炸图像不明确的.它允许我创建文件夹,但我无法查看上传的文件.

  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.

仔细检查后,图像已上传到目录但是,在 media/filer 目录中的今天日期(即 media/filer/2012/03/27)下,没有文件显示在管理员中.会不会是一个与简单缩略图有关的问题,实际上是缩略图不显示?

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?

另外,你会推荐使用默认的 django-cms 文件管理器和图像插件吗?反而?它在文档中说它仅适用于本地存储,这是否意味着您将无法上传文件在生产/共享托管设置中从您的本地计算机到您的应用程序?

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.

谢谢

        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

推荐答案

是的,Timmy O'Mahony 是正确的.缺少 JS 目录.Firebug 对其进行了排序.

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

这篇关于使用 django cms cmsplugin_filer_file 和 cmsplugin_filer_image 未定义的上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆