R
R
Rustem Vorozheikin2015-05-08 11:17:21
Django
Rustem Vorozheikin, 2015-05-08 11:17:21

How to create an anonymous user in Django?

Good afternoon.
There is an authorization on the django site.
There was a need for empty values ​​"username" and "password" in the authorization window when clicking on the "login" button, to log in to the site as a normal user.
I tried to create a user with an empty login and password through the django admin, but django does not allow.
I will be grateful for the answers, recommendations, links =)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-05-08
@Te7ris

1. Create a user with login and password guest
2. Redefine the authorization function. By adding a check for empty fields.

if логин и пароль пришли пустые:
    авторизовать под пользователем с ID вашего юзера guest
else:
    обычная валидация формы

Z
zelsky, 2015-05-08
@zelsky

Use autocomplete for one user. default =

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question