reset_migrations | Django migrations with just one press | Data Migration library
kandi X-RAY | reset_migrations Summary
kandi X-RAY | reset_migrations Summary
Reset Django migrations script.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of reset_migrations
reset_migrations Key Features
reset_migrations Examples and Code Snippets
Community Discussions
Trending Discussions on reset_migrations
QUESTION
I'm creating API for Twitter like app in Django and since I implemented token authentication (rest-auth) I have problem with creating new tweets as it throws:
...ANSWER
Answered 2019-Jul-12 at 17:21In your serializer you have author
in the list of fields. Since it's a ModelSerializer
, drf is picking up details for that field from the model, and in the model author is null = False
by default, hence drf is making it a required field, since it can't be null. But since you want the author to be automatically the user who is making the request, you don't need that field to be editable. Hence make it a read only field in your serializer like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reset_migrations
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page