-
Notifications
You must be signed in to change notification settings - Fork 166
Fix : Deprecated Django/Allauth Settings #1515
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
base: enext
Are you sure you want to change the base?
Conversation
…d virtual environment, not the system Python environment.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates Django allauth authentication configuration to use the new non-deprecated settings and adjusts the supported Python version range in pyproject.toml. Flow diagram for updated django allauth authentication settingsflowchart TD
subgraph Deprecated_settings
A1[ACCOUNT_EMAIL_REQUIRED]
A2[ACCOUNT_USERNAME_REQUIRED]
A3[ACCOUNT_AUTHENTICATION_METHOD]
A4[Commented ACCOUNT_LOGIN_METHODS]
A5[Commented ACCOUNT_SIGNUP_FIELDS]
end
subgraph New_settings
B1[ACCOUNT_LOGIN_METHODS email]
B2[ACCOUNT_SIGNUP_FIELDS email password1 password2]
B3[ACCOUNT_USER_MODEL_USERNAME_FIELD None]
end
Developer[Developer updating settings] --> A1
Developer --> A2
Developer --> A3
Developer --> A4
Developer --> A5
A1 -->|replaced by| B1
A2 -->|replaced by| B1
A3 -->|replaced by| B1
A4 -->|uncommented and used| B1
A5 -->|uncommented and simplified| B2
B1 --> AllauthCore[django_allauth authentication flow]
B2 --> AllauthCore
B3 --> AllauthCore
AllauthCore --> LoginBehavior[Login via email only]
AllauthCore --> SignupBehavior[Signup requires email password1 password2]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- The
ACCOUNT_SIGNUP_FIELDSchange drops the*markers that previously denoted required fields; if you still rely on those constraints, consider explicitly configuring required fields via allauth’s current settings (e.g., form or field configuration) to preserve the same validation behavior. - The duplicated NOTE comment above the allauth settings can be simplified to a single line to avoid redundancy in
next_settings.py.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `ACCOUNT_SIGNUP_FIELDS` change drops the `*` markers that previously denoted required fields; if you still rely on those constraints, consider explicitly configuring required fields via allauth’s current settings (e.g., form or field configuration) to preserve the same validation behavior.
- The duplicated NOTE comment above the allauth settings can be simplified to a single line to avoid redundancy in `next_settings.py`.
## Individual Comments
### Comment 1
<location> `README.rst:107` </location>
<code_context>
7. **Activate virtual environment**
-After running ``uv sync```, activate a virtual environment
+ All python commands must be run within the project's virtual environment. You have two options:
-.. code-block:: sh
</code_context>
<issue_to_address>
**suggestion (typo):** Consider capitalizing "Python" as it refers to the programming language.
Please use "Python" with a capital P here to match standard language naming conventions.
Suggested implementation:
```
All Python commands must be run within the project's virtual environment. You have two options:
```
```
Prepend ``uv run`` to any Python command to run it in the environment without explicit activation.
```
</issue_to_address>
### Comment 2
<location> `README.rst:117` </location>
<code_context>
+
+ **Option B: Use `uv run`**
+
+ Prepend ``uv run`` to any python command to run it in the environment without explicit activation.
+
+ .. code-block:: sh
</code_context>
<issue_to_address>
**suggestion (typo):** Consider capitalizing "Python" here as well for consistency.
This matches standard documentation style and the other references to the language in this document.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Pull request overview
This PR addresses deprecation warnings from django-allauth by migrating from the older authentication settings (ACCOUNT_EMAIL_REQUIRED, ACCOUNT_USERNAME_REQUIRED, ACCOUNT_AUTHENTICATION_METHOD) to the newer recommended settings (ACCOUNT_LOGIN_METHODS, ACCOUNT_SIGNUP_FIELDS). The PR also constrains Python versions to 3.11-3.12 and improves the README documentation for virtual environment activation.
- Migrates django-allauth settings to current non-deprecated configuration
- Restricts Python version support to >=3.11 and <3.13
- Enhances README with clearer virtual environment activation instructions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/pyproject.toml | Adds upper bound constraint to Python version requirement, limiting to <3.13 |
| app/eventyay/config/next_settings.py | Replaces deprecated allauth settings with ACCOUNT_LOGIN_METHODS and ACCOUNT_SIGNUP_FIELDS |
| README.rst | Expands virtual environment activation section with two alternative approaches (activate vs uv run) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html | ||
| # ACCOUNT_LOGIN_METHODS = {'email'} | ||
| # ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*'] | ||
| # NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html |
Copilot
AI
Dec 16, 2025
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.
Duplicate NOTE comment. This line is identical to line 1115 and should be removed.
| # NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html |
| # ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*'] | ||
| # NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html | ||
| ACCOUNT_LOGIN_METHODS = {'email'} | ||
| ACCOUNT_SIGNUP_FIELDS = ['email', 'password1', 'password2'] |
Copilot
AI
Dec 16, 2025
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.
According to django-allauth documentation, required fields in ACCOUNT_SIGNUP_FIELDS should be marked with an asterisk suffix. The previous commented-out configuration used 'email*', 'password1*', 'password2*' to indicate required fields. The current configuration removes these asterisks, which may inadvertently make these fields optional. Consider changing to ['email*', 'password1*', 'password2*'] to maintain the required field behavior.
| ACCOUNT_SIGNUP_FIELDS = ['email', 'password1', 'password2'] | |
| ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*'] |
settings.pyare deprecated and produce warnings.eventyay/config/next_settings.pyto useACCOUNT_LOGIN_METHODSandACCOUNT_SIGNUP_FIELDS).Summary by Sourcery
Update authentication configuration to use current django-allauth settings and align Python version requirements.
Bug Fixes:
Build: