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 1.9 compatibility #345

Merged
merged 14 commits into from
Dec 3, 2015
Merged

Conversation

dulacp
Copy link
Contributor

@dulacp dulacp commented Oct 29, 2015

As discussed in the #321, we can probably just use the caches and not django private method.

This pull request can be opened to bring Django 1.9 compatibility, as we highly need it I am ready to fix warnings and issues nearly daily basis.

Cheers

maybe the developer wants to test his cache configuration locally, or
maybe he has to test different types of caches, we just don't know
@dulacp dulacp changed the title Use a compat method to wrap the new way of retrieving the cache engine Django 1.9 compatibility Oct 29, 2015
# DEFAULT_CACHE_ALIAS doesn't exist in Django<=1.2
try:
from django.core.cache import DEFAULT_CACHE_ALIAS as default_cache_alias
from django.core.cache import DEFAULT_CACHE_ALIAS
default_cache_alias = DEFAULT_CACHE_ALIAS or 'default'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFAULT_CACHE_ALIAS is not a setting in Django. It is a constant from when it was introduced (in django 1.3) to nowadays. It was always 'default' and probably it will be allays 'default'. If the value changes for some reason probably the django cache framework will know what to do and we do not need to fallback to something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vstoykov for the explanation, very clear. I will restore the behavior then

@vstoykov
Copy link
Collaborator

The only place where tests are failing is for Django 1.2 @matthewwithanm need to tell us if he still want to support django 1.2 or we can drop the support.

Also this PR changes the way how imagekit cache backend is configured. Untill django 1.9 whith the get_cache function from django you can create completely new cache not described in CACHES (like you do in Django 1.2). With this change it will be possible to use only caches configured in CACHES (which I actually prefer and think that this is supposed way from Django 1.3).
For that reason I think that documentation must be changed also to reflect that.

@dulacp
Copy link
Contributor Author

dulacp commented Oct 30, 2015

Totally @vstoykov, we are on the same page. Me too I prefer the explicit caches rather than the implicit one. I will add some changes to the documentation.

Btw, @matthewwithanm the previous LTS was Django 1.4, the new LTS is Django 1.8, which means it would probably don't hurt to drop support for Django<1.4. And it would simplify the project code for sure.

Django Roadmap

I'm motivated to make those changes happen if you give your green light @matthewwithanm :)

Cheers

@dulacp
Copy link
Contributor Author

dulacp commented Oct 31, 2015

Btw, I've added Django 1.9 to the test envs, and improved the travis conf to split the test builds.

@jakobholmelund
Copy link

Please merge this :)

vstoykov added a commit that referenced this pull request Dec 3, 2015
Django 1.9 compatibility

Fixes #347 
Fixes #340 
Fixes #321 
Fixes #317
@vstoykov vstoykov merged commit d1e877f into matthewwithanm:develop Dec 3, 2015
@vstoykov
Copy link
Collaborator

vstoykov commented Dec 3, 2015

@matthewwithanm I merged this PR and closed other PRs and issues related to this. What you think about @bryanveloso to release new version in order users wanted to upgrade to Django 1.9 to do it?

@matthewwithanm
Copy link
Owner

DO IT 👍

@KevinGrahamFoster
Copy link

Bam! Thanks guys!

@bryanveloso
Copy link
Collaborator

3.3 is live. 💥

@vstoykov
Copy link
Collaborator

vstoykov commented Dec 8, 2015

Nice 😎

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

Successfully merging this pull request may close these issues.

6 participants