BuildError: Could not build url for endpoint 'main.index'. Did you mean 'main.indexs' instead?
2017-08-31 16:08
4127 查看
最近用flask实现用户注册登录的时候,遇到这个问题
找了半天,最后发现根源在base.html
找到base.html,发现里面这么写的:
这里写的是url_for(‘main.index’) ,所以应该把前面蓝本中views.py里面的视图函数名改成 index 就可以了
werkzeug.routing.BuildError BuildError: Could not build url for endpoint 'main.index'. Did you mean 'main.indexs' instead?
找了半天,最后发现根源在base.html
找到base.html,发现里面这么写的:
<div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li> <a href="{{ url_for('main.index') }}">Home</a> </li> </ul> </div>
这里写的是url_for(‘main.index’) ,所以应该把前面蓝本中views.py里面的视图函数名改成 index 就可以了
相关文章推荐
- BuildError: Could not build url for endpoint 'show'. Did you mean 'api.show' instead?
- BuildError: Could not build url for endpoint 'auth.register'(关键词:Web开发/Flask/bug)
- ant build Error occurred during initialization of VM Could not reserve enough space for object heap
- 'NSURL' is not implicitly convertible to 'URL'; did you mean to use 'as' to explicitly convert?异常
- ERROR (DiscoveryFailure): Could not determine a suitable URL for the plugin
- Vitamio 导入依赖库出错 :Error:(9, 0) Could not get unknown property 'ANDROID_BUILD_SDK_VERSION' for project
- 访问Storm ui界面,出现org.apache.storm.utils.NimbusLeaderNotFoundException: Could not find leader nimbus from seed hosts ["master" "slave1"]. Did you specify a valid list of nimbus hosts for confi的问题解决(图文详解)
- 访问Storm ui界面,出现org.apache.storm.utils.NimbusLeaderNotFoundException: Could not find leader nimbus from seed hosts ["master"]. Did you specify a valid list of nimbus hosts for confi的问题解决(图文详解)
- Could not install the app on the device, read the error above for details. Make sure you have an And
- Error:Could not get unknown property ‘apkVariantData’ for object of type com.android.build.gradle.in
- Could not install the app on the device, read the error above for details. Make sure you have an And
- Bean property 'interceptorDao' is not writable or has an invalid setter method. Did you mean 'interc
- org.hibernate.exception.SQLGrammarException: could not inYou have an error in your SQL syntax;完美解决错误
- Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
- 错误:Could not create the Android package. See the Output (Build) window for more details
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id
- Android Studio “Error:Could not find com.android.tools.build:gradle:2.14.1”的解决方法
- Linux 下 Error: Could not find or load main class Hello world
- Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameter 标签: 构造器注入Spring
- 社交分享:-canOpenURL: failed for URL: "weixin://app/*************/" - error: "This app is not allowed to query for scheme weixin"