-
Notifications
You must be signed in to change notification settings - Fork 944
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 Python 4.2 #123
Update to Python 4.2 #123
Conversation
response = self.client.post(reverse('renew-book-librarian', kwargs={'pk': self.test_bookinstance1.pk}), | ||
{'renewal_date': date_in_past}) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertFormError(response, 'form', 'renewal_date', 'Invalid date - renewal in past') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and line 286 were only updates for 4.1. Deprecation warning - changed to assertFormError(response.context['form'], 'renewal_date', ...)
# Static file serving. | ||
# http://whitenoise.evans.io/en/stable/django.html#django-middleware | ||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' | ||
STORAGES = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STATICFILES_STORAGE setting is deprecated and replaced by STORAGES.
import dj_database_url | ||
db_from_env = dj_database_url.config(conn_max_age=500) | ||
DATABASES['default'].update(db_from_env) | ||
|
||
if 'DATABASE_URL' in os.environ: | ||
DATABASES['default'] = dj_database_url.config( | ||
conn_max_age=500, | ||
conn_health_checks=True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this change needed because dj_database_url was updated to latest version, which gives a warning if the DATABASE_URL Is not defined. This is a valid case, and previously did not warn. I could have fixed it by created a default URL in the config()
call but I prefer this approach (and have tested it).
requirements.txt
Outdated
Django==4.2.3 | ||
dj-database-url==2.0.0 | ||
gunicorn==21.2.0 | ||
psycopg2-binary==2.9.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Django 4.2 supports psycopg (3) but railway couldn't find it. So not updating to latest.
These are minimal updates. There were more changes in release notes that could have affected this, but none that IMO should be made. Docs update and explanation of that in mdn/content#28278