Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Django 1.8 #59

Merged
merged 4 commits into from
May 23, 2015
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ db
/share
/env
/venv
/django-jquery-file-upload

*.log
*.pot
*.pyc
local_settings.py
.idea
File renamed without changes.
1 change: 1 addition & 0 deletions settings.py → django-jquery-file-upload/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
)

ROOT_URLCONF = 'django-jquery-file-upload.urls'
Expand Down
4 changes: 2 additions & 2 deletions urls.py → django-jquery-file-upload/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
url(r'^admin/', include(admin.site.urls)),
)

import os
from os.path import join, abspath, dirname
urlpatterns += patterns('',
(r'^media/(.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media')}),
(r'^media/(.*)$', 'django.views.static.serve', {'document_root': join(abspath(dirname(dirname(__file__))), 'media')}),
)
4 changes: 2 additions & 2 deletions fileupload/response.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
from django.http import HttpResponse
from django.utils import simplejson
import json

MIMEANY = '*/*'
MIMEJSON = 'application/json'
Expand Down Expand Up @@ -34,5 +34,5 @@ def a_iew(request):
"""
def __init__(self, obj='', json_opts=None, mimetype=MIMEJSON, *args, **kwargs):
json_opts = json_opts if isinstance(json_opts, dict) else {}
content = simplejson.dumps(obj, **json_opts)
content = json.dumps(obj, **json_opts)
super(JSONResponse, self).__init__(content, mimetype, *args, **kwargs)
1 change: 1 addition & 0 deletions fileupload/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

class PictureCreateView(CreateView):
model = Picture
fields = "__all__"

def form_valid(self, form):
self.object = form.save()
Expand Down
30 changes: 20 additions & 10 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
#!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
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__)
sys.exit(1)
# from django.core.management import execute_manager
# import imp
# try:
# imp.find_module('settings') # Assumed to be in the same directory.
# except ImportError:
# import sys
# 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__)
# sys.exit(1)
#
# import settings
#
# if __name__ == "__main__":
# execute_manager(settings)

import settings
#!/usr/bin/env python
import os, sys

if __name__ == "__main__":
execute_manager(settings)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django-jquery-file-upload.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django<1.6
django
pillow