Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 4.0.1 Support #56

Open
dmcmulle opened this issue Jan 16, 2022 · 1 comment
Open

Django 4.0.1 Support #56

dmcmulle opened this issue Jan 16, 2022 · 1 comment

Comments

@dmcmulle
Copy link

dmcmulle commented Jan 16, 2022

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

@christianwgd
Copy link

christianwgd commented Jan 17, 2022

Your problem will vanish as soon as this is merged: #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants