Closed rivernews closed 5 years ago
Actions
Notes: things about static files: S3 can help too, host as a static website, redirection rules, etc. An example for writing routing rules, it's like XML format.
Ok, we've done:
url(*) => RedirectView to /static/*
in DjangoBut got:
http://shaungc.com/static/
, but got the XML format page of S3, basically listing all the S3 root directory files.Possible solutions
/static/index.html
.
shaungc.com -> shaungc.com/static/index.html -> shaungc.com
, shows a partial frontend page.kubernetes_ingress
, add a new route for / -> S3 static index.html
shaungc.com
index page OK/django-health-check/
using Django's route OK as well.The admin portal static file issue is still not working, we'll continue to address that in issue #9 .
Issue resolved, closing issue.
Code changes are in terraform privisioning repository.
Ideas
/
, this is routed to django service/static/
is routed to S3/
hit django service. If you look aturls.py
, you'll geturl(r'^.*$', serve, kwargs={'path': 'index.html'})
. Several issues here:serve
may not be working at all since DEBUG=False.serve
is working, django may have trouble accessing'path': 'index.html
, which seem to access only local filesystem.index.html
. After all,index.html
will not be re-routed for/static/index.html
. This might explain why DEBUG=True works, becauseserve
might re-route to/static/...
for you.Solutions alternatives:
/
tostatic/index.html
in django view/
to S3'sindex.html
.