How to include state files in python build?

Posted October 6, 2021 91 views
GitDigitalOceanHTMLSpin UpDigitalOcean App Platform

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?

1 comment

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.

Submit an Answer
1 answer

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

  • Hi Harissa,

    This does seem to have been related to routing. If both components in the app have the same route configured it would fail. Setting the python component to a different route would allow the static component to use / and python to use the new route avoiding conflicting routes.