djradicale icon indicating copy to clipboard operation
djradicale copied to clipboard

Missing support for Radicale 2.x

Open khamaileon opened this issue 7 years ago • 10 comments

I have this error when I try to install djradicale:

(project-api) me@ubuntu:~/workspace/project/api/src$ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/me/.virtualenvs/project-api/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/home/me/.virtualenvs/project-api/lib/python3.5/site-packages/django/core/management/__init__.py", line 337, in execute
    django.setup()
  File "/home/me/.virtualenvs/project-api/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/me/.virtualenvs/project-api/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/me/.virtualenvs/project-api/lib/python3.5/site-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/home/me/.virtualenvs/project-api/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/me/.virtualenvs/project-api/lib/python3.5/site-packages/djradicale/__init__.py", line 43, in <module>
    radicale.config.__class__ = HashableConfigParser
TypeError: __class__ assignment only supported for heap types or ModuleType subclasses

python 3.5.2 django==1.11.1 djradicale==0.0.13 radicale==2.0.0

khamaileon avatar May 29 '17 17:05 khamaileon

Looks like a config parser has a lot of changes with Radicale 2.0 release. I don't have enough time to update DjRadicale to work with the latest Radicale version. The last working version was 1.1.1, so you have to downgrade the Radicale.

kyokenn avatar Jun 06 '17 09:06 kyokenn

Issue's title should be changed to something like "Missing support for Radicale 2.x"

Agno94 avatar Aug 25 '17 22:08 Agno94

Hello, do you think it's only a config parser problem or the main structure of radicale 2 is dramaticaly modified ?In other words, do you think working on update the code for using with the last radicale version is a lot of work ? I would try to proposeyou my time to do that, but not sure of how hard is the work to be done.

Auroch avatar Sep 26 '17 09:09 Auroch

It's not only the config parser problem. Radicale 2 has changed a lot. They rewrited almost everything. I has started porting my project to radicale 2, but I don't have much time to finish this. I'm thinking about pushing my unfinished changes to the separate branch, so it can be helpful for someone to finish this. It's not that hard, the internal API is still recognizable.

kyokenn avatar Sep 26 '17 11:09 kyokenn

It's a good idea, I'm looking forward your commit !

Auroch avatar Sep 27 '17 08:09 Auroch

Ok. I has pushed my changes into radicale2 branch. The storage backend has to be rewritten to fit the new storage.BaseCollection API.

kyokenn avatar Sep 27 '17 10:09 kyokenn

Excellent, thanx a lot. I'll see what i can do but i'm just a beginner so it'll take some time. Could you tell me what's already working in your new code and even what needs to be done for achieving your work ?

Auroch avatar Oct 01 '17 15:10 Auroch

As I said before the storage backend has to be rewritten (djradicale/storage/django.py). It will be a new class - Collection, which extends radicale.storage.BaseCollection. The methods of the current class has to be renamed or rewrited.

kyokenn avatar Oct 02 '17 19:10 kyokenn

@Auroch I'm starting to use this module for a project, but I have try it a little bit more. If I can help, don't hesitate to contact me.

ajira86 avatar Oct 16 '17 21:10 ajira86

Seems to me that the "customer_handler" is not supported anymore at least for authentification in radicale V2.8, does someone knows something about this ?

`Internal` Server Error: /pim/ksharp.bdf
Traceback (most recent call last):
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/radicale/auth.py", line 80, in load
    class_ = import_module(auth_type).Auth
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named 'custom'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/django/views/generic/base.py", line 63, in view
    self = cls(**initkwargs)
  File "/Users/r3/PycharmProjects/sharpness-django_agenda/djradicale/views.py", line 63, in __init__
    super(DjRadicaleView, self).__init__(configuration, logger)
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/radicale/__init__.py", line 240, in __init__
    self.Auth = auth.load(configuration, logger)
  File "/Users/r3/.pyenv/versions/3.4.1/lib/python3.4/site-packages/radicale/auth.py", line 83, in load
    (auth_type, e)) from e
RuntimeError: Failed to load authentication module 'custom': No module named 'custom'

The import module method does not succeed at all...

def load(configuration, logger):
    """Load the authentication manager chosen in configuration."""
    auth_type = configuration.get("auth", "type")
    if auth_type in ("None", "none"):  # DEPRECATED: use "none"
        class_ = NoneAuth
    elif auth_type == "remote_user":
        class_ = RemoteUserAuth
    elif auth_type == "http_x_remote_user":
        class_ = HttpXRemoteUserAuth
    elif auth_type == "htpasswd":
        class_ = Auth
    else:
        try:
            class_ = import_module(auth_type).Auth
        except Exception as e:
            raise RuntimeError("Failed to load authentication module %r: %s" %
                               (auth_type, e)) from e
    logger.info("Authentication type is %r", auth_type)
    return class_(configuration, logger)

R3D2 avatar Feb 20 '18 20:02 R3D2

Ported to radicale 3.0

kyokenn avatar Dec 14 '22 12:12 kyokenn