Giter Site home page Giter Site logo

piotrkilczuk / cmsplugin_gallery Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 39.0 245 KB

Simple photo gallery plugin for DjangoCMS

Home Page: https://github.com/piotrkilczuk/cmsplugin_gallery

License: BSD 2-Clause "Simplified" License

Python 88.93% HTML 2.69% Makefile 8.38%

cmsplugin_gallery's People

Contributors

crydotsnake avatar dgaus avatar dlernstrom avatar driesdesmet avatar eserge avatar k-funk avatar lalomartins avatar piotrkilczuk avatar shagi avatar vinitkumar 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cmsplugin_gallery's Issues

TypeError: __init__() missing 1 required positional argument: 'on_delete'

Django==3.1.6
django-cms==3.8.0
cmsplugin_gallery==1.1.7

Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/usr/local/lib/python3.8/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/usr/local/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "/usr/local/lib/python3.8/site-packages/cmsplugin_gallery/models.py", line 74, in
class Image(Orderable):
File "/usr/local/lib/python3.8/site-packages/cmsplugin_gallery/models.py", line 97, in Image
gallery = models.ForeignKey(GalleryPlugin, verbose_name=
("Gallery"))
TypeError: init() missing 1 required positional argument: 'on_delete'

After setting workaround from #51 cannot migrate due to error above.

TemplateSyntaxError

Hello, I use DjangoCMS 2.3, I got such error: "'thumbnail' is not a valid tag library: Template library thumbnail not found, tried django.templatetags.thumbnail,django.contrib.comments.templatetags.thumbnail,django.contrib.admin.templatetags.... "

In template /usr/local/lib/python2.7/site-packages/cmsplugin_gallery/templates/cmsplugin_gallery/gallery.html, error at line 1

What can I do?

Remove pyc

There are still some, for example in migrations

Installation error: History.md file not found

Hello 👋🏽

When installing the package i get the following error message:

      ERROR: Command errored out with exit status 1:
       command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-resolver-bj15b83e/cmsplugin-gallery/setup.py'"'"'; __file__='"'"'/tmp/pip-resolver-bj15b83e/cmsplugin-gallery/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-asqyw_3g
           cwd: /tmp/pip-resolver-bj15b83e/cmsplugin-gallery/
      Complete output (5 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-resolver-bj15b83e/cmsplugin-gallery/setup.py", line 35, in <module>
          with open("History.md") as history_file:
      FileNotFoundError: [Errno 2] No such file or directory: 'History.md'
      ----------------------------------------
Traceback (most recent call last):
  File "/usr/local/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/piptools/scripts/compile.py", line 452, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "/usr/local/lib/python3.9/site-packages/piptools/resolver.py", line 178, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python3.9/site-packages/piptools/resolver.py", line 275, in _resolve_one_round
    their_constraints.extend(self._iter_dependencies(best_match))
  File "/usr/local/lib/python3.9/site-packages/piptools/resolver.py", line 385, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/usr/local/lib/python3.9/site-packages/piptools/repositories/pypi.py", line 247, in get_dependencies
    self._dependencies_cache[ireq] = self.resolve_reqs(
  File "/usr/local/lib/python3.9/site-packages/piptools/repositories/pypi.py", line 203, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 385, in _resolve_one
    dist = self._get_dist_for(req_to_install)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 337, in _get_dist_for
    dist = self.preparer.prepare_linked_requirement(req)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 523, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 88, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 41, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 555, in prepare_metadata
    self.metadata_directory = self._generate_metadata()
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 530, in _generate_metadata
    return generate_metadata_legacy(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 70, in generate_metadata
    call_subprocess(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py", line 240, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Container exited with error code 1

As I can see the History.md file exists in the repository. So maybe it needs to be included in the MANIFEST.in file?

AttributeError: 'Settings' object has no attribute 'TEMPLATE_LOADERS'

Fresh install of Django 1.11.15, cms 3.5.2, filer 1.3.2. After running makemigrations:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/Users/tehfink/…/virtualenv/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/cmsplugin_gallery/models.py", line 22, in <module>
    localdata.TEMPLATE_CHOICES = utils.autodiscover_templates()
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/cmsplugin_gallery/utils.py", line 41, in autodiscover_templates
    if 'django.template.loaders.app_directories.Loader' in settings.TEMPLATE_LOADERS:
  File "/Users/tehfink/…/virtualenv/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'TEMPLATE_LOADERS'

According to the Django docs, TEMPLATE_LOADERS may not necessarily be defined, and it seems that the template settings in 1.11 are namespaced in a dict. The following seems to function as a workaround:

TEMPLATE_LOADERS = TEMPLATES[0]['OPTIONS']['loaders']
TEMPLATE_DIRS = TEMPLATES[0]['DIRS']

Documentation: admin template override

Right now, the admin console seems to be defaulting to the original gallery.html template, which, in the admin console, shows all thumbnails and all full size images, which is pretty cumbersome.

I've tried placing a new template (also named gallery.html, just in case) in templates/admin/cmsplugin_gallery/ and in templates/cmsplugin_gallery/admin/, to no avail. Can anyone provide some documentation/guidance to help out with this?

Django filer support

This is not a bug, not even a feature request :-)

I forked this code to add support to django-filer, and I realised that the only required changes were 2 lines in models.py and some south migrations. Look at http://github.com/shagi/cmsplugin_gallery_filer for an example, db5175a commit.

Is there any way to support current models.py AND filer-enabled models.py? Maybe with something in settings.py, some django command...

I havent found a good solution to this, but it would be awesome if both ways could be supported. I can help with coding or maintenance.

'TemporaryFile' object has no attribute 'closed'

Hi, i have a small problem.
When I add more inline photo, django cms show errors:

'TemporaryFile' object has no attribute 'closed'

How resolved this problem?

Logs:
c:\Python27\lib\site-packages\cms\admin\pageadmin.py in edit_plugin
response = plugin_admin.change_view(request, str(plugin_id))

django-cms 2.4.2 aand django 1.5.4

Migrate the ImageField to FilerImageField

Most of the core plugins in djangoCMS ecosystem as moved to filer based fields for the ease of use and other benefits of the filer. So I propose that we do this upgrade this field in these steps:

  • Add a new filer based field.
  • Write a data migration to copy existing data to new filer based fields.
  • Delete the old field and add the migration to it.
  • Update the template to use the new fields.

If anybody has any suggestion and feedback, feel free to reply to this issue.

'DatabaseWrapper' object has no attribute 'schema_name'

When I'm saving the gallery i get this error.

'DatabaseWrapper' object has no attribute 'schema_name'

I'm using Postgres and my database settings are:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'name',
        'USER': 'user',
        'PASSWORD': '',
        'HOST': '127.0.0.1',
        'PORT': '5432',
    }
  File "/home/juro/work/prog/web/dj/weblso/.env/lib/python2.7/site-packages/cmsplugin_gallery/models.py", line 27, in __call__          
    if connection.schema_name:

Any help? Thank you.

Do not install tests

Please, do not install tests. They end up in site-packages/tests and might get imported.

--- setup.py.orig
+++ setup.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-from setuptools import find_packages, setup
+from setuptools import setup
 
 setup(
     name='cmsplugin_gallery',
@@ -11,8 +11,8 @@ setup(
     description = 'DjangoCMS image gallery plugin with drag&drop '
                   'reordering in admin, support for thumbnails and '
                   'jQueryTOOLS overlay.',
-    packages=find_packages(),
-    provides=['cmsplugin_gallery', ],
+    packages=['cmsplugin_gallery'],
+    provides=['cmsplugin_gallery'],
     include_package_data=True,
     install_requires = ['django-inline-ordering>=0.1.1', 'easy-thumbnails',]
 )

Override hard-coded default template.

Few days ago @tvaughan send me a pull request to change how default gallery template is chosen.

I think this could be interesting to cmsplugin_gallery too, take a look at this commit:
tvaughan/cmsplugin_gallery_filer@41cf9b78993380be487630584307a61b3839413c

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.