Skip to content

Commit ffff786

Browse files
committed
Restored serving of spinx _images
This is a partial revert of efc51e8. Due to an unfortunate conflict in the nginx configuration of the server after the deploying of the commit mentioned above, the _images directory ended up still being served by Django which added a / to the end of the image path, using a permanent HTTP redirection (because of settings.APPEND_SLASH). The solution (hopefully temporary) is to restore the serving of images by Django while we figure out how to configure nginx to keep serving the _images and handled the old cached redirections with a trainling slash.
1 parent e5de70f commit ffff786

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/urls.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
{"url": ""},
2323
name="document-index",
2424
),
25+
re_path(
26+
r"^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/_images/(?P<path>.*)$",
27+
views_debug.sphinx_static,
28+
{"subpath": "_images"},
29+
),
2530
re_path("^(.*)/index/$", views.redirect_index),
2631
re_path(
2732
r"^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/search/$",
@@ -54,7 +59,7 @@
5459
views_debug.objects_inventory,
5560
),
5661
re_path(
57-
r"^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/(?P<subpath>_downloads|_images|_source)/(?P<path>.*)$", # noqa: E501
62+
r"^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/(?P<subpath>_downloads|_source)/(?P<path>.*)$", # noqa: E501
5863
views_debug.sphinx_static,
5964
),
6065
re_path(r"^pots/(?P<pot_name>\w+\.pot)$", views_debug.pot_file),

0 commit comments

Comments
 (0)