Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

743
Visualizações
authenticate always returns None,Django

I want to add the authentication functionality in my application. I have below code snippet:

user = User.objects.create_user('jkd')
user.set_password('space')
user.save
user = authenticate(username='jkd', password='space')
print "User:",user

It always prints the "User:None". I have also added below in my settings.py file:

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend', # default
     # any other authentication backends
)

I have gone through answers of same question in different thread but it doesn't help me.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

There is typo in your code, thus the record has not been saved yet

Change from

user.save

to

user.save()
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda