Skip to content

Commit

Permalink
Merge tag 'v2.7.0' into develop
Browse files Browse the repository at this point in the history
Added support for django 4.2 and 5.0 v2.7.0

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEFJMl/RWQTpxOuJ6V6BRE6c4faV0FAmacZwsACgkQ6BRE6c4f
# aV2MjQ/+O3DgPM1cnXz4tbD6V6NlSGr0N/kqsQlgh96akGq+YIn9yfV9NLOD4+ow
# 5Mp97Q8NB6Xo9M8FUPLOLv5roYpDtU2RUQB7KPfozfrME4VhIwSTkaEQGr58CnKr
# tQjlTDiOy4bS9yrnoBCIL+jz8yIE7tVkH4WLfmZsMQXUjJ/3V8uR7Dl9ilKTbSLF
# f2DSD4cV8JAGXJzKalozMqmKeWHQLGtJMejAXrW/TYroZ7M2l+/ISPe/77zTruvs
# nQzJcp+e3s89IlcZkiQEzu4wPStdkf8Ss1oP6v5d34Ac8jihR3O5IepAaRt8XhGQ
# P+vYJ2Nv+AONQC5DXVRYyGyYZKVf3G8Wt94KotLA13DA3kbVZ5dTDYnWiE9vdsCs
# 9hv3AaMvcF7Bx+ETctsASMER/dNtckxePDGdmBU84utFIW6B13SxabMy7d389OtN
# mDAH7IBA4T0USFJdU8NE5tJO2Vl32euUs7/1VUf1c5+QIenZ90dtQi2dENOOJKm7
# 4RNkWJoop3vkpjHj3KBPon0pdsDQXU51TQ7+MXC4ne1mg0z+QteehzFTuHM+/pDX
# 3vfY2xGRPs+uudiQDvw56Qs/wxDQWtaDiDt6mZU8VzawzwfNSglpJbu5AWOu/G0f
# eFkCqNfG0UIaMZg8vzduJ67Eqbj3eZRJztqmhaC1jIXzD1iV6lg=
# =EVVI
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun Jul 21 03:40:27 2024 CEST
# gpg:                using RSA key 149325FD15904E9C4EB89E95E81444E9CE1F695D
# gpg: Good signature from "Rick van Hattem <[email protected]>" [ultimate]
# gpg:                 aka "[jpeg image of size 9662]" [ultimate]
  • Loading branch information
wolph committed Jul 21, 2024
2 parents 86aaa47 + 1acce1a commit c562f09
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 29 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Close stale issues and pull requests

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run every day at midnight

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
days-before-stale: 30
exempt-issue-labels: in-progress,help-wanted,pinned,security,enhancement
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ To install, add the following to your ``settings.py``:

1. ``django_statsd`` to the ``INSTALLED_APPS`` setting.
2. ``django_statsd.middleware.StatsdMiddleware`` to the **top** of your
``MIDDLEWARE_CLASSES``
``MIDDLEWARE``
3. ``django_statsd.middleware.StatsdMiddlewareTimer`` to the **bottom** of your
``MIDDLEWARE_CLASSES``
``MIDDLEWARE``

Configuration
-------------
Expand Down
2 changes: 1 addition & 1 deletion django_statsd/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__package_name__ = 'django-statsd'
__version__ = '2.6.0'
__version__ = '2.7.0'
__author__ = 'Rick van Hattem'
__author_email__ = '[email protected]'
__description__ = (
Expand Down
7 changes: 6 additions & 1 deletion django_statsd/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@


def is_ajax(request):
return request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest'
'''
Recreating the old Django is_ajax function. Note that this is not
guaranteed to be correct as it depends on jQuery style ajax
requests
'''
return request.headers.get('x-requested-with') == 'XMLHttpRequest'


class WithTimer(object):
Expand Down
1 change: 1 addition & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
# Make this unique, and don't share it with anybody.
SECRET_KEY = '4f79$e&*4cfhk&k%uo*z0cjx&nvvayk-6wxkgf-apni5=q@!mz'

# List of callables that know how to import templates from various sources.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand Down
3 changes: 1 addition & 2 deletions tests/test_app/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django import urls

from . import views

urlpatterns = [
urls.re_path(r'^$', views.index, name='index'),
urls.path(r'', views.index, name='index'),
]
2 changes: 1 addition & 1 deletion tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django import urls

urlpatterns = [
urls.re_path(r'^test_app/$', urls.include('tests.test_app.urls')),
urls.path('test_app/', urls.include('tests.test_app.urls')),
]
11 changes: 11 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@ envlist =
skip_missing_interpreters = True
usedevelop = True

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
deps =
setuptools
django42: Django>=4.2,<4.3 # Added currently supported versions
django50: Django>=5.0,<5.1 # Added currently supported versions
-r{toxinidir}/tests/requirements.txt

envlist =
py3{8,9,10,11,12,13,14}-django{4.2,5.0},

commands =
python setup.py test

Expand Down

0 comments on commit c562f09

Please sign in to comment.