Migrate admin panel to django #502
Draft
+1,182
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The first brick of work that may be the full migration to Django and the ditch of Tortoise, Aerich and fastapi-admin.
fastapi-admin
is ditched, replaced by the much better django admin panel. It will enable much better forms, validation, permissions, logs, 2FA, Discord OAuth2, easy template customization and a wide range of extensions.As django is mostly compatible with its own ORM, a duplication of
models.py
has been generated and is marked as unmanaged, meaning Django will only look for existing tables and not attempt to make migrations on it (except for admin stuff). We will have to maintain two copies of the model files.Migrating to the django DB migration engine is highly considered in the future to ditch aerich, but a full migration to the Django ORM and the ditch of Tortoise is unlikely to arrive soon.
WARNING: DO NOT USE IN PRODUCTION YET
This is still a work in progress, and for now, it is highly insecure (open keys, debug mode always on, all the files including
config.yml
exposed to the web). Unless you are testing or have a local only panel, please do not use this!