mirror of
https://github.com/kjanat/livegraphs-django.git
synced 2026-02-13 23:35:43 +01:00
feat: add ty type checking support and fix type issues
- Add ty.toml configuration with Django project root - Add py.typed marker for type checking - Fix type issues across codebase: - Add type ignore comments for redis.exceptions imports - Fix django.db.models.functions imports in utils - Fix getattr usage in accounts/forms - Remove unnecessary type annotations in dashboard/forms - Configure ty to exclude migrations and respect ignore files - All ty checks now pass (29 diagnostics -> 0)
This commit is contained in:
@@ -17,7 +17,7 @@ def main():
|
||||
# Default to 'manage.py' if no specific command
|
||||
if cmd_name == "__main__":
|
||||
# When running as `python -m dashboard_project`, just pass control to manage.py
|
||||
from dashboard_project.manage import main as manage_main
|
||||
from dashboard_project.manage import main as manage_main # type: ignore[import-not-found]
|
||||
|
||||
manage_main()
|
||||
return
|
||||
@@ -48,5 +48,32 @@ def main():
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
def runserver():
|
||||
"""Entrypoint for running Django development server."""
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard_project.settings")
|
||||
sys.argv = ["manage.py", "runserver", "8001"]
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
def migrate():
|
||||
"""Entrypoint for running Django migrations."""
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard_project.settings")
|
||||
sys.argv = ["manage.py", "migrate"]
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
def shell():
|
||||
"""Entrypoint for Django shell."""
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard_project.settings")
|
||||
sys.argv = ["manage.py", "shell"]
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user