0

After installing Photologue following the official guide I did initially succeed in uploading a .zip gallery, however at one point the system started giving me a 400 BAD REQUEST error, whenever I attempt to upload a new .zip gallery. The .zip files do however make it to my myapp/media/photologue/temp directory, but are not available otherwise.

The project is within a virtualenv.

My settings file looks like

INSTALLED_APPS = (
...
'photologue',
'south',
...
)
MEDIA_ROOT = (
    os.path.join(BASE_DIR, 'media')
)

MEDIA_URL = '/media/'


STATIC_URL = '/static/'

STATIC_ROOT = ''

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

from photologue import PHOTOLOGUE_APP_DIR

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
    PHOTOLOGUE_APP_DIR,
)
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.eggs.Loader',
)

PHOTOLOGUE_PATH = 'myapp.utils.get_image_path'

Whitin myapp/utils.py I have, # myapp/utils.py:

import os

def get_image_path(instance, filename):
    return os.path.join('path', 'to', 'my', 'files', filename)

And I have myapp/urls.py with the recommended settings as per

#/myapp/urls.py
urlpatterns = patterns('',
    ...
    url(r'^photologue/', include('photologue.urls')),
    (r'^i18n/', include('django.conf.urls.i18n')),
    url(r'^admin/', include(admin.site.urls)),
)



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

Thanks for looking.

luboP
  • 1

1 Answers1

0

I have same behaviour but without getting any error. Django 1.6.2, photologue 2.7, pytz 2013

kotrfa
  • 1,191
  • 15
  • 22