Giter VIP home page Giter VIP logo

imagestore's Introduction

ImageStore

An image gallery, created for easy integration for an exiting django project.

Documentation available on ReadTheDocs

  • Albums
  • Mass upload
  • Thumbnails in admin intereface
  • Ordering
  • Tagging support
  • Easy PrettyPhoto integration
  • Django-cms integration
  • You can use imagestore to create gallery for your users.
  • Users can:
    • create albums, upload photos to albums
    • make albums non-public
    • set name, descripion and tags for photos
    • edit infomation about photo or upload new veresion

imagestore's People

Contributors

adrienbrunet avatar avm avatar coin avatar cristicor avatar dukesasa avatar fabiofsilva avatar geyser avatar krzysiekj avatar lampslave avatar ricardofalasca avatar roberkules avatar sandino avatar zeus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imagestore's Issues

AttributeError at /admin/imagestore/album/add/

Got error after fresh installation of the test_project.

  • pip install -r requirements.txt
  • assign MEDIA_URL and MEDIA_ROOT dir.
  • run migrate
  • create superuser
  • try to add first album
Internal Server Error: /admin/imagestore/album/add/
Traceback (most recent call last):
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/options.py", line 541, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 244, in inner
    return view(request, *args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1437, in add_view
    return self.changeform_view(request, None, form_url, extra_context)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
    return bound_func(*args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/utils/decorators.py", line 184, in inner
    return func(*args, **kwargs)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1393, in changeform_view
    formsets, inline_instances = self._create_formsets(request, form.instance, change=False)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1726, in _create_formsets
    'queryset': inline.get_queryset(request),
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1877, in get_queryset
    queryset = super(InlineModelAdmin, self).get_queryset(request)
  File "/home/ramast/Desktop/sc/imagestore/test/testproject/env/lib/python2.7/site-packages/django/contrib/admin/options.py", line 321, in get_queryset
    qs = self.model._default_manager.get_queryset()
AttributeError: type object 'Image' has no attribute '_default_manager'

Deprecated syntax

That's not really a issue, but you should be aware that the syntax changed in Django 1.4

Now you have to quote constants. {% url imagestore:upload %} soud be {% url "imagestore:upload" %} for example.

EXIF extension for Image??

Hello,

I've been using imagestore, and have more-or-less forked it, because I had trouble creating a custom image while I was under time pressure.

I now have a bit more time, and could pull the custom image stuff into my private repo, which would enable me to contribute the EXIF processing that I have added.

Features of my EXIF processing::

  • EXIF data would be exclusively for the postgres database (since it uses pgfield)
  • Album Upload and Image upload would parse EXIF data on images, and store in the Image() model, providing a nice accessor to get the EXIF blocks.
  • EXIF data is easily available in the template, via the image object.
  • EXIF data is cached on first use.

If you would be interested in receiving a PR with these features, and probably some other tidy-up, let me know.

If any other users are interested in having EXIF functionality, hire me for a couple of hours, and I'll get on it. Otherwise, check my fork, and help yourself.

--russ

Could you pls update to Django 1.10?

When saving image, error appears:

Exception Value: Cannot force an update in save() with no primary key.
Exception Location: /home/simsim/www/testproject/lib/python3.5/site-packages/django/db/models/base.py in _save_table, line 880

With Django 1.9.9 everything is ok

Thank you.

Ordering

Hello,

There is an 'ordering' feature among anounced in README.rst but I couldn't find how to sort albums. By default they are sorted in ascending order, but I need descending to show new albums first.

Could you please help me to reverse the order?

UPDATE
I'm sorry, I've just noticed the Order field on the Album form. But is there a settings parameter that lets order albums by date descending?

Many issues, namespace, registration.

Too many issues to list accurately, I dont know where to begin. Please help

Start a new virtualenv, follow install instructions, registration errors on /accounts/login/?next=/gallery/upload/. What is the registration system?

Caught NoReverseMatch while rendering: Reverse for ''django.contrib.auth.views.login'' with arguments '()' and keyword arguments '{}' not found.

Added this and was able to get the test site going
(r'^accounts/login/$', 'django.contrib.auth.views.login'), demo site needs auth.

Now uploading there are no thumbnails. I have sorl-thumbnail in installed apps, easy_install sorl-thumbnail. Jic.

Tried to Integrate into django-cms as an app and got namespace errors on upload, add namespace=upload to fix, page resolves but adding the app has upload links broken. just resolves to http://upload. Plugin does work.

Travis-ci is also failing on readthedocs, looks like a config error.

Would be nice if this worked. I can provide more specific information if I know the project is active, but there seems like a lot of missing information .

I used both easy_install and github, not sure if the egg is behind the git. Probably.

Hope we can get this smoothed out. Please help.

Thank you,

Bryan

prettyPhoto doc shortage

If you want to use prettyPhoto put prettyPhoto to your media directory and include imagesotore/prettyphoto.html to your template...

using django-cms or else ...

this isn't explicit enough

please be more specific in the steps to follow to have what prettyphoto promises in a django site

thanks

Errors in Template with solr.thumbnail

In a pretty fresh install of django-cms + imagestore + solr.thumbnail I get this errors for "empty" and "endthumbnail" tags:

Exception Value: Invalid block tag: 'empty'
In template templates/imagestore/user_info.html, error at line 10

and after removing line 10 from template

Exception Value: Invalid block tag: 'endthumbnail'
In template templates/imagestore/user_info.html, error at line 10

removing all tags 'endthumbnail' from the templates seems to solve the error, I'll investigate further to see what functional changes you need in the templates logic.

Please note that this might even be a bug in the latest solr.thumbnail as the official docs state that you should be able to use empty and endthumbnail, if so feel free to close this issue and open one for the solr team.

This is my config:
$ yolk -l
Django - 1.3.1 - active
MySQL-python - 1.2.3 - active
PIL - 1.1.7 - active
Paste - 1.7.5.1 - active
Python - 2.7.2 - active development (/opt/lib/python2.7/lib-dynload)
South - 0.7.3 - active
cmsplugin-filer - 0.8.0 - active
django-classy-tags - 0.3.4.1 - active
django-cms - 2.2 - active
django-fancy-autocomplete - 0.1a1 - active
django-filer - 0.8.5 - active
django-mptt - 0.5.1 - active
django-reversion - 1.5.1 - active
django-sekizai - 0.5 - active
django-tagging - 0.3.1 - active
easy-thumbnails - 1.0-alpha-20 - active
html5lib - 0.90 - active
imagestore - 2.7.0 - active
setuptools - 0.6c11 - active
sorl-thumbnail - 11.12 - active
winpdb - 1.4.8 - active
wsgiref - 0.1.2 - active development (/opt/lib/python2.7)
yolk - 0.4.1 - active

It is not possible to extend Image and Album

Someone else raised the same issue I was having on stackoverflow: http://stackoverflow.com/questions/10250145/extending-imagestore-models/10577088#10577088

The solution there is mine.

I found that there is a circular import. Here's the order of things (slightly simplified):

  1. load_class(IMAGESTORE_ALBUM_MODEL)
  2. from imagestore.models.bases.album import BaseAlbum
  3. BaseAlbum has an FK to IMAGESTORE_IMAGE_MODEL (head), so it gets imported with load_class
  4. load_class(IMAGESTORE_IMAGE_MODEL)
  5. from imagestore.models.bases.image import BaseImage
  6. BaseImage has an FK to IMAGESTORE_ALBUM_MODEL (album), so it gets imported with load_class
  7. When this calls import IMAGESTORE_ALBUM_MODEL is already in sys.modules, though incomplete because it's still being built. And thus the module doesn't have an "Album" attribute yet.

The quick solution is to move the head field to models.album.Album and remove it from BaseAlbum. After doing this I was able to get the site running again. You must use the models package in your new app (not a simple models.py), with Image and Album in separate files.

django 1.8 issue with View class

line 19 of imagestore/views.py, points to django.views.View which is not existent in django 1.8?, i have fixed it by replacing with from django.views.generic.base import View

Custom users not found

Hi,

I have a custom user model CustomUser. On album list page under each album cover I put album user name with a link to {% url 'imagestore:user' album.user.username %}, and the url resolves correctly. But when I click the link I open Http404 page with No CustomUser matches the given query message. Using pdb debugger I found that in this line the specified user cannot be found as it is being looked for using django.contrib.auth.models.User while it is an instance of the custom model.

integrate in django cms

I did what's written here

http://imagestore.readthedocs.org/en/latest/djangocms.html

then

python manage.py syncdb

Not synced (use migrations):

  • cms
    ...
  • imagestore.imagestore_cms
    (use ./manage.py migrate to migrate these)

python manage.py migrate

Running migrations for imagestore_cms:

  • Migrating forwards to 0005_auto__add_field_imagestorealbumcarousel_template_file.

    imagestore_cms:0001_initial
    DEBUG:south:south execute "CREATE TABLE "cmsplugin_imagestorealbumptr" ("cmsplugin_ptr_id" integer NOT NULL PRIMARY KEY, "album_id" integer NOT NULL);" with params "[]"
    DEBUG:south:south execute "ALTER TABLE "cmsplugin_imagestorealbumptr" ADD CONSTRAINT "cmsplugin_ptr_id_refs_id_645b7476" FOREIGN KEY ("cmsplugin_ptr_id") REFERENCES "cms_cmsplugin" ("id") DEFERRABLE INITIALLY DEFERRED;" with params "[]"
    DEBUG:south:south execute "ALTER TABLE "cmsplugin_imagestorealbumptr" ADD CONSTRAINT "album_id_refs_id_58e4fb07" FOREIGN KEY ("album_id") REFERENCES "imagestore_album" ("id") DEFERRABLE INITIALLY DEFERRED;" with params "[]"
    Traceback (most recent call last):
    File "manage.py", line 34, in
    execute_from_command_line()
    File "/home/nlaurance/django/lib/python2.7/site-packages/django/core/management/init.py", line 429, in execute_from_command_line
    utility.execute()
    File "/home/nlaurance/django/lib/python2.7/site-packages/django/core/management/init.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/home/nlaurance/django/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(_args, *_options.dict)
    File "/home/nlaurance/django/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(_args, *_options)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle
    ignore_ghosts = ignore_ghosts,
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/migration/init.py", line 191, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/migration/migrators.py", line 221, in migrate_many
    result = migrator.class.migrate_many(migrator, target, migrations, database)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/migration/migrators.py", line 292, in migrate_many
    result = self.migrate(migration, database)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/migration/migrators.py", line 125, in migrate
    result = self.run(migration)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/migration/migrators.py", line 99, in run
    return self.run_migration(migration)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/migration/migrators.py", line 82, in run_migration
    south.db.db.execute_deferred_sql()
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/db/generic.py", line 184, in execute_deferred_sql
    self.execute(sql)
    File "/home/nlaurance/django/lib/python2.7/site-packages/south/db/generic.py", line 150, in execute
    cursor.execute(sql, params)
    File "/home/nlaurance/django/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute
    return self.cursor.execute(sql, params)
    File "/home/nlaurance/django/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
    django.db.utils.DatabaseError: relation "imagestore_album" does not exist

....
any suggestion ?

Django CMS Template imagestore_album.html and prettyPhoto

Hi,
i would like to use the imagestore app inside my small django cms project. After executing the tutorial i get really fast a good result. The only problem i run into is that the javascript snippet inside the template imagestore_album.html throughs an error. It's not able to find the CMS object (unresolved reference).

So i take a look at your application and found a solution for me by modify the template. The difference is the usage of sekizai and the django cms predefined block tags.

{% load thumbnail %}
{% load sekizai_tags %}
{% load staticfiles %}

{% addtoblock "css" %}
<link rel="stylesheet" href={% static "css/prettyPhoto.css" %} type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
{% endaddtoblock %}

<div id='gallery'>
    {% for image in album.images.all %}
        {% thumbnail image.image "120x120" crop="center" as im %}
            {% thumbnail image.image "600x600" as full %}
                <a rel='gallery[pp_gal]' href="{{ full.url }}">
                        <img class="preview" {% if image.title %} alt="{{ image.title }}" {% endif %} src="{{ im.url }}">
                </a>
            {% endthumbnail %}
        {% endthumbnail %}
    {% endfor %}

    {% addtoblock "js" %}
    <script type="application/javascript" src={% static "js/jquery.prettyPhoto.js" %}></script>
    <script type="text/javascript" charset="utf-8">
    CMS.$(function() {
        $("a[rel^='gallery']").prettyPhoto({
            allow_resize: true,
            changepicturecallback: function() {
                $(".pp_overlay").css("height", $(document).height());
            }
        });
    });
    </script>
    {% endaddtoblock %}
</div>

Models are imported incorrectly

Today I was having an trouble with AttributeError which said Exception Value: 'module' object has no attribute '_meta'.

This is because models are currently imported as such through out the source:

from imagestore.models import Album, Image, AlbumUpload

This does not import the actual model classes but rather the module that contains them. The quick fix is just:

from imagestore.models.image import Image
from imagestore.models.album import Album
from imagestore.models.upload import AlbumUpload

I personally don't understand why each model class needs to be in its own file. Maybe someone can explain the reason behind the current model module structure to me?
For now I hope this helps someone out that doesn't see the fix quickly on their own.

Error ImportError: cannot import name 'permalink'

....
  File "/Users/irfanpule/.virtualenvs/btech/lib/python3.6/site-packages/imagestore/models/__init__.py", line 3, in <module>
    from .album import Album
  File "/Users/irfanpule/.virtualenvs/btech/lib/python3.6/site-packages/imagestore/models/album.py", line 5, in <module>
    from .bases.album import BaseAlbum
  File "/Users/irfanpule/.virtualenvs/btech/lib/python3.6/site-packages/imagestore/models/bases/album.py", line 8, in <module>
    from django.db.models import permalink
ImportError: cannot import name 'permalink'

I try to upgrade django 2.1.7, I get this errors. Can you help me?

Some error with Album model

test@testo:~/PycharmProjects/kuhni/kuhni/kuhni$ ./manage.py syncdb
/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/mptt/models.py:305: DeprecationWarning: Implicit manager CMSPlugin.tree will be removed in django-mptt 0.6. Explicitly define a TreeManager() on your model to remove this warning.
DeprecationWarning
Traceback (most recent call last):
File "./manage.py", line 14, in
execute_manager(settings)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/core/management/init.py", line 438, in execute_manager
utility.execute()
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/core/management/init.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(_args, *_options.dict)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/core/management/base.py", line 219, in execute
self.validate()
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/core/management/base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/db/models/loading.py", line 146, in get_app_errors
self._populate()
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/db/models/loading.py", line 61, in _populate
self.load_app(app_name, True)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/db/models/loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/imagestore-2.7.3-py2.6.egg/imagestore/models/init.py", line 8, in
Album = load_class(getattr(settings, 'IMAGESTORE_ALBUM_MODEL', 'imagestore.models.album.Album'))
File "/home/test/PycharmProjects/kuhni/kuhni/lib/python2.6/site-packages/imagestore-2.7.3-py2.6.egg/imagestore/utils.py", line 38, in load_class
raise ImproperlyConfigured(txt)
django.core.exceptions.ImproperlyConfigured: Error importing backend imagestore.models.album: "No module named helpers".

When deleting first image in album, the whole album is deleted

I've modified my album template slightly so that my images thumbnails open into a full view with Yoxview image viewer and I no longer use the image template. I'm also generating my edit and delete buttons for each image underneath the thumbnail on the album page. Whenever I delete the first image in an album the whole album gets deleted, but this problem doesn't occur if the image isn't the first in the album. I'm not sure if this issue exists in Imagestore normally, but I was wondering if anyone has experienced the same issue or know what might be causing it? Can provide more detail if needed :) Thanks!

Template not found "base.html"

Hello,

maybe i don't get it, but i have an issue trying out imagestore.

I use it with django-cms and tried to make a simple gallery, all settings default.

I get this error when i try to open the gallery

Exception Type: TemplateDoesNotExist
Exception Value: base.html

Error during template rendering

In template /home/jonni/Projekte/fotoladen/lib/python2.7/site-packages/imagestore/templates/imagestore/base.html, error at line 1
base.html
1 {% extends IMAGESTORE_TEMPLATE|default:"base.html" %}
2 {% load i18n %}
3 {% load url from future %}
4
5 {% block head %}
6 {% if IMAGESTORE_LOAD_CSS %}
7
8 {% endif %}
9 {% endblock %}
10
11 {% block breadcrumb %}

I don't get it: the template "base.html" is trying to extend from itself?
What am i thinking wrong?

License unclear

The license is unclear from the project source code. There is no LICENSE file in the repository. The setup.py mentions "GPL", but does not refer to a specific version. Does this mean it's 2+ or 3+ ?

Add little feature regarding urls

In my project users may custom their addresses, so if they want address may look like site.com/kuzia, but by default address look like site.com/id123. For such customization I have a field user_url.

Imagestore uses <username>:

    url(r'^user/(?P<username>\w+)/albums/', AlbumListView.as_view(), name='user'),
    url(r'^user/(?P<username>\w+)/$', ImageListView.as_view(), name='user-images'),

which in my case does not work and need to be changed whether in urls to <user_url> or in views.

My little 5 cents - could you add to the settings such option like: USER_URL_FIELD?
Thank you.

How to use with PrettyPhoto?

As said in #2 including PrettyPhoto is not enough, it also necessary to change link urls. I hacked image_list.html and lightbox script working. But I think better way is to change image-href.html template. Could you please explain what rows need to be changed:

{% if album %}
    {% url imagestore:image-album album_id=album.id pk=image.id %}
{% else %}
    {% if tag %}
        {% url imagestore:image-tag tag=tag pk=image.id %}
    {% else %}
        {{ image.get_absolute_url }}
    {% endif %}
{% endif %}

Especially, I don't understand what is the tag variable for?

Django-CMS integration does not use namespaces

Adding app_name = 'imagestore' to the ImagestoreApp class will allow the urls to resolve correctly, and remove the need to have url(r'^', include('cms.urls', namespace='imagestore')) in the url config

Unable to create an album with Django 1.10

Hi,

I've tried to use imagestore with Django 1.10.8, from the Django admin i can create an Image object but trying to create a new Album object result in an exception:

Traceback (most recent call last):
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = get_response(request)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 544, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/sites.py", line 211, in inner
    return view(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1509, in add_view
    return self.changeform_view(request, None, form_url, extra_context)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 67, in _wrapper
    return bound_func(*args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 63, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1450, in changeform_view
    self.save_related(request, form, formsets, not add)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1031, in save_related
    self.save_formset(request, form, formset, change=change)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1019, in save_formset
    formset.save()
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/forms/models.py", line 651, in save
    return self.save_existing_objects(commit) + self.save_new_objects(commit)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/forms/models.py", line 784, in save_new_objects
    self.new_objects.append(self.save_new(form, commit=commit))
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/forms/models.py", line 928, in save_new
    obj.save()
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/db/models/base.py", line 796, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/db/models/base.py", line 824, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/db/models/base.py", line 880, in _save_table
    raise ValueError("Cannot force an update in save() with no primary key.")
ValueError: Cannot force an update in save() with no primary key.

This is effective with imagestore 3.0.0 and 3.1.0. Version 2.9.1 result in another error i assumed to be related to Django>1.9 support.

Test example doesn't work - ImportError: No module named mptt

$ python manage.py syncdb

Traceback (most recent call last):
File "manage.py", line 12, in
execute_from_command_line(sys.argv)
File "/home/pstudeni/Develop/Testing/imagestore/test/testproject/env/lib/python2.7/site-packages/django/core/management/init.py", line 338, in execute_from_command_line
utility.execute()
File "/home/pstudeni/Develop/Testing/imagestore/test/testproject/env/lib/python2.7/site-packages/django/core/management/init.py", line 312, in execute
django.setup()
File "/home/pstudeni/Develop/Testing/imagestore/test/testproject/env/lib/python2.7/site-packages/django/init.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/pstudeni/Develop/Testing/imagestore/test/testproject/env/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/pstudeni/Develop/Testing/imagestore/test/testproject/env/lib/python2.7/site-packages/django/apps/config.py", line 86, in create
module = import_module(entry)
File "/usr/lib64/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named mptt

Django 1.6 Issue in urls.py

The following import in urls.py does not work in Django 1.6

from django.conf.urls.defaults import *
ImportError: No module named defaults

Can be solved with directly importing, like

from django.conf.urls import patterns, url

Album uploads don't work with Amazon's S3 storage (using django-storages w/ boto)

trying to access the file's path won't work with remote storage providers, giving me this exception:

Request Method: POST
Request URL: http://localhost:8000/admin/imagestore/albumupload/add/

Django Version: 1.6.5
Python Version: 2.7.5
Installed Applications:
('djangocms_admin_style',
 'djangocms_text_ckeditor',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'cms',
 'mptt',
 'menus',
 'south',
 'sekizai',
 'djangocms_style',
 'djangocms_column',
 'djangocms_file',
 'djangocms_googlemap',
 'djangocms_inherit',
 'djangocms_link',
 'djangocms_picture',
 'reversion',
 'storages',
 'imagestore',
 'imagestore.imagestore_cms',
 'sorl.thumbnail',
 'tagging')
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')


Traceback:
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  432.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  99.                     response = view_func(request, *args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  52.         response = view_func(request, *args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  198.             return view(request, *args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  29.             return bound_func(*args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  99.                     response = view_func(request, *args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  25.                 return func(self, *args2, **kwargs2)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/db/transaction.py" in inner
  371.                 return func(*args, **kwargs)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
  1131.                 self.save_model(request, new_object, form, False)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/contrib/admin/options.py" in save_model
  860.         obj.save()
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/imagestore/models/upload.py" in save
  107.         upload_processor(self)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/imagestore/models/upload.py" in process_zipfile
  25.     if os.path.isfile(uploaded_album.zip_file.path):
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/db/models/fields/files.py" in _get_path
  59.         return self.storage.path(self.name)
File "/Users/roberkules/dev/me/portal/lib/python2.7/site-packages/django/core/files/storage.py" in path
  86.         raise NotImplementedError("This backend doesn't support absolute paths.")

Exception Type: NotImplementedError at /admin/imagestore/albumupload/add/
Exception Value: This backend doesn't support absolute paths.

ValueError: Cannot create form field for 'album' yet, because its related model 'imagestore.Album' has not been loaded yet

Trying to integrate with django-cms per the instructions. When I run manage.py for anything, I get this error: "ValueError: Cannot create form field for 'album' yet, because its related model 'imagestore.Album' has not been loaded yet"

Versions of components are as follows:
argparse (1.4.0)
dj-database-url (0.3.0)
Django (1.8.6)
django-appconf (1.0.1)
django-autocomplete-light (2.2.10)
django-classy-tags (0.6.2)
django-cms (3.1.3)
django-reversion (1.9.3)
django-sekizai (0.8.2)
Django-Select2 (4.3.2)
django-tagging (0.4)
django-treebeard (3.0)
django-user-accounts (1.2.0)
djangocms-admin-style (1.0.6)
djangocms-column (1.5)
djangocms-file (0.1)
djangocms-flash (0.2.0)
djangocms-googlemap (0.3)
djangocms-inherit (0.1)
djangocms-installer (0.8.1)
djangocms-link (1.7.1)
djangocms-picture (0.1)
djangocms-style (1.5)
djangocms-teaser (0.1)
djangocms-text-ckeditor (2.8.0)
djangocms-video (0.1)
html5lib (0.9999999)
imagestore (2.9.1)
Pillow (3.0.0)
pip (1.4.1)
pytz (2015.7)
setuptools (0.9.8)
six (1.10.0)
sorl-thumbnail (12.3)
swapper (0.3.0)
tzlocal (1.2)
wsgiref (0.1.2)

Exclude empty albums from album list (for non-owner)

Sometimes users create albums but do not upload images (sometimes they do it later). Though empty albums are not displayed to non-owner, they are still included in queryset in AlbumListView. Thus, e.g., if IMAGESTORE_ALBUMS_ON_PAGE = 12 and one of albums has no images (and therefore no head) and non-owner opens imagestore:index page, there will be only 11 albums on page.

By this reason some precisely built pages are displayed not very neat way. I suggest excluding such albums from queryset (to insert before return albums):

    if self.request.user.is_authenticated():
        albums = albums.exclude(Q(head__isnull=True), ~Q(user=self.request.user))
    else:
        albums = albums.exclude(head__isnull=True)

Django 1.6 Issue in views.py

from django.utils.functional import update_wrapper
ImportError: cannot import name update_wrapper

Django 1.6 relies on python versions that have update_wrapper already included. As a quick fix I just commented out the input. That of course is no option for backwards compatibility.

Pillow support

Pillow is a nicer-packaged, drop-in replacement for PIL that lacks a lot of PIL's bugs. It would be great if your setup.py script would allow for Pillow as an alternative to PIL.

Migration missing in app

Migrations for 'imagestore':
/home/patryk/workspace/.virtualenvs/t-33-3.6/lib/python3.6/site-packages/imagestore/migrations/0003_auto_20190614_0951.py
- Alter field zip_file on albumupload

ImportError: No module named defaults

Hi,

This error appears when using Django >= 1.6,
In the latest version of urls.py (https://github.com/hovel/imagestore/blob/master/imagestore/imagestore_cms/urls.py)
"django.conf.urls.defaults" is deprecated resulting in a "ImportError: No module named defaults"

Deprecation log Django >= 1.6:
https://docs.djangoproject.com/en/1.6/internals/deprecation/#id1
("django.conf.urls.defaults will be removed")

The solution is quite simple, just use "from django.conf.urls import *" instead of "from django.conf.urls.defaults import *"

This fix is essential for running with Django >= 1.6,
Hope this helps,
Cheers!

ImportError: No module named importlib

File "/home/vishnu/sarath/ev/local/lib/python2.7/site-packages/imagestore/models/bases/image.py", line 21, in
from imagestore.utils import FilePathGenerator
File "/home/vishnu/sarath/ev/local/lib/python2.7/site-packages/imagestore/utils.py", line 8, in
from django.utils.importlib import import_module

From django 1.9 onwards django.utils.importlib has been removed now its been changed to from importlib import import_module. Please fix this, and by the way awesome package.

Django 1.9 incompatibility.

When launching project this happens. For now it's Django 1.8 this will work, but in Django 1.9 this will fail to load.

/home/djangocms/djangocms/local/lib/python2.7/site-packages/imagestore/utils.py:8: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils.importlib import import_module

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.