Open pexpert opened 4 years ago
As you're not using a domain name, have you added /dev to the beginning of the path of your urls?
As you're not using a domain name, have you added /dev to the beginning of the path of your urls?
Thanks for your reply.
My path is something like that:
https://XXX.execute-api.sa-east-1.amazonaws.com/dev/search
As you can see, search is the route of my Flask application.
How are you passing the API key to API gateway?
Simpler question: does it work without api_key_required?
Actually, no. I described what happens when I remove the API key:
After suspecting that the api_key_required camp could be the problem, I removed it. But instead, I got another error: "TypeError: 'NoneType' object is not callable. Now I am even more lost.
Do you have an app.py file on the same directory you have zappa_settings.json and does that file app.py define a WSGI app in the variable app? If not, your function_name needs to be changed.
@pexpert look at your cloud watch logs for the lambda function Zappa creates. This NoneType error can occur after another error. In my case, I was causing an OSError, but because of the way the error handling works, I was seeing the NoneType error in my browser.
Getting a 403 with api_key_required
set to both false
& true
Context
After successfully deploying my Flask application, I am having trouble accessing it. When I make a request using Postman, for example, I receive "Forbidden" as a message.
Expected Behavior
After finishing the deployment, I received a link for my app and tried accessing the routes I programmed in Flask. I expected that passing it through Postman, and adding the api_key as authentication, I would be able to access my API.
Actual Behavior
Instead, I am getting "Forbidden" as a return for my call.
Possible Fix
After making some diggings here, I suspected that using the api_key function could be the problem. Someone suggested that I should change the configuration in AWS Gateway API > Custom Domain Names but there are no API registered there, which raised some warnings in my head. Maybe there is a problem in my permission of AWS that is not allowing it to create the project on Gateway API? I don't know.
After suspecting that the api_key_required camp could be the problem, I removed it. But instead, I got another error: "TypeError: 'NoneType' object is not callable. Now I am even more lost.
Steps to Reproduce
Your Environment
pip freeze
:zappa_settings.json
: