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

[POLA-9] Upgrade to Django==5.1.1 #4009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piemar1
Copy link
Contributor

@piemar1 piemar1 commented Sep 11, 2024

No description provided.

Copy link

mergify bot commented Sep 11, 2024

Could you please fix the conflicts @piemar1? 🙏

@mergify mergify bot added the conflict label Sep 11, 2024
@piemar1
Copy link
Contributor Author

piemar1 commented Sep 11, 2024

@WezSieTato

PR for upgrade django to 5.1.1

Still not ready:

service "web-collectstatic" didn't complete successfully: exit 1
Error: Process completed with exit code 1.

WIP

@piemar1
Copy link
Contributor Author

piemar1 commented Sep 11, 2024

Work in progres.
Nie chciałbym przepalać na upgrade dodatkowych godzin, mamy pierwszą połowę września a ja dobijam powoli do limitu 10h/miesiąc.
PR Upgrade django do wersji 5.x jest dostępny ale niestety 2 z pipeliny wywalają się dokładnie w ten sam sposób.

@piemar1
Copy link
Contributor Author

piemar1 commented Sep 11, 2024

Obecny status prac:

  • PR przygotowany ale niestety pileliny ie przechodzą pojawiają się błędy w 2 pipelanach
  • lokalnie po probie zbudowanie kontenera od nowa (docker-compose up --build) pojawia się problem z Configiem

obraz

  • lista 6 spraw do sprawdzenie w związku z upgradem django z wersji 4.x do 5.x

When migrating from Django 4.x to Django 5, encountering an error during collectstatic with error code 1 could be due to several changes or incompatibilities introduced in Django 5. Here are some common reasons for this issue:

  1. Changes in STATICFILES_STORAGE Setting

    In Django 5, STATICFILES_STORAGE defaults to django.contrib.staticfiles.storage.StaticFilesStorage, which might have been customized in your project or differ from what was used in Django 4.
    If your project was using a third-party storage system (like django-storages), there might be incompatibilities or additional configuration needed for Django 5.
    Solution: Double-check if your storage backend is compatible with Django 5 and update or refactor it as necessary.

  2. Deprecation or Removal of Static File Finder Methods

    Some methods used for finding static files could have been deprecated or removed. If your custom storage or apps depend on deprecated APIs, this could cause the failure.
    Solution: Review the Django 5 release notes to check for any deprecations related to static files and update your code accordingly.

  3. Permission or Path Issues

    The collectstatic command writes static files to the directory specified by the STATIC_ROOT setting. Ensure that:
    The path defined in STATIC_ROOT exists and is writable by the user running the command.
    There might also be changes in path handling or security settings in Django 5 that could lead to this problem.
    Solution: Verify file permissions, path correctness, and make sure your STATIC_ROOT is correctly set.

  4. Third-Party App or Package Incompatibility

    If you are using third-party apps or packages related to static files (such as whitenoise or django-compressor), check if they are compatible with Django 5. An outdated package or one using a deprecated API could cause collectstatic to fail.
    Solution: Ensure all your third-party dependencies are up-to-date and compatible with Django 5.

  5. Template Tag Issues

    Changes in template handling or the static template tag ({% static %}) might break certain uses of static files within your templates.
    Solution: Review your template usage for any issues with static file references and ensure that you're not using deprecated syntax.

  6. Logging for Detailed Errors

    The collectstatic command might output logs or error messages that can give you more details on what specifically is going wrong. Use verbose mode with --verbosity=3 to gather more information.
    Solution: Run python manage.py collectstatic --verbosity=3 to capture the full error message and trace the issue further.

By addressing one of these likely causes, you should be able to resolve the collectstatic error after migrating to Django 5.

@WezSieTato
Copy link
Member

@piemar1 Jakby co to te podbicie ma dosyć niski priorytet.

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

Successfully merging this pull request may close these issues.

2 participants