我有Apache2.4 + mod_wsgi + Python3.6(在win10 x64上)的问题.
当我尝试访问网站时,我在Apache中收到此错误:
[Wed Mar 22 22:52:19.162397 2017] [wsgi:error] [pid 10872:tid 1256] [client 176.8.x.x:32227] mod_wsgi (pid=10872): Target WSGI script 'C:/wampstack-5.6.30-1/apache2/htdocs/myproject/myproject/wsgi.py' cannot be loaded as Python module.
[Wed Mar 22 22:52:19.162397 2017] [wsgi:error] [pid 10872:tid 1256] [client 176.8.x.x:32227] mod_wsgi (pid=10872): Exception occurred processing WSGI script 'C:/wampstack-5.6.30-1/apache2/htdocs/myproject/myproject/wsgi.py'.
[Wed Mar 22 22:52:19.163396 2017] [wsgi:error] [pid 10872:tid 1256] [client 176.8.x.x:32227] Traceback (most recent call last):\r
[Wed Mar 22 22:52:19.163893 2017] [wsgi:error] [pid 10872:tid 1256] [client 176.8.x.x:32227] File "C:/wampstack-5.6.30-1/apache2/htdocs/myproject/myproject/wsgi.py", line 16, …Run Code Online (Sandbox Code Playgroud) 我无法弄清楚这些括号在这段代码中的作用:
func main() {
router := gin.Default()
v1 := router.Group("/v1")
{ // <- these brackets
v1.POST("/login", loginEndpoint)
v1.POST("/submit", submitEndpoint)
v1.POST("/read", readEndpoint)
} // <- and these
v2 := router.Group("/v2")
{ // <- and these
v2.POST("/login", loginEndpoint)
v2.POST("/submit", submitEndpoint)
v2.POST("/read", readEndpoint)
} // <- and these
router.Run(":8080")
}
Run Code Online (Sandbox Code Playgroud)
从这里获取此代码: https: //github.com/gin-gonic/gin#grouping-routes 你能解释一下吗?