Django serve static index.html with view at '/' url

后端 未结 5 2039
面向向阳花
面向向阳花 2020-12-25 11:14

I have my index.html in /static/ folder. My django app is running ok when i try:

http://127.0.0.1:8000/index.html

But i want to acces index

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-25 11:36

    Just wrap your static HTML file in an iframe defined in a templated HTML file. With some style tweaks can make the iframe 100% width and height.

    {% load static %}
    
        
            Templated HTML
    
            
        
        
            {{ content }}
            
        
    
    

提交回复
热议问题