π» API Progress Check-In π»
Posted on Jun 2nd, 2022
ποΈ Todayβs Topics
- How are the projects coming along? π
- Automatic deploys from GitHub
- Paginating your API
π― Project
Keep on going. πͺ π
We will use class time today to get you past any blockers you may be experiencing and to talk through next steps.
By now you should have provided your front end with a way to log in and log out, and endpoints to see data. By tomorrow you should have the ability to POST data.
π Read | πΊ Watch | π§ Listen
On Monday weβll be covering full-text search in your API, but if you have time you can check these resources out in advance.
- Search from the Ground Up -> DjangoCon 2019 video explaining search in detail
- π Basic and Full-Text Search with Django and Postgres
- π Blog post with more on full-text search
- π If you want A LOT more detail about full-text search in Postgres and Django, this blog piece has you covered
π Resources
Heroku GitHub integration
Authentication
Make sure you are sharing the Djoser information with your front end. You should include the authentication endpoints in your API documentation or project README.
- Base Endpoint Guide for Djoser -> includes create a new user and other nice stuff
- Token Authentication Endpoint Guide for Djoser -> details on the token auth endpoints
Creating a properly hashed password
In order to save a properly hashed password when you create a new user in the Django Admin, make sure you are using UserAdmin
in admin.py
so that you have that option in the admin interface. If you donβt do this and save an unhashed password, you will run into authentication errors.
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
...
admin.site.register(User, UserAdmin)
You can also change a password from the command line: