Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Djangoldp Account
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Startin blox
djangoldp-packages
Djangoldp Account
Commits
86474e60
Commit
86474e60
authored
Feb 24, 2020
by
Calum Mackervoy
Committed by
Jean-Baptiste Pasquier
Feb 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configurable fields in Registration form
parent
a7584d46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
README.md
README.md
+5
-0
djangoldp_account/forms.py
djangoldp_account/forms.py
+7
-0
No files found.
README.md
View file @
86474e60
...
...
@@ -59,6 +59,11 @@ EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT
=
587
```
Optionally you can configure which user fields which you would like to include on the registration form by including
`REGISTRATION_FIELDS`
in settings.py
```
python
REGISTRATION_FIELDS
=
(
'username'
,
'email'
,
'password1'
,
'password2'
)
```
The workflow starts at : http://127.0.0.1:8000/accounts/register/
Then, override template by copying the directory
`djangoldp_account/templates/django_registration/`
to your project and modify them.
...
...
djangoldp_account/forms.py
View file @
86474e60
...
...
@@ -4,6 +4,13 @@ from django_registration.forms import RegistrationForm
from
djangoldp_account.models
import
LDPUser
def
_get_user_form_fields
():
'''Gets the fields required for the form from settings, or returns default'''
from
django.conf
import
settings
return
getattr
(
settings
,
'REGISTRATION_FIELDS'
,
(
'username'
,
'email'
,
'password1'
,
'password2'
))
class
LDPUserForm
(
RegistrationForm
):
class
Meta
(
RegistrationForm
.
Meta
):
model
=
get_user_model
()
fields
=
_get_user_form_fields
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment