'How to add subdomain for endpoint in Python EVE
I am using Python Eve for creating different endpoints. I want to add subdomain to certain endpoint.
There is an way to create this through their custom endpoint feature like below
agent_login = Blueprint("agentlogin", __name__, url_prefix="/agent", subdomain='<username>')
@agent_login.route("/login", methods=['GET', 'POST'])
def agentlogin(username):
""" Code HERE """
pass
Is there a way to achieve this in settings.py where we define DOMAIN?
DOMAIN = {
"index": {
'item_title': 'index',
'additional_lookup': {
'url': 'regex("[\d]+")',
'field': 'job_id'
},
'cache_control': 'max-age=10,must-revalidate',
'cache_expires': 10,
# most global settings can be overridden at resource level
'resource_methods': ['GET', 'POST'],
'schema': index_schema
},
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|