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

Update to Django 4.2.x #1388

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Conversation

jimwins
Copy link
Contributor

@jimwins jimwins commented Mar 26, 2024

Summary

This updates Django to 4.2.x, which is currently in LTS until April 2026, and away from 3.1.x which is no longer supported.

More changes may be required. I had to stub out the LDAP stuff in archivebox/core/auth.py to get it to run locally (but did not commit this) because of ImportError: attempted relative import beyond top-level package errors. I'm not sure I understand the dependencies there, but it seems like LDAP configuration should get passed into the Django app rather than it trying to import it from outside core. (This commit fixes the LDAP issue that I had.)

This didn't cause any additional tests to fail for me, and some cursory poking around the UI didn't turn up any problems.

The change to archivebox/core/admin.py is less significant than it appears because it's really just moving the AdminSite subclass above the ModelAdmin subclasses so the @admin.register(..., site=archivebox_admin) works. Maybe it would be an opportunity to split these admin classes into a package.

Related issues

I have no idea if this fixes any reported issues, but probably not. I assume some new features come from updating Django, but I don't know enough to even suggest what those might be.

Changes these areas

  • Bugfixes
  • Feature behavior
  • Command line interface
  • Configuration options
  • Internal architecture
  • Snapshot data layout on disk

@pirate
Copy link
Member

pirate commented Mar 26, 2024

Wow, amazing! Thank you so much, what a dream PR to receive as a maintainer!

I'll merge it immediately even if there's stuff to fix, as I want to rebase all my other dev work on this ASAP.

I'm so ready to leave 3.1 behind and get everyone on modern Django, I let it fall behind for too long!

@pirate pirate merged commit 6981837 into ArchiveBox:dev Mar 26, 2024
1 of 2 checks passed
@mamema
Copy link

mamema commented Mar 27, 2024

had this today. container in endeless loop (as docker swarm is trying to recreate the failed container


[i] [2024-03-27 17:41:51] ArchiveBox v0.7.3: archivebox server --quick-init 0.0.0.0:8000

> /data

Traceback (most recent call last):

File "/usr/local/bin/archivebox", line 8, in

sys.exit(main())

         ^^^^^^

File "/app/archivebox/cli/init.py", line 140, in main

run_subcommand(

File "/app/archivebox/cli/init.py", line 74, in run_subcommand

setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending)

File "/app/archivebox/config.py", line 1425, in setup_django

django.setup()

File "/usr/local/lib/python3.11/site-packages/django/init.py", line 24, in setup

apps.populate(settings.INSTALLED_APPS)

File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate

app_config.ready()

File "/app/archivebox/core/apps.py", line 8, in ready

from .auth import register_signals

File "/app/archivebox/core/auth.py", line 3, in

from ..config import (

ImportError: attempted relative import beyond top-level package

@jimwins
Copy link
Contributor Author

jimwins commented Mar 27, 2024

This was mentioned in the pull request, there's another commit that needs to be pulled in from a WIP branch of @pirate's.

@pirate pirate mentioned this pull request Apr 10, 2024
7 tasks
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.

3 participants