Skip to content

Commit

Permalink
Test against Django 2.2 (#14)
Browse files Browse the repository at this point in the history
- Add Django 2.2 to tox.ini
- Add migraions to example app
- Tell flake8 to ignore migrations
  • Loading branch information
moggers87 authored Jun 6, 2019
1 parent 0132a8d commit 7dd39d5
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ etc is done elsewhere.
Supported Django Versions
=========================

Django 1.8 to 2.1 is currently supported by this library.
Django 1.8 to 2.2 is currently supported by this library.

Installation
============
Expand Down
27 changes: 27 additions & 0 deletions examples/protected_downloads/download/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 2.2.2 on 2019-06-05 19:03

from django.conf import settings
import django.core.files.storage
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Download',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_public', models.BooleanField(default=True)),
('title', models.CharField(max_length=255)),
('file', models.FileField(storage=django.core.files.storage.FileSystemStorage(location='/home/moggers/workspace/django-sendfile2/examples/protected_downloads/protected'), upload_to='download')),
('users', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
],
),
]
Empty file.
21 changes: 20 additions & 1 deletion examples/protected_downloads/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'urls'
Expand All @@ -73,12 +74,30 @@
os.path.join(PROJECT_ROOT, 'templates'),
)

TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
'context_processors': [
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
'loaders': [
(
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
),
],
'debug': DEBUG, # noqa: F405
},
}]

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.messages',
'download',
'sendfile',
)
Expand Down
14 changes: 11 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
envlist =
{pypy,py27}-django{18,19,110,111}
py34-django{18,19,110,111,20}
py35-django{18,19,110,111,20,21}
py36-django{111,20,21}
py37-django{20,21}
py35-django{18,19,110,111,20,21,22}
py36-django{111,20,21,22}
py37-django{20,21,22}
flake8

[testenv]
Expand All @@ -16,6 +16,7 @@ deps =
django111: Django>=1.11,<1.12
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<2.3
changedir = examples/protected_downloads
commands = python manage.py test sendfile {posargs}

Expand All @@ -28,6 +29,13 @@ deps=flake8

[flake8]
max_line_length=100
exclude =
.git
env
*/migrations/*
.tox
__pycache__
docs

[travis]
python =
Expand Down

0 comments on commit 7dd39d5

Please sign in to comment.