January 2019
Beginner to intermediate
776 pages
19h 58m
English
First make sure that you have the domain configurations saved as a Python file named settings.py in the same folder as your program. In this recipe, we have included a simple settings.py with the following content as a sample:
DOMAIN = {'people': {}}
If settings.py is not found, the program will halt with the following error:
eve.exceptions.ConfigException: DOMAIN dictionary missing or wrong.
Listing 11.9 gives a REST server with BasicAuth as follows:
#!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 11 # This program is optimized for Python 2.7.12 and Python 3.5.2. # It may run on any other version with/without modifications. from eve import Eve from eve.auth import BasicAuth class ...
Read now
Unlock full access