python Bottle chrome icon 오류가 발생하면!
python Bottle chrome icon 오류가 발생하면!
Failed to load resource: the server responded with a status of 404 (Not Found)
 
정말 기분 나쁜 오류입니다.
"ico 파일이 없다는 오류"
ico 파일을 만들었지만 어디에 넣으면 좋을까!
해결책 여러가지가, Bottle의 입장에 서서 생각하자.
bottle.pyfrom bottle import *
@route('/favicon.ico')
def favcon():
    return static_file('favicon.ico', root='./static')
favicon.ico를 부르러 왔을 때에 static 폴더아래에 둔 ico를 로드해 주자.
C:.
│  app.py
│  bottle4j_ico.pyproj
│  bottle4j_ico.pyproj.user
│  requirements.txt
│  routes.py
├─static
│  │  favicon.ico ### ここにICOファイルを配置
│  ├─content
│  │      bootstrap-grid.css
│  │      bootstrap-grid.css.map
│  │      bootstrap-grid.min.css
│  │      bootstrap-grid.min.css.map
│  │      bootstrap-reboot.css
│  │      bootstrap-reboot.css.map
│  │      bootstrap-reboot.min.css
│  │      bootstrap-reboot.min.css.map
│  │      bootstrap.css
│  │      bootstrap.css.map
│  │      bootstrap.min.css
│  │      bootstrap.min.css.map
│  │      jumbotron.css
│  │      site.css
│  │
│  ├─fonts
│  │      glyphicons-halflings-regular.eot
│  │      glyphicons-halflings-regular.svg
│  │      glyphicons-halflings-regular.ttf
│  │      glyphicons-halflings-regular.woff
│  │
│  └─scripts
│          bootstrap.bundle.js
│          bootstrap.bundle.js.map
│          bootstrap.bundle.min.js
│          bootstrap.bundle.min.js.map
│          bootstrap.js
│          bootstrap.js.map
│          bootstrap.min.js
│          bootstrap.min.js.map
│          jquery-1.10.2.intellisense.js
│          jquery-1.10.2.js
│          jquery-1.10.2.min.js
│          jquery-1.10.2.min.map
│          jquery.validate-vsdoc.js
│          jquery.validate.js
│          jquery.validate.min.js
│          jquery.validate.unobtrusive.js
│          jquery.validate.unobtrusive.min.js
│          modernizr-2.6.2.js
│          respond.js
│          respond.min.js
│          _references.js
│
├─views
│      about.tpl
│      contact.tpl
│      index.tpl
│      layout.tpl
│
 
예 사라졌습니다!
"좋아요"하고.
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(python Bottle chrome icon 오류가 발생하면!), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/hiratarich/items/7f421c9dcda999ed1d6b
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
from bottle import *
@route('/favicon.ico')
def favcon():
    return static_file('favicon.ico', root='./static')
C:.
│  app.py
│  bottle4j_ico.pyproj
│  bottle4j_ico.pyproj.user
│  requirements.txt
│  routes.py
├─static
│  │  favicon.ico ### ここにICOファイルを配置
│  ├─content
│  │      bootstrap-grid.css
│  │      bootstrap-grid.css.map
│  │      bootstrap-grid.min.css
│  │      bootstrap-grid.min.css.map
│  │      bootstrap-reboot.css
│  │      bootstrap-reboot.css.map
│  │      bootstrap-reboot.min.css
│  │      bootstrap-reboot.min.css.map
│  │      bootstrap.css
│  │      bootstrap.css.map
│  │      bootstrap.min.css
│  │      bootstrap.min.css.map
│  │      jumbotron.css
│  │      site.css
│  │
│  ├─fonts
│  │      glyphicons-halflings-regular.eot
│  │      glyphicons-halflings-regular.svg
│  │      glyphicons-halflings-regular.ttf
│  │      glyphicons-halflings-regular.woff
│  │
│  └─scripts
│          bootstrap.bundle.js
│          bootstrap.bundle.js.map
│          bootstrap.bundle.min.js
│          bootstrap.bundle.min.js.map
│          bootstrap.js
│          bootstrap.js.map
│          bootstrap.min.js
│          bootstrap.min.js.map
│          jquery-1.10.2.intellisense.js
│          jquery-1.10.2.js
│          jquery-1.10.2.min.js
│          jquery-1.10.2.min.map
│          jquery.validate-vsdoc.js
│          jquery.validate.js
│          jquery.validate.min.js
│          jquery.validate.unobtrusive.js
│          jquery.validate.unobtrusive.min.js
│          modernizr-2.6.2.js
│          respond.js
│          respond.min.js
│          _references.js
│
├─views
│      about.tpl
│      contact.tpl
│      index.tpl
│      layout.tpl
│
Reference
이 문제에 관하여(python Bottle chrome icon 오류가 발생하면!), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/hiratarich/items/7f421c9dcda999ed1d6b텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)