Skip to content

get_current_site() will no longer be importable from django.contrib.sites.models #50

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

Closed
ghost opened this issue Jun 1, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2016

Hi
with django 1.9, an error occured when setting-up the application.

File "XXX/lib/python3.5/site-packages/password_policies/urls.py", line 3, in
from password_policies.views import PasswordChangeFormView
File "XXX/lib/python3.5/site-packages/password_policies/views.py", line 19, in
from password_policies.forms import PasswordPoliciesForm
File "XXX/lib/python3.5/site-packages/password_policies/forms/init.py", line 8, in
from django.contrib.sites.models import get_current_site
ImportError: cannot import name 'get_current_site

In Django Deprecation Timeline
https://docs.djangoproject.com/es/1.9/internals/deprecation/#deprecation-removed-in-1-9
there is the reason
"RequestSite and get_current_site() will no longer be importable from django.contrib.sites.models."

Is it possibile to fix it with

try:
    from django.contrib.sites.models import get_current_site
except ImportError:
    from django.contrib.sites.shortcuts import get_current_site

, correct?

Thank you
Pietro

@brianmay
Copy link

Django 1.9 was released December last year. Django 1.10 will be released in August. Any chance for a fix for this?

brianmay pushed a commit to brianmay/django-password-policies that referenced this issue Jul 1, 2016
@brianmay
Copy link

brianmay commented Jul 1, 2016

Looks like this was fixed in #49 (November 2015) - the fact nobody has responded to this ticket or made a new release would suggest this project is dead.

@tarak
Copy link
Owner

tarak commented Jul 1, 2016

Nope. Not dead. Just on a very much needed holiday. Will take care of
things next week when I get home...
On Jul 1, 2016 6:59 AM, "Brian May" [email protected] wrote:

Looks like this was fixed in #49
#49 (November
2015) - the fact nobody has responded to this ticket or made a new release
would suggest this project is dead.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADG1omYb4ClqfvTE5sMWSMwoitfxsWYks5qRJ6zgaJpZM4IrWhW
.

@tarak tarak closed this as completed in 1aa31f7 Jul 7, 2016
@andrijan
Copy link

Any news on this reaching pypi?

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

3 participants