I’m trying to implement functions on App Platform, but am struggling to hook up the various pieces to each other. I’m using Django on linux.
I followed this tutorial https://github.com/digitalocean/sample-functions-python-jokes and was able to run the function in its own namespace in Functions (unconnected to App Platform).
Then I tried to adapt it to my own, but needed to import environmental variables. I think you can’t do that from Functions, you have to add it as a resource on your app in App Platform itself, following this tutorial: https://docs.digitalocean.com/products/app-platform/how-to/manage-functions/. I got the function to build again, but can’t figure out how to trigger it.
The url it shows in the control panel after build is joke/joke.
<mydomain>/joke/joke
and Django returned "404 Page Not Found"
. This is what they allege is the live function URL.<mydomain>/do-functions-sample-jokes/
and it returned "Incomplete web function path. The path must contain /$namespace/$package/$function, $package can be 'default'."
<mydomain>/do-functions-sample-jokes/joke/joke/
and it returned “There was an error processing your request.”/joke/joke
, and it doesn’t return anything except the html header<mydomain>/beyondyield1/do-functions-sample-jokes/joke
and <mydomain>/beyondyield1/do-functions-sample-jokes/joke/joke
and Django still tries to intercept it, and returns a 404.How do I trigger this function and fetch the results?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
Indeed, as you mentioned, to find the live URL of each function in your Function component, click to the Settings tab of your app and click the Function component you’d like to inspect:
I’ve just tested this and it seems to be working as expected on
<mydomain>/joke/joke
:Do you by any chance have any custom routes defined that could be causing the issue?
Also, are you using the demo Jokes function or is it a custom one that you’ve built?
Best,
Bobby