1

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
user1294886
  • 87
  • 11
  • With regard question 2; local storages just means that you can't use the likes of Amazon S3 to host media - it has to be the local filesystem. So it will be fine on a production server as long as you are saving files locally to the server – Timmy O'Mahony Mar 27 '12 at 08:39
  • 1
    Check firebug to see if there are any javascript/ajax errors when uploading the file - it sounds like you are right and it's something to do with thumbnails. There should be a `filer_thumbnails` directory as well as `filer` to hold the thumbnails produced. Does this contain anything? Are you running locally on a laptop/pc or a server? – Timmy O'Mahony Mar 27 '12 at 08:40
  • Thanks very much. Im currently running locally using django's development server. – user1294886 Mar 27 '12 at 08:57

2 Answers2

0

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.

Bartvds
  • 3,340
  • 5
  • 30
  • 42
-7

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

user1294886
  • 87
  • 11