'How to render .astro files in django
I tried to create a Django web app since the web pages had heavy js files so it took a long time to load the page. To tackle this problem I tried to implement Astro to create a static webpage.
But the problem here is that Django renders .astro files also as HTML.
How do I tell Django to render .astro as an Astro file
Solution 1:[1]
Astro is a static site generator built on top of node.js. To have your static site served from your django application you would first need to build astro out, using:
npm run build or yarn build to have your site output in the ./dist directory. From here you can then point your django server to serve those files.
Since Astro files are static they can be deployed in a number of different ways, you can read more about this here
Hope that helped buddy, if you got any more questions you could always come and ask them in the discord channel
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dr Gaud |
