How to include state files in python build?

Connected Tutorial
This question is a follow-up to this tutorial:

I need to include both python and static files in my site. I’ve added a static component as well a python one but am getting errors “! Directory /workspace/static does not exist” for the output dir. What is the output dir? Should I have created it and if so how? Or is this an internal bug?


Ok, there’s a typo in the title, that should of course be “How to include static files in python build”.

Submit an 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.

Ok, so it looks like I may have fixed this. What I did was delete the static component. I then changed the request route of the python component so that it wasn’t just ‘/’ and added a new folder to the repo to keep static files in and added an ‘index.html’ file. The site now serves both python and static files. It’s difficult to know what fixed the issue but my best guess is that the static component expects there to be an ‘index.html’ file and if it doesn’t find one it gives errors