Use Django and the Django REST Framework to build an API of books.
- Fork and clone this repository.
- Change into the new directory.
- Set up a virtual environment and install dependencies.
- Fulfill the listed requirements.
Please turn in your submission by the deadline on your cohort calendar.
Create a new Django project and app.
Define a Book
model and create a few instances through the admin interface.
Don't forget to create a new database and user in Postgres!
Install the djangorestframework
module for the next section.
Define a ModelSerializer
for your Book Model.
Note: Do not use the
HyperlinkedModelSerializer
serializer. That serializer is for linked models. Here we have just a plain model.
Once you have your model and serializer in place, use the generic views to create your views and URLs.
Make it so you can perform full CRUD on your Book model (without needing to be logged in).
Implement a User
model with authentication. Users should be able to create an
account, sign in (through the API, not a UI), and get a token.
Set up permissions so that any user can read books from your database (both list and detail), but only authenticated users can create, update, or delete books.
Implement one of the following as a bonus. When you finish, implement the rest!
- All content is licensed under a CCBYNCSA 4.0 license.
- All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].