Skip to content

Instantly share code, notes, and snippets.

@ncole458
Created October 17, 2017 03:17
Show Gist options
  • Save ncole458/8944d2538308e5e40e0966ef0f2de433 to your computer and use it in GitHub Desktop.
Save ncole458/8944d2538308e5e40e0966ef0f2de433 to your computer and use it in GitHub Desktop.
Easy Django static file route for SSL validation etc.
# place file in static root
from django.views.generic.base import RedirectView
from django.contrib.staticfiles.storage import staticfiles_storage
urlpatterns = [
url(r'C798C4F2FDD57D2D63BF76874C080F49.txt', RedirectView.as_view(
url=staticfiles_storage.url('C798C4F2FDD57D2D63BF76874C080F49.txt'),
permanent=True),
name="ssl_approve"
),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment