-1

I'm new in django rest framework. I have User model that I created with (models.Model) and now I want to make API for register User in this model and I don't know what should I do in views.py and serializers.py?

class Restaurant_User(models.Model):
Restaurant_Owner_UserName = models.EmailField(unique=True, default='')  # Email Of Restaurant Owner.
Restaurant_Owner_Phone = models.IntegerField(unique=True, default='')  # Phone Number Of Restaurant Owner.
Restaurant_Password = models.CharField(max_length=32, default='')
  • Does this answer your question? [How to register users in Django REST framework?](https://stackoverflow.com/questions/16857450/how-to-register-users-in-django-rest-framework) – g.mark11 Apr 26 '20 at 10:38

1 Answers1

0

Everything what you need is available at the official page of Rest Framework (https://www.django-rest-framework.org/). There is a tutorial section where you can see every steps for making a full API. If you are done, you can use Postman for testing.

g.mark11
  • 106
  • 5
  • 19
  • I know this site but I couldn't find my answer – amir rasoul Apr 26 '20 at 10:34
  • https://www.django-rest-framework.org/tutorial/1-serialization/, https://www.django-rest-framework.org/tutorial/2-requests-and-responses/, https://www.django-rest-framework.org/tutorial/3-class-based-views/ – g.mark11 Apr 26 '20 at 10:37