generated from mwc/lab_server
Initial commit
This commit is contained in:
8
poem_server/app/views.py
Normal file
8
poem_server/app/views.py
Normal 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}
|
||||
Reference in New Issue
Block a user