-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
439 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
*.pyc | ||
*pip* | ||
*.egg-info | ||
dist | ||
# Cherry-picked from: | ||
# https://github.com/github/gitignore/blob/master/Python.gitignore | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packacking | ||
*.egg-info/ | ||
build/ | ||
dist/ | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
sudo: no | ||
language: python | ||
cache: pip | ||
matrix: | ||
include: | ||
- python: "2.7" | ||
env: TOXENV=py27-1.8 | ||
- python: "3.5" | ||
env: TOXENV=py34-1.8 | ||
- python: "2.7" | ||
env: TOXENV=py27-1.9 | ||
- python: "3.5" | ||
env: TOXENV=py35-1.9 | ||
- python: "2.7" | ||
env: TOXENV=py27-1.10 | ||
- python: "3.5" | ||
env: TOXENV=py35-1.10 | ||
- python: "2.7" | ||
env: TOXENV=py27-1.11 | ||
- python: "3.6" | ||
env: TOXENV=py36-1.11 | ||
- python: "3.6" | ||
env: TOXENV=py36-master | ||
allow_failures: | ||
- env: TOXENV=py36-master | ||
install: | ||
- pip install coveralls tox | ||
script: | ||
- tox | ||
after_success: coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Release History | ||
--------------- | ||
|
||
v0.2.0 - 2017-02-17 | ||
~~~~~~~~~~~~~~~~~~~ | ||
* Supported Django versions: 1.8, 1.9, 1.10, and 1.11 | ||
* Supported Python versions: 2.7, 3.3, 3.4. 3.5, 3.6 | ||
* Add "DNT" to Vary header in response (eillarra) | ||
|
||
v0.1.0 - 2011-02-16 | ||
~~~~~~~~~~~~~~~~~~~ | ||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
include HISTORY.rst | ||
include LICENSE | ||
include Makefile | ||
include README.rst | ||
include manage.py | ||
include requirements.dev.txt | ||
include tox.ini | ||
|
||
recursive-include testapp *.py | ||
recursive-include testapp/templates *.html | ||
recursive-include tests *.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export DJANGO_SETTINGS_MODULE = testapp.settings | ||
export PYTHONPATH := $(shell pwd) | ||
.PHONY: help clean coverage coveragehtml develop lint qa qa-all release sdist test test-all | ||
|
||
help: | ||
@echo "clean - remove all artifacts" | ||
@echo "coverage - check code coverage" | ||
@echo "coveragehtml - display code coverage in browser" | ||
@echo "develop - install development requirements" | ||
@echo "lint - check style with flake8" | ||
@echo "qa - run linters and test coverage" | ||
@echo "qa-all - run QA plus tox and packaging" | ||
@echo "release - package and upload a release" | ||
@echo "sdist - package" | ||
@echo "test - run tests" | ||
@echo "test-all - run tests on every Python version with tox" | ||
@echo "test-release - upload a release to the test PyPI server" | ||
|
||
clean: | ||
git clean -Xfd | ||
|
||
develop: | ||
pip install -r requirements.dev.txt | ||
|
||
lint: | ||
flake8 . | ||
|
||
test: | ||
django-admin test | ||
|
||
test-all: | ||
tox --skip_missing_interpreters | ||
|
||
coverage: clean | ||
coverage erase | ||
coverage run --branch --source=dnt `which django-admin` test | ||
|
||
coveragehtml: coverage | ||
coverage html | ||
python -m webbrowser file://$(CURDIR)/htmlcov/index.html | ||
|
||
qa: lint coveragehtml | ||
|
||
qa-all: qa sdist test-all | ||
|
||
sdist: | ||
python setup.py sdist bdist_wheel | ||
ls -l dist | ||
check-manifest | ||
pyroma dist/`ls -t dist | grep tar.gz | head -n1` | ||
|
||
release: clean sdist | ||
twine register dist/*.tar.gz | ||
twine register dist/*.whl | ||
twine upload dist/* | ||
python -m webbrowser -n https://pypi.python.org/pypi/django-dnt | ||
|
||
# Add [test] section to ~/.pypirc, https://testpypi.python.org/pypi | ||
test-release: clean sdist | ||
twine register --repository test dist/*.tar.gz | ||
twine register --repository test dist/*.whl | ||
twine upload --repository test dist/* | ||
python -m webbrowser -n https://testpypi.python.org/pypi/django-dnt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
""" | ||
Django Middleware for DNT (Do Not Track) HTTP header. | ||
https://en.wikipedia.org/wiki/Do_Not_Track | ||
""" | ||
VERSION = '0.2.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Testing and development requirements | ||
Django | ||
check-manifest | ||
coverage | ||
flake8 | ||
pyroma | ||
tox | ||
twine | ||
wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[bdist_wheel] | ||
universal=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import django | ||
|
||
|
||
SECRET_KEY = "dnt-tests" | ||
DEBUG = True | ||
ALLOWED_HOSTS = [] | ||
|
||
INSTALLED_APPS = ( | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
|
||
'testapp', | ||
) | ||
|
||
if django.VERSION[:2] < (1, 10): | ||
# Django 1.9 and earlier | ||
MIDDLEWARE_CLASSES = ( | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
'django.middleware.security.SecurityMiddleware', | ||
'dnt.middleware.DoNotTrackMiddleware', | ||
) | ||
else: | ||
# Django 1.10 and later | ||
MIDDLEWARE = [ | ||
'django.middleware.security.SecurityMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
'dnt.middleware.DoNotTrackMiddleware', | ||
] | ||
|
||
ROOT_URLCONF = 'testapp.urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': ':memory:' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | ||
<title>Do Not Track</title> | ||
</head> | ||
<body> | ||
<p>Do Not Track: <code class="dnt">{{ request.DNT }}</code></p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.conf.urls import url | ||
from django.views.generic import TemplateView | ||
|
||
|
||
urlpatterns = [ | ||
url(r'^$', TemplateView.as_view(template_name="index.html"), name="index"), | ||
] |
Empty file.
Oops, something went wrong.