Skip to content

Commit 76dda2c

Browse files
committed
Merge pull request sigurdga#59 from dolgiyspb/django-1.8
Django 1.8 support
2 parents d362c94 + 82155f3 commit 76dda2c

File tree

8 files changed

+29
-16
lines changed

8 files changed

+29
-16
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ db
77
/share
88
/env
99
/venv
10-
/django-jquery-file-upload
10+
1111
*.log
1212
*.pot
1313
*.pyc
1414
local_settings.py
15+
.idea
File renamed without changes.

settings.py renamed to django-jquery-file-upload/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
'django.middleware.csrf.CsrfViewMiddleware',
101101
'django.contrib.auth.middleware.AuthenticationMiddleware',
102102
'django.contrib.messages.middleware.MessageMiddleware',
103+
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
103104
)
104105

105106
ROOT_URLCONF = 'django-jquery-file-upload.urls'

urls.py renamed to django-jquery-file-upload/urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
url(r'^admin/', include(admin.site.urls)),
2020
)
2121

22-
import os
22+
from os.path import join, abspath, dirname
2323
urlpatterns += patterns('',
24-
(r'^media/(.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media')}),
24+
(r'^media/(.*)$', 'django.views.static.serve', {'document_root': join(abspath(dirname(dirname(__file__))), 'media')}),
2525
)

fileupload/response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# encoding: utf-8
22
from django.http import HttpResponse
3-
from django.utils import simplejson
3+
import json
44

55
MIMEANY = '*/*'
66
MIMEJSON = 'application/json'
@@ -34,5 +34,5 @@ def a_iew(request):
3434
"""
3535
def __init__(self, obj='', json_opts=None, mimetype=MIMEJSON, *args, **kwargs):
3636
json_opts = json_opts if isinstance(json_opts, dict) else {}
37-
content = simplejson.dumps(obj, **json_opts)
37+
content = json.dumps(obj, **json_opts)
3838
super(JSONResponse, self).__init__(content, mimetype, *args, **kwargs)

fileupload/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
class PictureCreateView(CreateView):
1212
model = Picture
13+
fields = "__all__"
1314

1415
def form_valid(self, form):
1516
self.object = form.save()

manage.py

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
#!/usr/bin/env python
2-
from django.core.management import execute_manager
3-
import imp
4-
try:
5-
imp.find_module('settings') # Assumed to be in the same directory.
6-
except ImportError:
7-
import sys
8-
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
9-
sys.exit(1)
2+
# from django.core.management import execute_manager
3+
# import imp
4+
# try:
5+
# imp.find_module('settings') # Assumed to be in the same directory.
6+
# except ImportError:
7+
# import sys
8+
# sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
9+
# sys.exit(1)
10+
#
11+
# import settings
12+
#
13+
# if __name__ == "__main__":
14+
# execute_manager(settings)
1015

11-
import settings
16+
#!/usr/bin/env python
17+
import os, sys
1218

1319
if __name__ == "__main__":
14-
execute_manager(settings)
20+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django-jquery-file-upload.settings")
21+
22+
from django.core.management import execute_from_command_line
23+
24+
execute_from_command_line(sys.argv)

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
django<1.6
1+
django
22
pillow

0 commit comments

Comments
 (0)