Skip to content

Cleanup random Django version support docs #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:2.7-alpine
FROM python:3.6-alpine3.7

RUN apk add --no-cache make

Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,18 @@ coverage: ## Run and then display coverage report

resetdb: ## Delete and then recreate the dev sqlite database
python $(MANAGE) reset_db --router=default --noinput
-python $(MANAGE) syncdb --noinput
-python $(MANAGE) migrate --noinput
python $(MANAGE) migrate --noinput
python $(MANAGE) loaddata sample_data

.PHONY: build
build: ## Build a full set of Docker images
build: build/2.0 build/1.11.1 build/1.10.7 build/1.9.13 build/1.8.18
build: build/2.0 build/1.11.11 build/1.10.8 build/1.9.13 build/1.8.18

build/%:
docker build --build-arg DJANGO_VERSION=$* \
-t $(IMAGE):$$(echo "$*" | cut -f 1-2 -d.) .

run: run/1.11
run: run/2.0

run/%:
docker run --rm -p 8000:8000 -it $(IMAGE):$*
Expand All @@ -67,14 +66,12 @@ docker/publish: ## Publish Docker images to the hub
docker push $(IMAGE):1.10
docker push $(IMAGE):1.9
docker push $(IMAGE):1.8
docker push $(IMAGE):1.7
docker push $(IMAGE):1.6

test/%:
docker run --rm -p 8000:8000 -t $(IMAGE):$* make test

bash:
docker run --rm -it $(IMAGE):1.9 /bin/bash
docker run --rm -it $(IMAGE):2.0 /bin/bash

version:
@sed -i -r /version/s/[0-9.]+/$(VERSION)/ setup.py
Expand Down
2 changes: 2 additions & 0 deletions django_object_actions/models.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# DJANGO1.7 https://docs.djangoproject.com/en/2.0/releases/1.7/#app-loading-refactor
# DELETEME and use an app config
# Empty models.py so django picks the templates
6 changes: 3 additions & 3 deletions example_project/polls/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

def __unicode__(self):
def __str__(self):
return self.question

def was_published_recently(self):
Expand All @@ -24,13 +24,13 @@ class Choice(models.Model):
choice_text = models.CharField(max_length=200)
votes = models.IntegerField()

def __unicode__(self):
def __str__(self):
return self.choice_text


class Comment(models.Model):
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
comment = models.TextField(null=True, blank=True)

def __unicode__(self):
def __str__(self):
return self.comment or ''
6 changes: 1 addition & 5 deletions example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def project_dir(*paths):

ROOT_URLCONF = 'example_project.urls'

# DJANGO1.9 switch to only MIDDLEWARE
MIDDLEWARE_CLASSES = MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
Expand Down Expand Up @@ -75,8 +76,3 @@ def project_dir(*paths):
},
},
]

# DJANGO1.7
SILENCED_SYSTEM_CHECKS = [
'1_7.W001',
]
15 changes: 8 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#
# pip-compile --output-file requirements.txt requirements.in
#
coverage==4.4.1
dj-database-url==0.4.2
coverage==4.5.1
dj-database-url==0.5.0
django-extensions==2.0.0
factory-boy==2.8.1
faker==0.7.17
factory-boy==2.10.0
faker==0.8.11 # via factory-boy
mock==2.0.0
pbr==3.0.1 # via mock
python-dateutil==2.6.0 # via faker
six==1.10.0 # via django-extensions, faker, mock, python-dateutil
pbr==3.1.1 # via mock
python-dateutil==2.6.1 # via faker
six==1.11.0 # via django-extensions, faker, mock, python-dateutil
text-unidecode==1.2 # via faker
typing==3.6.4 # via django-extensions
uuid==1.30
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
universal = 1

[flake8]
# exclude = migrations django_object_actions/__init__.py
max-line-length = 90