Skip to content

Commit fb3b77d

Browse files
committed
Convert to Django 1.6
1 parent 9eaa47e commit fb3b77d

File tree

8 files changed

+111
-162
lines changed

8 files changed

+111
-162
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
db
22
/media
3+
/django-jquery-file-upload/media
34
/bin
45
/include
56
/lib
@@ -10,4 +11,4 @@ db
1011
*.log
1112
*.pot
1213
*.pyc
13-
local_settings.py
14+
local_settings.py

django-jquery-file-upload/__init__.py

Whitespace-only changes.

django-jquery-file-upload/settings.py

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
"""
2+
Django settings for django-jquery-file-upload project.
3+
4+
For more information on this file, see
5+
https://docs.djangoproject.com/en/1.6/topics/settings/
6+
7+
For the full list of settings and their values, see
8+
https://docs.djangoproject.com/en/1.6/ref/settings/
9+
"""
10+
11+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12+
import os
13+
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
14+
15+
16+
# Quick-start development settings - unsuitable for production
17+
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
18+
19+
# SECURITY WARNING: keep the secret key used in production secret!
20+
SECRET_KEY = '9%$in^gpdaig@v3or_to&_z(=n)3)$f1mr3hf9e#kespy2ajlo'
21+
22+
# SECURITY WARNING: don't run with debug turned on in production!
23+
DEBUG = True
24+
25+
TEMPLATE_DEBUG = True
26+
27+
ALLOWED_HOSTS = []
28+
29+
30+
# Application definition
31+
32+
INSTALLED_APPS = (
33+
'django.contrib.admin',
34+
'django.contrib.auth',
35+
'django.contrib.contenttypes',
36+
'django.contrib.sessions',
37+
'django.contrib.messages',
38+
'django.contrib.staticfiles',
39+
'fileupload',
40+
)
41+
42+
43+
MIDDLEWARE_CLASSES = (
44+
'django.contrib.sessions.middleware.SessionMiddleware',
45+
'django.middleware.common.CommonMiddleware',
46+
'django.middleware.csrf.CsrfViewMiddleware',
47+
'django.contrib.auth.middleware.AuthenticationMiddleware',
48+
'django.contrib.messages.middleware.MessageMiddleware',
49+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
50+
)
51+
52+
ROOT_URLCONF = 'django-jquery-file-upload.urls'
53+
54+
WSGI_APPLICATION = 'django-jquery-file-upload.wsgi.application'
55+
56+
57+
# Database
58+
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
59+
60+
DATABASES = {
61+
'default': {
62+
'ENGINE': 'django.db.backends.sqlite3',
63+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
64+
}
65+
}
66+
67+
# Internationalization
68+
# https://docs.djangoproject.com/en/1.6/topics/i18n/
69+
70+
LANGUAGE_CODE = 'en-us'
71+
72+
TIME_ZONE = 'UTC'
73+
74+
USE_I18N = True
75+
76+
USE_L10N = True
77+
78+
USE_TZ = True
79+
80+
81+
# Static files (CSS, JavaScript, Images)
82+
# https://docs.djangoproject.com/en/1.6/howto/static-files/
83+
84+
STATIC_URL = '/static/'
85+
MEDIA_URL = '/media/'
86+
MEDIA_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/media/'
File renamed without changes.

django-jquery-file-upload/wsgi.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
WSGI config for django-jquery-file-upload project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django-jquery-file-upload.settings")
12+
13+
from django.core.wsgi import get_wsgi_application
14+
application = get_wsgi_application()

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)

manage.py

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
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)
10-
11-
import settings
2+
import os
3+
import sys
124

135
if __name__ == "__main__":
14-
execute_manager(settings)
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django-jquery-file-upload.settings")
7+
8+
from django.core.management import execute_from_command_line
9+
10+
execute_from_command_line(sys.argv)

settings.py

-148
This file was deleted.

0 commit comments

Comments
 (0)