Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
dj-rest-auth registration fetch

Using dj-rest-auth for user auth and registration on my react app. Got login and logout to work using api endpoints in the docs. Failing to register a user, getting HTTP bad request 400. Reading on the web, explains that there's something wrong with my request but cannot figure what.

EDIT: Tried insomina to simulate POST registration response and got error on a Django's side:

ConnectionRefusedError at /api/dj-rest-auth/registration/
[Errno 61] Connection refused

register.js

fetch('/api/dj-rest-auth/registration/', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        user: 'alalala',
        password1: '1234',
        password2: '1234',
        email: 'ala@gmail.com',
      })
    })
.then(res => {
        res.json()
      })

settings.py

SITE_ID = 1
CORS_ORIGIN_ALLOW_ALL = True
REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework.authentication.TokenAuthentication',
    ]
}
REST_AUTH_REGISTER_SERIALIZERS = {
    'REGISTER_SERIALIZER': 'api.serializers.CustomRegisterSerializer'
}
INSTALLED_APPS = [
#local
    'api',
    # 3'rd party apps
    'rest_framework',
    'corsheaders',
    'rest_framework.authtoken',
    'dj_rest_auth', 

    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'dj_rest_auth.registration',

    # added django but it disable admin login logout pages
    'django.contrib.sites',
    
    # django default...
]
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!