Last active
January 12, 2016 21:24
-
-
Save jonataa/aa1268aea065052b7f5a to your computer and use it in GitHub Desktop.
PUT method for unexisting document is not working on the Python-EVE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| eve==0.6.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from eve import Eve | |
| if __name__ == "__main__": | |
| app = Eve() | |
| app.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| MONGO_HOST = os.environ.get('HOST', '127.0.0.1') | |
| MONGO_PORT = os.environ.get('PORT', 27017) | |
| MONGO_USERNAME = os.environ.get('USERNAME', None) | |
| MONGO_PASSWORD = os.environ.get('PASSWORD', None) | |
| MONGO_DBNAME = os.environ.get('DBNAME', 'foo') | |
| IF_MATCH = False | |
| ITEM_METHODS = ['PUT'] | |
| UPSERT_ON_PUT = True | |
| persons = { | |
| 'schema': { | |
| 'firstname': { | |
| 'type': 'string' | |
| }, | |
| 'lastname': { | |
| 'type': 'string' | |
| } | |
| } | |
| } | |
| DOMAIN = { | |
| 'persons': persons | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment