diff --git a/demo/apps/apijson_demo/settings.ini b/demo/apps/apijson_demo/settings.ini index 25d0c54..1bf78f9 100644 --- a/demo/apps/apijson_demo/settings.ini +++ b/demo/apps/apijson_demo/settings.ini @@ -4,6 +4,15 @@ comment = 'apijson_demo.models.Comment' moment = 'apijson_demo.models.Moment' [APIJSON_MODELS] +user = { + "user_id_field" : "id", + "secret_fields" : ["password"], + "GET" : { "roles" : ["LOGIN","ADMIN","OWNER"] }, + "HEAD" : { "roles" : ["LOGIN","ADMIN","OWNER"] }, + "POST" : { "roles" : ["ADMIN"] }, + "PUT" : { "roles" : ["ADMIN","OWNER"] }, + "DELETE" : { "roles" : ["ADMIN"] }, +} moment = { "user_id_field" : "user_id", "GET" : { "roles" : ["OWNER","LOGIN","ADMIN"] }, diff --git a/demo/apps/apijson_demo/templates/index.html b/demo/apps/apijson_demo/templates/index.html index 2c582e7..2925a1d 100644 --- a/demo/apps/apijson_demo/templates/index.html +++ b/demo/apps/apijson_demo/templates/index.html @@ -23,9 +23,48 @@ + + + + + + 📋 {item.label} + + + + + + + 📋 {item.label} + + + + + + + 📋 {item.label} + + + + + + + 📋 {item.label} + + + + + + + 📋 {item.label} + + + + +
login user
- + {{if request.user:}}
Logout
{{else:}} @@ -33,79 +72,61 @@ {{pass}}
-
HTTP POST URL
- +
HTTP POST URL
+
-
apijson get request {request_get.length} examples
- - - {index+1}. {item.label} - - +
example name
+
HTTP HEAD URL
- +
-
apijson head request {request_head.length} examples
- - - {index+1}. {item.label} - - +
example name
+
-
POST URL
- +
POST URL
+
-
apijson post request {request_post.length} examples
- - - {index+1}. {item.label} - - +
example name
+
PUT URL
- +
-
apijson put request {request_put.length} examples
- - - {index+1}. {item.label} - - +
example name
+
DELETE URL
- +
-
apijson delete request {request_delete.length} examples
- - - {index+1}. {item.label} - - +
example name
+
request data
- +
Post
response data
- +
+
+