django-activeurl icon indicating copy to clipboard operation
django-activeurl copied to clipboard

Django 4.0.1 Support

Open dmcmulle opened this issue 3 years ago • 1 comments

Hello,

I am trying to add this library to my latest Django project (Django 4.0.1) on Python 3.10

I have followed the instructions but it seems some things in Django 4.0 have changed, and I am wondering if there is a way to continue making this library work with Django 4.

Here is the current status:

'TEMPLATES' variable seems to have changed a bit, I tried this:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['templates'],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.core.context_processors.request',
            ],
        },
    },
]

However, PyCharm is highlighting django.core.context_processors.request', so I imagine this needs to be corrected

The final error I am getting from python manage.py runserver is django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'django_activeurl.templatetags.activeurl': cannot import name 'urlquote' from 'django.utils.http' (/Users/me/.local/share/virtualenvs/my-project-KF_-XuuK/lib/python3.10/site-packages/django/utils/http.py)

Any ideas?

Thank you so much in advance for this wonderful library, and if there is any way I can contribute on adding an update to make django-activeurl work with Django 4, let me know.

Dalton

dmcmulle avatar Jan 16 '22 23:01 dmcmulle

Your problem will vanish as soon as this is merged: https://github.com/hellysmile/django-activeurl/pull/55. I don't think the request context processor as anything to do with this.

A workaround would be to install the package from my repo, where i fixed this: pip install git+https://github.com/christianwgd/django-activeurl.git@django40

christianwgd avatar Jan 17 '22 05:01 christianwgd