Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit cb2855e

Browse files
committed
Merge branch 'feature/django19'
2 parents b6d8007 + 038d7b0 commit cb2855e

File tree

8 files changed

+64
-40
lines changed

8 files changed

+64
-40
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ docs/_build/
4646
target/
4747
*.sqlite3
4848
pep8.txt
49+
.eggs
50+
.ropeproject

.travis.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ language: python
33
python:
44
- 2.7
55
- 3.4
6+
- 3.5
7+
- 3.6
68

79
env:
8-
- DJANGO=1.4.16
9-
- DJANGO=1.5.11
10-
- DJANGO=1.6.8
11-
- DJANGO=1.7.1
12-
- DJANGO=1.8.11
13-
14-
matrix:
15-
exclude:
16-
- python: 3.4
17-
env: DJANGO=1.4.16
10+
- DJANGO=1.8.17
11+
- DJANGO=1.9.13
12+
- DJANGO=1.10.8
13+
- DJANGO=1.11.9
1814

1915
install:
16+
- pip install pip --upgrade
17+
- pip install setuptools --upgrade
2018
- pip install Django==$DJANGO
2119
- pip install -e .
2220

23-
script:
24-
- python setup.py test
21+
script:
22+
- demo/manage.py test nocaptcha_recaptcha

MANIFEST.in

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ include LICENSE
33
include README.md
44
include MANIFEST.in
55
include setup.py
6-
include test_settings.py
76
recursive-include demo *
87
recursive-include nocaptcha_recaptcha *
98
recursive-exclude * __pycache__

demo/demo/settings.py

+43-16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Django settings for demo project.
22
import os
33
import sys
4+
from django import VERSION
45

56
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ))
67
sys.path.insert(0, os.path.join(PROJECT_ROOT, '..', '..'))
78

89
DEBUG = True
9-
TEMPLATE_DEBUG = DEBUG
1010

1111
ADMINS = (
1212
# ('Your Name', 'your_email@example.com'),
@@ -94,12 +94,6 @@
9494
# Make this unique, and don't share it with anybody.
9595
SECRET_KEY = 'x$47^-hmv-kaa0trcc*ry%+b^^2f)$rs#cl)6j&!)j2c&h%88e'
9696

97-
# List of callables that know how to import templates from various sources.
98-
TEMPLATE_LOADERS = (
99-
'django.template.loaders.filesystem.Loader',
100-
'django.template.loaders.app_directories.Loader',
101-
# 'django.template.loaders.eggs.Loader',
102-
)
10397

10498
MIDDLEWARE_CLASSES = (
10599
'django.middleware.common.CommonMiddleware',
@@ -116,12 +110,47 @@
116110
# Python dotted path to the WSGI application used by Django's runserver.
117111
WSGI_APPLICATION = 'demo.wsgi.application'
118112

119-
TEMPLATE_DIRS = (
120-
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
121-
# Always use forward slashes, even on Windows.
122-
# Don't forget to use absolute paths, not relative paths.
123-
os.path.join(PROJECT_ROOT, 'templates'),
124-
)
113+
114+
if VERSION >= (1, 8, 0):
115+
116+
TEMPLATES = [
117+
{
118+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
119+
'DIRS': [
120+
os.path.join(PROJECT_ROOT, 'templates'),
121+
],
122+
'APP_DIRS': True,
123+
'OPTIONS': {
124+
'context_processors': [
125+
'django.contrib.auth.context_processors.auth',
126+
'django.template.context_processors.i18n',
127+
'django.template.context_processors.request',
128+
'django.template.context_processors.media',
129+
'django.template.context_processors.static',
130+
'django.contrib.messages.context_processors.messages',
131+
'example.apps.core.context_processors.site',
132+
],
133+
},
134+
},
135+
]
136+
else:
137+
138+
TEMPLATE_DEBUG = DEBUG
139+
140+
# List of callables that know how to import templates from various sources.
141+
TEMPLATE_LOADERS = (
142+
'django.template.loaders.filesystem.Loader',
143+
'django.template.loaders.app_directories.Loader',
144+
# 'django.template.loaders.eggs.Loader',
145+
)
146+
147+
TEMPLATE_DIRS = (
148+
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
149+
# Always use forward slashes, even on Windows.
150+
# Don't forget to use absolute paths, not relative paths.
151+
os.path.join(PROJECT_ROOT, 'templates'),
152+
)
153+
125154

126155
INSTALLED_APPS = (
127156
'django.contrib.auth',
@@ -136,10 +165,8 @@
136165

137166
# Only needed for running unit tests
138167
'nocaptcha_recaptcha',
139-
'django_nose',
140168
)
141169

142-
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
143170

144171
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
145172

@@ -182,4 +209,4 @@
182209
}
183210

184211
NORECAPTCHA_SITE_KEY = os.environ.get('NORECAPTCHA_SITE_KEY', "")
185-
NORECAPTCHA_SECRET_KEY = os.environ.get('NORECAPTCHA_SECRET_KEY', "")
212+
NORECAPTCHA_SECRET_KEY = os.environ.get('NORECAPTCHA_SECRET_KEY', "")

demo/demo/urls.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from django.contrib import admin
2-
from django.conf.urls import patterns, include, url
2+
from django.conf.urls import include, url
33
from django.views.generic import TemplateView
44

55
from . import views
66

77
admin.autodiscover()
88

9-
urlpatterns = patterns(
10-
'',
9+
urlpatterns = [
1110

1211
url(r'^$', views.DemoView.as_view(template_name="index.html"), {},
1312
name="index"),
@@ -16,4 +15,4 @@
1615

1716
# Uncomment the next line to enable the admin:
1817
url(r'^admin/', include(admin.site.urls)),
19-
)
18+
]

demo/requirements.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
Django>=1.5
2-
django-nose>=1.2
1+
Django>=1.5,<1.11
32
mock>=1.0.1
4-
nose>=1.3.4
53
six>=1.8.0

nocaptcha_recaptcha/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import django
44

5-
if django.VERSION[1] >= 5:
5+
try:
66
import json
7-
else:
7+
except ImportError:
88
from django.utils import simplejson as json
99

1010
from django.conf import settings

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def read(fname):
88

99
setup(
1010
name='django-nocaptcha-recaptcha',
11-
version='0.0.19',
11+
version='0.0.20',
1212
description='Django nocaptcha recaptcha form field/widget app.',
1313
long_description=read('README.md'),
1414
author='Imaginary Landscape',
@@ -18,7 +18,6 @@ def read(fname):
1818
url='https://github.com/ImaginaryLandscape/django-nocaptcha-recaptcha',
1919
packages=find_packages(),
2020
tests_require=[
21-
'django-setuptest>=0.1',
2221
'mock',
2322
],
2423
test_suite="setuptest.setuptest.SetupTestSuite",
@@ -31,6 +30,8 @@ def read(fname):
3130
"Programming Language :: Python :: 2.6",
3231
"Programming Language :: Python :: 2.7",
3332
"Programming Language :: Python :: 3.4",
33+
"Programming Language :: Python :: 3.5",
34+
"Programming Language :: Python :: 3.6",
3435
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
3536
],
3637
zip_safe=False,

0 commit comments

Comments
 (0)