add djls-django crate (#6)

* add djls-django crate

* rework

* oops

* add check for GDAL and GeoDjango

* lots of things

* remove unused scripts

* move scripts to dedicated mod and make static consts

* inline gdal check

* rename mod

* rename mod

* move server info to consts

* adjust pyproject

* hide rustfmt config

* simplify django setup

* adjust printing
This commit is contained in:
Josh Thomas 2024-12-07 16:02:48 -06:00 committed by GitHub
parent b7a1de98dd
commit fce343f44d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 1139 additions and 291 deletions

View file

@ -0,0 +1,31 @@
from __future__ import annotations
import json
from django.conf import settings
from django.template.engine import Engine
def get_django_setup_info():
return {
"installed_apps": list(settings.INSTALLED_APPS),
"templatetags": [
{
"name": tag_name,
"library": module_name.split(".")[-1],
"doc": tag_func.__doc__ if hasattr(tag_func, "__doc__") else None,
}
for module_name, library in (
[("", lib) for lib in Engine.get_default().template_builtins]
+ sorted(Engine.get_default().template_libraries.items())
)
for tag_name, tag_func in library.tags.items()
],
}
if __name__ == "__main__":
import django
django.setup()
print(json.dumps(get_django_setup_info()))