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

Fixed imports and url patterns to support django >= 1.10 #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dj_elastictranscoder/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from django.db import models
from django.contrib.contenttypes.models import ContentType
import django
if django.get_version() >= '1.8':

try:
from django.contrib.contenttypes.fields import GenericForeignKey
else:
except ImportError:
from django.contrib.contenttypes.generic import GenericForeignKey


Expand Down
18 changes: 14 additions & 4 deletions dj_elastictranscoder/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import django

from dj_elastictranscoder.views import endpoint as transcoder_endpoint

try:
from django.conf.urls import url, patterns
except ImportError:
from django.conf.urls.defaults import url, patterns # Support for Django < 1.4
try:
from django.conf.urls.defaults import url, patterns # Support for Django < 1.4
except ImportError:
from django.conf.urls import url

urlpatterns = patterns('dj_elastictranscoder.views',
url(r'^endpoint/$', 'endpoint'),
)
if django.VERSION[0] >= 1 and django.VERSION[1] >= 10:
urlpatterns = (url(r'^endpoint/$', transcoder_endpoint, name='transcoder_endpoint'),)
else:
urlpatterns = patterns('dj_elastictranscoder.views',
url(r'^endpoint/$', 'endpoint'),
)