2016-04-29 113 views
0

我的烧瓶web应用上的页面正常显示,但服务器不断返回错误:错误13,权限被拒绝。 有人可以帮我弄清楚这里发生了什么? 代码为我的意见文件:对于HTML烧瓶权限访问被拒绝在服务器上显示

@app.route('/') 
@app.route('/index', methods=['GET', 'POST']) 
def index(): 
    login_link = True 
    if request.method == 'POST': 
     return redirect(url_for('personal')) 
    return render_template('index.html', login_link = login_link) 


@app.route('/<path:path>') 
def catch_all(path): 
    my_path = path.split('/') 
    login_link = False 
    page_title = my_path[len(my_path) - 1] 
    page_link = "" 
    page_heading = "" 
    if page_title == 'today': 
     page_title = "Today" 
     page_heading = "Events Scheduled for Today" 
     page_link = "today.html" 
    elif page_title == 'next': 
     page_title = "This Week" 
     page_heading = "Events for Next Seven(7) Days" 
     page_link = "today.html" 
    elif page_title == 'personal': 
     page_title = "Personal" 
     page_heading = "Add Personal Tasks" 
     page_link = "addtask.html" 

代码调用个人网页:

<form class="ui form" action="personal" method="" style="margin-right: 20px; margin-top: 20px;"> 
     <div class="field"> 
      <label>Username</label> 
      <div class="ui left icon input"> 
      <input name="username" placeholder="Username" type="text"> 
      <i class="user icon"></i> 
      </div> 

我注意到,当它试图获取favicon.ico的文件服务器引发错误。我当然不会在我的工作中添加一个图标。以下是命令行服务器显示。

* Debugger is active! 
* Debugger pin code: 585-133-842 
* Detected change in 'E:\\My_Andela_Project\\Semantic\\DoWell_Web_App\\dowell\\views.py', reloading 
* Restarting with stat 
* Debugger is active! 
* Debugger pin code: 585-133-842 
127.0.0.1 - - [29/Apr/2016 11:11:09] "GET /index HTTP/1.1" 200 - 
127.0.0.1 - - [29/Apr/2016 11:11:10] "GET /favicon.ico HTTP/1.1" 500 - 
Traceback (most recent call last): 
    File "E:\My_Andela_Project\DoWell_Web_App\flask\lib\site-packages\flask\app.py", line 1836, in __call__ 
    return self.wsgi_app(environ, start_response) 
    File "E:\My_Andela_Project\DoWell_Web_App\flask\lib\site-packages\flask\app.py", line 1820, in wsgi_app 
    response = self.make_response(self.handle_exception(e)) 
    File "E:\My_Andela_Project\DoWell_Web_App\flask\lib\site-packages\flask\app.py", line 1403, in handle_exception 
    reraise(exc_type, exc_value, tb) 
    File "E:\My_Andela_Project\DoWell_Web_App\flask\lib\site-packages\flask\_compat.py", line 33, in reraise 
    raise value 
+0

Errno 13指向文件系统权限问题,请确保您已将它们设置正确,并且烧瓶进程可以访问所有项目文件。 –

+0

通常你在_Flask_之上有一个Web服务器。检查Web服务器是否在必要的用户权限下运行。 – davidshen84

+0

谢谢您快速回复我。据我所知,文件或服务器上没有权限设置。但我只是注意到在cmd行服务器显示的顶部有一些东西。 编辑初始文章以包含显示。 – Anselm

回答

0

谢谢你们。你一直很有帮助。所以我通过为我的工作实际提供一个图标来解决问题。我偶然发现了烧瓶目录中的日志文件。所以我决定添加一个favicon并解决了这个问题。

\flask\Lib\site-packages\werkzeug\debug\tbtools.py: 
    <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css" type="text/css"> 
    <!-- We need to make sure this has a favicon so that the debugger does 
    not by accident trigger a request to /favicon.ico which might 
    change the application state. --> 
    <link rel="shortcut icon"