Initial commit

This commit is contained in:
2024-04-08 17:54:04 +00:00
commit 23c223af7d
9 changed files with 954 additions and 0 deletions

8
poem_server/app/views.py Normal file
View File

@@ -0,0 +1,8 @@
from banjo.urls import route_get, route_post
from banjo.http import BadRequest, NotFound
from app.models import Line, Poem, Rhyme
from random import choice, sample
@route_get('lines/random', args={})
def get_random_line(params):
return {'line': Line.objects.random().text}