We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I am struggling with a simple task: "serve my static files from CDN (say, public google cloud storage)". In Django, I would simply do:
STATIC_URL = "https://googleapis..."
but I can't figure out how to deal with this in starlette (I am using fastapi)
Related:
The text was updated successfully, but these errors were encountered:
I'd suggest including STATIC_URL in your template contexts, and using {STATIC_URL}/whatever.css in the template.
STATIC_URL
{STATIC_URL}/whatever.css
You'll probably also want to do some config setup so that in development you serve from http://127.0.0.1/statics and include StaticFiles in that case.
http://127.0.0.1/statics
Sorry, something went wrong.
Thanks, that was my backup plan, I was hoping for solution with url_for. But understandable, thanks.
url_for
Do you think it would be worth it to add it into docs to static files section? Should I do a PR?
No branches or pull requests
Hi,
I am struggling with a simple task: "serve my static files from CDN (say, public google cloud storage)". In Django, I would simply do:
but I can't figure out how to deal with this in starlette (I am using fastapi)
Related:
The text was updated successfully, but these errors were encountered: