Skip to content

Commit

Permalink
Merge branch 'master' of github.com:agiliq/building-api-django
Browse files Browse the repository at this point in the history
  • Loading branch information
shabda committed Mar 8, 2018
2 parents 7bc5b3f + 8dcdaac commit e1fac97
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/django_pollsapi/circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
machine:
python:
version: 2.7.6
environment:
DATABASE_URL: postgres://postgres:@127.0.0.1:5432/django_pollsapi

dependencies:
pre:
- pip install --upgrade pip==1.5.6
override:
- pip install -r requirements.txt

database:
post:
- psql -U ubuntu -d template1 -c 'create extension if not exists hstore;'
- psql -U ubuntu -d circle_test -c 'drop extension hstore; create extension if not exists hstore schema pg_catalog;'
56 changes: 56 additions & 0 deletions code/django_pollsapi/pollsapi_swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,62 @@
"200": {"description":"Poll created successfully"}
}
}
},
"/user": {
"get": {
"tags": ["user"],
"summary": "Get user details",
"description": "",
"operationId": "user",
"consumes": ["application/json","application/xml"],
"produces": ["application/xml","application/json"],
"parameters": [{
"in": "query",
"name": "body",
"description": "Get the user.",
"required": false,
"schema":{"$ref":"#/pollsapi/User"}
}],
"responses": {"200":{"description":"Successfull operation"}},
},
"post":{
"tags": ["user"],
"summary": "Create a new user",
"description": "Creates a new user.",
"operationId": "createUser",
"consumes":["application/json","application/xml"],
"produces":["application/xml","application/json"],
"parameters":[{
"in":"query",
"name":"body",
"description": "User object that needs to be added.",
"required": true,
"schema": {"$ref":"#/pollsapi/User"}
}],
"responses": {
"200": {"description":"User created successfully"}
}
}
},
"/vote": {
"post":{
"tags": ["vote"],
"summary": "Create a new vote",
"description": "Creates a new vote.",
"operationId": "createVote",
"consumes":["application/json","application/xml"],
"produces":["application/xml","application/json"],
"parameters":[{
"in":"query",
"name":"body",
"description": "Vote object that needs to be added.",
"required": true,
"schema": {"$ref":"#/pollsapi/Vote"}
}],
"responses": {
"200": {"description":"Vote created successfully"}
}
}
}
}
}
17 changes: 17 additions & 0 deletions code/django_pollsapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
appnope==0.1.0
decorator==4.0.6
Django==1.9.1
django-extensions==1.6.1
djangorestframework==3.3.2
gnureadline==6.3.3
ipdb==0.8.1
ipython==4.0.2
ipython-genutils==0.1.0
path.py==8.1.2
pexpect==4.0.1
pickleshare==0.5
ptyprocess==0.5
simplegeneric==0.8.1
six==1.10.0
traitlets==4.1.0
wheel==0.24.0

0 comments on commit e1fac97

Please sign in to comment.