Skip to content

Commit

Permalink
Fixed Django 2.0 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
SeedyROM committed Feb 11, 2018
1 parent 41e3872 commit 061b64a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -38,4 +38,5 @@ nosetests.xml
db
env

.vscode/
.idea/*
9 changes: 7 additions & 2 deletions progressbarupload/templatetags/progress_bar.py
@@ -1,13 +1,18 @@
import uuid

from django import VERSION as DJANGO_VERSION
from django import template
from django.conf import settings
from django.forms.widgets import Media
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse

register = template.Library()
if DJANGO_VERSION[0] == 2:
from django.urls import reverse
else if DJANGO_VERSION[0] == 1:
from django.core.urlresolvers import reverse


register = template.Library()

@register.simple_tag
def progress_bar():
Expand Down

1 comment on commit 061b64a

@SeedyROM
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could use improvement, but as far as current development is concerned the major version number is more than likely to be sufficient.

Please sign in to comment.