Skip to content

Commit

Permalink
lazily import django.contrib.redirects.models.Redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
meeb committed May 25, 2024
1 parent 79c9a1c commit 536bee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_distill/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from django.conf import settings
from django.urls import include as include_urls, get_resolver
from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed
from django.contrib.redirects.models import Redirect
from django.utils.module_loading import import_string
from django.test import RequestFactory
from django.test.client import ClientHandler
Expand Down Expand Up @@ -482,6 +481,7 @@ def render_static_redirect(destination_url):


def render_redirects(output_dir, stdout):
from django.contrib.redirects.models import Redirect
for redirect in Redirect.objects.all():
redirect_path = redirect.old_path.lstrip('/')
if redirect_path.lower().endswith('.html'):
Expand Down

0 comments on commit 536bee7

Please sign in to comment.