These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
python manage.py createsuperuser
python manage.py runserver
Then go to http://127.0.0.1:8000 in your browser
python manage.py test
python manage.py test && flake8
or you can simple run flake8
docker build .
This API is for when multiple users use it together. If you blog alone, please disable this api or just disable account creation api
in users/controllers.py
# disable this class if you using alone
api_controller("/auth", tags=["users"], auth=JWTAuth())
class UserController:
@route.post(
"/create", response={201: UserTokenOutSchema}, url_name="user-create", auth=None
)
def create_user(self, user_schema: CreateUserSchema):
user = user_schema.create()
token = SlidingToken.for_user(user)
return UserTokenOutSchema(
user=user,
token=str(token),
token_exp_date=datetime.utcfromtimestamp(token["exp"]),
)
...