Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a fix to avoid " The DEFAULT_FILE_STORAGE setting is deprecated" #366

Open
greatlaki opened this issue May 23, 2023 · 1 comment · May be fixed by #359 or #408
Open

Provide a fix to avoid " The DEFAULT_FILE_STORAGE setting is deprecated" #366

greatlaki opened this issue May 23, 2023 · 1 comment · May be fixed by #359 or #408

Comments

@greatlaki
Copy link

Hello, thanks for a great app!

I used django-health-check for a while with no problems.
But recently I faced with the issue when I tried to execute a command poetry run pytest tests:
django.utils.deprecation.RemovedInDjango51Warning: The DEFAULT_FILE_STORAGE setting is deprecated. Use STORAGES instead.
note: Django 4.2 introduces the new STORAGES setting.
Could you fix this issue

@aschmitz-wbd
Copy link

I want to add that, with the release of the Django 5.1 alpha 1, the usage of DEFAULT_FILE_STORAGE throws an error and leads to the application not starting at all.

INFO 2024-05-23 10:43:44,417 apps 12 139844434622272 AXES: BEGIN version 6.4.0, blocking by ip_address
Traceback (most recent call last):
  File "/app/./manage.py", line 21, in <module>
    main()
  File "/app/./manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/usr/local/lib/python3.12/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.12/site-packages/django/apps/registry.py", line 124, in populate
    app_config.ready()
  File "/usr/local/lib/python3.12/site-packages/health_check/contrib/s3boto3_storage/apps.py", line 10, in ready
    from .backends import S3Boto3StorageHealthCheck
  File "/usr/local/lib/python3.12/site-packages/health_check/contrib/s3boto3_storage/backends.py", line 4, in <module>
    from health_check.storage.backends import StorageHealthCheck
  File "/usr/local/lib/python3.12/site-packages/health_check/storage/backends.py", line 82, in <module>
    class DefaultFileStorageHealthCheck(StorageHealthCheck):
  File "/usr/local/lib/python3.12/site-packages/health_check/storage/backends.py", line 84, in DefaultFileStorageHealthCheck
    storage = settings.DEFAULT_FILE_STORAGE
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/conf/__init__.py", line 83, in __getattr__
    val = getattr(_wrapped, name)
          ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Settings' object has no attribute 'DEFAULT_FILE_STORAGE'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants