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
58 changes: 58 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Tests

on:
pull_request:
push:
branches:
- master
- esp

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.8"
django-version: ">=4.0,<4.1"
- python-version: "3.9"
django-version: ">=4.0,<4.1"
- python-version: "3.10"
django-version: ">=4.0,<4.1"
- python-version: "3.8"
django-version: ">=4.1,<4.2"
- python-version: "3.9"
django-version: ">=4.1,<4.2"
- python-version: "3.10"
django-version: ">=4.1,<4.2"
- python-version: "3.11"
django-version: ">=4.1,<4.2"
- python-version: "3.8"
django-version: ">=4.2,<4.3"
- python-version: "3.9"
django-version: ">=4.2,<4.3"
- python-version: "3.10"
django-version: ">=4.2,<4.3"
- python-version: "3.11"
django-version: ">=4.2,<4.3"
- python-version: "3.12"
django-version: ">=4.2,<4.3"

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . "Django${{ matrix.django-version }}"

- name: Run tests
run: python -W all test_proj/manage.py test
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
django-admin-tools changelog
============================

Unreleased:
-----------

* Drop Python 2 / old Django compatibility shims and remove ``default_app_config``
* Replace ``imp`` usage in dashboard autodiscovery with ``importlib.util.find_spec`` for Python 3.12 compatibility
* Remove obsolete South migration directories and legacy Travis CI config
* Add GitHub Actions test workflow and expand Django/Python matrix for Django 4.0-4.2 support


Version 0.9.3, 10 August 2023:
------------------------------

Expand Down
7 changes: 1 addition & 6 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
Thanks for downloading django-admin-tools.

This application requires Python 2.7 or later and Django 1.11 or newer.
django-admin-tools is fully compatible with Python 3.

Important note to users of django 1.10 or below: starting from 0.9.0,
django-admin-tools is *NOT* compatible with Django <= 1.10. If you want,
you can still use the 0.8.1 version.
This application requires Python 3.8 or later and supports Django 4.0, 4.1, and 4.2.

It is recommended that you install the FeedParser module
(http://www.feedparser.org/) if you want to use the feed dashboard module.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Please join the `mailing list <http://groups.google.fr/group/django-admin-tools>
Requirements
------------

django-admin-tools is compatible with Django 1.11 LTS up to Django 4.0 as well Python 2.7, 3.5+.
django-admin-tools is compatible with Django 4.0 up to Django 4.2 as well Python 3.8+.

For older python and django versions please use the 0.8.1 version of django-admin-tools which is available on Pypi.

Expand Down
7 changes: 0 additions & 7 deletions admin_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@
"""

VERSION = '0.9.3'

try:
import django
if django.VERSION < (3, 2):
default_app_config = 'admin_tools.apps.AdminToolsConfig'
except ImportError:
pass
17 changes: 5 additions & 12 deletions admin_tools/dashboard/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@

from django.template.defaultfilters import slugify
from importlib import import_module
try:
# we use django.urls import as version detection as it will fail on django 1.11 and thus we are safe to use
# gettext_lazy instead of ugettext_lazy instead
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.utils.encoding import force_str
except ImportError:
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import force_text as force_str
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.utils.encoding import force_str

from admin_tools.dashboard import modules
from admin_tools.utils import get_admin_site_name, uniquify
Expand Down Expand Up @@ -53,8 +46,8 @@ class Media:

Here's an example of a custom dashboard::

from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from admin_tools.dashboard import modules, Dashboard

class MyDashboard(Dashboard):
Expand Down
10 changes: 2 additions & 8 deletions admin_tools/dashboard/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
"""

from django.apps import apps as django_apps
try:
# we use django.urls import as version detection as it will fail on django 1.11 and thus we are safe to use
# gettext_lazy instead of ugettext_lazy instead
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
except ImportError:
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.forms.utils import flatatt
from django.utils.itercompat import is_iterable
from django.utils.text import capfirst
Expand Down
17 changes: 4 additions & 13 deletions admin_tools/dashboard/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@ def autodiscover(blacklist=[]):
Optionally you can pass a ``blacklist`` of apps that you don't want to
provide their own app index dashboard.
"""
import imp
from django.conf import settings
try:
from importlib import import_module
except ImportError:
# Django < 1.9 and Python < 2.7
from django.utils.importlib import import_module
from importlib import import_module, util

blacklist.append('admin_tools.dashboard')
blacklist.append('admin_tools.menu')
Expand All @@ -52,16 +47,12 @@ def autodiscover(blacklist=[]):
if app in blacklist:
continue

# try to import the app
try:
app_path = import_module(app).__path__
except AttributeError:
dashboard_spec = util.find_spec('%s.dashboard' % app)
except (ImportError, ValueError):
continue

# try to find a app.dashboard module
try:
imp.find_module('dashboard', app_path)
except ImportError:
if dashboard_spec is None:
continue

# looks like we found it so import it !
Expand Down
83 changes: 0 additions & 83 deletions admin_tools/dashboard/south_migrations/0001_initial.py

This file was deleted.

This file was deleted.

Loading
Loading