test to find out locale set in the WSGI enivroment

This commit is contained in:
Martin Green 2022-06-21 22:43:06 +01:00
parent 654f8e8c6c
commit 843bfa8ba6

View File

@ -342,6 +342,12 @@ def editexpopage(request, path):
pageform = ExpoPageForm({"html": body, "title": title})
else:
body = "### File not found ###\n" + str(filepath)
import sys
import locale
body = body + "\nsys.getdefaultencoding() = " + sys.getdefaultencoding()
body = body + "\nsys.getfilesystemencoding() = " + sys.getfilesystemencoding()
body = body + "\nlocale.getdefaultlocale() = " + locale.getdefaultlocale()
body = body + "\nlocale.getpreferredencoding() = " + locale.getpreferredencoding()
pageform = ExpoPageForm({"html": body, "title": "Missing"})
return render(request, 'editexpopage.html', {'path': path, 'form': pageform, })