By lauren
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.