Skip to content

Commit

Permalink
Merge pull request #61 from RandomJo/master
Browse files Browse the repository at this point in the history
Conditionally imports native json vs simplejson based on python version
  • Loading branch information
jose-lpa committed Jul 1, 2015
2 parents 99245a3 + 07e4261 commit f80a291
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
@@ -0,0 +1,4 @@
# django-filebrowser-no-grappelli
django-filebrowser for default Django admin site. Based on https://github.com/sehmaschine/django-filebrowser v3.1 (before it was in git) Consider using https://github.com/smacker/django-filebrowser-no-grappelli which is based on a newer version

This fork works with Django 1.8 by conditionally importing simplejson based on the pythong version.
8 changes: 6 additions & 2 deletions filebrowser/views.py
@@ -1,7 +1,7 @@
# coding: utf-8

# general imports
import os, re
import os, re, sys
from time import gmtime, strftime

# django imports
Expand Down Expand Up @@ -261,7 +261,11 @@ def _check_file(request):
Check if file already exists on the server.
"""

from django.utils import simplejson
if sys.version_info < (2, 6):
from django.utils import simplejson
else:
import json as simplejson


folder = request.POST.get('folder')
fb_uploadurl_re = re.compile(r'^.*(%s)' % reverse("fb_upload"))
Expand Down

0 comments on commit f80a291

Please sign in to comment.