Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Accept both username or email for authentication #14

Open
victornovais opened this issue Apr 15, 2015 · 3 comments
Open

Accept both username or email for authentication #14

victornovais opened this issue Apr 15, 2015 · 3 comments

Comments

@victornovais
Copy link

Today we have been seeing authentications that accept bot username or emails for validating an user. We would be great to have that here.

At first, you could add a settings attribute giving the possibility to authenticate user by email or username or both.

@twz915
Copy link

twz915 commented Mar 12, 2017

@SaltNego
Copy link

/webwen/auth1$ python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions, users
Running migrations:
No migrations to apply.
Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 227, in handle
self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,
File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 53, in emit_post_migrate_signal
**kwargs
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 193, in send
for receiver in self._live_receivers(sender)
File "/usr/local/lib/python2.7/dist-packages/users/utils.py", line 49, in auto_create_superuser
User.base_objects.get(email=email)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 374, in get
num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 232, in len
self._fetch_all()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 1118, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 53, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 894, in execute_sql
raise original_exception
django.db.utils.OperationalError: no such table: users_user

@laiqun
Copy link

laiqun commented Sep 25, 2018

Also me occur this question,I remeber the solution is make some migration first.
I't may be
python manage.py migrate users

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

No branches or pull requests

5 participants