masonite“ Post”对象没有属性“ controller”

时间:2019-04-04 00:33:11

标签: python frameworks masonite

我在Masonite项目中有一个控制器,但我不知道为什么会引发此错误。这是我的代码段:

<!DOCTYPE html>
    <html lang="en" dir="ltr">
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width-device-width, initial-scale=1.0">
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
        <link rel="stylesheet" href="assets/css/master.css">
        <title>Learning Form Animation</title>
      </head>
      <body>
    
        <form>
          <div class="field-name">
            <i class="fas fa-user"></i>
            <input type="text" placeholder="Username" required>
            <i class="fas fa-arrow-down"></i>
          </div>
          <div class="field-email">
            <i class="fas fa-envelope"></i>
            <input type="email" placeholder="Email" required>
            <i class="fas fa-arrow-down"></i>
          </div>
          <div class="field-password">
            <i class="fas fa-key"></i>
            <input type="password" placeholder="Password" required>
            <i class="fas fa-arrow-down"></i>
          </div>
          <div class="field-finish">
            <i class="fas fa-heart"></i>
            <p>Thank you!</p>
            <i class="fas fa-heart"></i>
          </div>
        </form>
    
      </body>
      <script src="assets/js/main.js"></script>
    </html>

1 个答案:

答案 0 :(得分:0)

如果您的应用程序中存在某种错字,通常会发生这种情况。它有点模棱两可,没有指向特定的示例,但是如果您在最后一行注意到,您有一个def restore(self, view: View, upload: Upload): upload.accept_file_types = None filename = upload.store(self.request.input('dump')) site = Site.find(self.request.input('site_id')) site.server.connect().put( static('disk', 'uploads/') + filename, '/dumps/postgres/'+filename ) return 'uploaded?' + 符号,这是语法错误。删除该问题将解决此问题。