0

some problems with creating user in Django!!!!

Hello guys I want to create user by Api in Django and i confused how to do that. the first thing is should i logged in with superuser account and then create new user(or can i create anonymously? is that secure? )

The other questions is how to Authenticate anonymous user if anonymous person can create user.

mamareza
  • 162
  • 1
  • 11
  • what do you mean by 'create user by api'? where's your code for users to register? normally users sign up for your website by filling in a registration form (which creates the new user). Please be more specific in what issue you are facing exactly, write a [mcve]. – dirkgroten Aug 19 '19 at 10:43
  • i want use this api in my application(not on webpage) – mamareza Aug 19 '19 at 11:10
  • This might answer your question https://stackoverflow.com/questions/43031323/how-to-create-a-new-user-with-django-rest-framework-and-custom-user-model – Rohit Sharma Aug 21 '19 at 10:36

1 Answers1

0

Django REST Framework provides a way to create users and authenticate them : For authentication refer: Authentication

For creating users you don't have to be logged-in as superuser , instead use Django User Model for creating new users

For any detailed advice , Please elaborate your question.

Dilip Krishna
  • 139
  • 3
  • 16