Commit f8082d99 authored by Christos Stavrakakis's avatar Christos Stavrakakis

Request Django=>1.4, <1.5

Drop support for Django 1.2. Remove compatibility code that were used in
order to support Django 1.2 and 1.4. Finally update django documentation
link in the docs.
parent bf9d6a8f
......@@ -767,7 +767,7 @@ astakos they are defined in a different configuration file than the one
previously used to set astakos specific settings.
Refer to
`Django documentation <https://docs.djangoproject.com/en/1.2/topics/email/>`_
`Django documentation <https://docs.djangoproject.com/en/1.4/topics/email/>`_
for additional information on available email settings.
As refered in the previous section, based on the operation that triggers
......
......@@ -31,11 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, url
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
from snf_django.lib.api import api_endpoint_not_found
urlpatterns = patterns(
......
......@@ -31,11 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, url, include
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url, include
from django.conf.urls import patterns, url, include
from snf_django.lib.api import api_endpoint_not_found
......
......@@ -31,17 +31,11 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, url
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
from astakos.im.forms import (
ExtendedPasswordResetForm,
ExtendedPasswordChangeForm,
ExtendedSetPasswordForm, LoginForm)
from astakos.im import settings
urlpatterns = patterns(
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import url
except ImportError: # Django==1.2
from django.conf.urls.defaults import url
from django.conf.urls import url
urlpatterns = (
url(r'^login$', 'astakos.im.views.target.redirect.login',
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import include, patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import include, patterns
from django.conf.urls import include, patterns
from astakos.im.settings import (
BASE_PATH, ACCOUNTS_PREFIX, VIEWS_PREFIX, KEYSTONE_PREFIX, WEBLOGIN_PREFIX)
......
......@@ -65,7 +65,7 @@ CLASSIFIERS = [
# Package requirements
INSTALL_REQUIRES = [
'Django>=1.2, <1.5',
'Django>=1.4, <1.5',
'South>=0.7.3',
'httplib2>=0.6.0',
'snf-common',
......
......@@ -58,7 +58,7 @@ CLASSIFIERS = []
# Package requirements
INSTALL_REQUIRES = [
'Django >=1.2, <1.5',
'Django>=1.4, <1.5',
'simplejson>=2.1.1',
'pycurl>=7.19.0',
'python-dateutil>=1.4.1',
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import url, patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import url, patterns
from django.conf.urls import url, patterns
from synnefo.admin import views
from django.http import Http404
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
from django.http import HttpResponse
from django.utils import simplejson as json
......
......@@ -32,11 +32,7 @@
# or implied, of GRNET S.A.
from logging import getLogger
try:
from django.conf.urls import patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
from django.http import HttpResponse
from django.template.loader import render_to_string
......
......@@ -36,11 +36,7 @@ from itertools import ifilter
from dateutil.parser import parse as date_parse
try:
from django.conf.urls import patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils import simplejson as json
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from django.conf import settings
try:
from django.conf.urls import patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
from django.db.models import Q
from django.http import HttpResponse
......
......@@ -32,10 +32,7 @@
# or implied, of GRNET S.A.
from django.conf import settings
try:
from django.conf.urls import patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
from django.db import transaction
from django.http import HttpResponse
......
......@@ -31,11 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import include, patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import include, patterns
from django.conf.urls import include, patterns
from snf_django.lib.api import api_endpoint_not_found
from synnefo.api import (servers, flavors, images, networks, extensions,
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, include
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, include
from django.conf.urls import patterns, include
from snf_django.lib.api.proxy import proxy
from snf_django.lib.api.utils import prefix_pattern
......
try:
from django.conf.urls import patterns, url
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, include
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, include
from django.conf.urls import patterns, include
from django.http import HttpResponseNotAllowed
from snf_django.lib.api import api_endpoint_not_found
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
#
try:
from django.conf.urls import patterns, url
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
from django.conf import settings
......
......@@ -32,10 +32,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, url
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
from synnefo.userdata import views
from django.http import Http404
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, url
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, url
from django.conf.urls import patterns, url
from snf_django.lib.api import api_endpoint_not_found
......
......@@ -58,7 +58,7 @@ CLASSIFIERS = []
# Package requirements
INSTALL_REQUIRES = [
'Django >=1.2, <1.5',
'Django>=1.4, <1.5',
'simplejson>=2.1.1',
'astakosclient',
'snf-common',
......
......@@ -190,13 +190,9 @@ def update_response_headers(request, response):
response["Date"] = format_date_time(time())
if not response.has_header("Content-Length"):
# compatibility code for django 1.4
_is_string = getattr(response, '_is_string', None) # Django==1.2
_base_content_is_iter = getattr(response, '_base_content_is_iter',
None)
if (_is_string is not None and _is_string) or\
(_base_content_is_iter is not None and
not _base_content_is_iter):
if (_base_content_is_iter is not None and not _base_content_is_iter):
response["Content-Length"] = len(response.content)
else:
if not (response.has_header('Content-Type') and
......
......@@ -33,10 +33,7 @@
from django.core import urlresolvers
from django.views.decorators import csrf
try:
from django.conf.urls import patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
def _patch_pattern(regex_pattern):
......@@ -45,25 +42,15 @@ def _patch_pattern(regex_pattern):
RegexURLPattern callback to get resolved if required.
"""
if hasattr(regex_pattern, "_get_callback"): # Django==1.2
if not regex_pattern._callback:
# enforce _callback resolving
regex_pattern._get_callback()
regex_pattern._callback = \
csrf.csrf_exempt(regex_pattern._callback)
else:
regex_pattern._callback = \
csrf.csrf_exempt(regex_pattern.callback)
regex_pattern._callback = \
csrf.csrf_exempt(regex_pattern.callback)
def _patch_resolver(r):
"""
Patch all patterns found in resolver with _patch_pattern
"""
if hasattr(r, '_get_url_patterns'): # Django ==1.2
entries = r._get_url_patterns()
elif hasattr(r, 'url_patterns'):
if hasattr(r, 'url_patterns'):
entries = r.url_patterns
else:
# first level view in patterns ?
......
......@@ -31,11 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import url, patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import url, patterns
from django.conf.urls import url, patterns
from snf_django.lib.api.utils import prefix_pattern
from synnefo.lib.services import get_service_path
......
......@@ -32,10 +32,7 @@
# or implied, of GRNET S.A.
from functools import partial
try:
from django.conf.urls import include, patterns
except ImportError: # Django==1.2
from django.conf.urls.defaults import include, patterns
from django.conf.urls import include, patterns
from snf_django.lib.api.proxy import proxy
from snf_django.lib.api.utils import prefix_pattern
......
......@@ -60,7 +60,7 @@ CLASSIFIERS = []
INSTALL_REQUIRES = [
'snf-common',
'snf-pithos-backend',
'Django>=1.2, <1.5',
'Django>=1.4, <1.5',
'objpool>=0.3',
'astakosclient',
'snf-django-lib',
......
......@@ -57,7 +57,7 @@ CLASSIFIERS = []
INSTALL_REQUIRES = [
'gdmodule',
'py-rrdtool',
'Django>=1.2, <=1.5',
'Django>=1.4, <1.5',
'snf-django-lib',
]
......
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
try:
from django.conf.urls import patterns, include
except ImportError: # Django==1.2
from django.conf.urls.defaults import patterns, include
from django.conf.urls import patterns, include
from snf_django.lib.api.utils import prefix_pattern
from snf_django.lib.api import api_endpoint_not_found
......
......@@ -58,7 +58,7 @@ CLASSIFIERS = []
# Package requirements
INSTALL_REQUIRES = [
'Django >=1.2, <1.5',
'Django>=1.4, <1.5',
'snf-common',
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment