python-3.x - invalid syntax for unknown reason
问题描述
I'm doing some django stuffs using vs code and this error in the line 3 ("from") happend for no reason.
from django.urls import path
from * import views
urlpatterns = [path(" ",views,name="home")]
解决方案
您的第二次导入似乎不正确。
语法应该是:
from <module> import <library / *>
在你的情况下,它应该是:
from views import *
这应该是正确的,只要视图模块确实存在并且可以被python找到。
推荐阅读
- r - R函数中的子集
- ansible - 更改 Ansible 查找文件的位置
- spring - 错误:启动失败:确定启动命令:当没有默认进程时需要命令
- android - 将视图添加到具有时间延迟的活动?
- r - 检测具有连续 1/TRUE 的行序列何时开始和结束 R dplyr
- flutter - ListView Builder 使用 If Condition return 语句需要空格
- php - PHP 选择不能在任何服务器上运行
- git - 将某些文件从主目录推送到 git repo 以更轻松地设置新盒子
- python - 在python中将多个整数变量重新编码为一个
- aggregate - ASP Clingo - 获取原子的确切数量