Skip to content
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
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
language: python
python:
- "3.5"
- "3.4"
- "3.3"
- "3.6"
- "2.7"
env:
- DJANGO_VERSION=1.11
- DJANGO_VERSION=1.10
- DJANGO_VERSION=1.9
- DJANGO_VERSION=1.8
services:
- mysql
- postgresql
matrix:
exclude:
- python: "3.3"
- python: "2.7"
env: DJANGO_VERSION=1.9
- python: "3.3"
- python: "2.7"
env: DJANGO_VERSION=1.10
- python: "3.3"
env: DJANGO_VERSION=1.11

install:
- pip install -r requirements.txt
- pip install -q Django==$DJANGO_VERSION
Expand Down
5 changes: 3 additions & 2 deletions django_prometheus/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ def process_view(self, request, view_func, *view_args, **view_kwargs):
name, transport, method).inc()

def process_template_response(self, request, response):
responses_by_templatename.labels(str(
response.template_name)).inc()
if hasattr(response, 'template_name'):
responses_by_templatename.labels(str(
response.template_name)).inc()
return response

def process_response(self, request, response):
Expand Down