在安装Ubuntu作为WSL(适用于Linux的Windows子系统)之后,我运行了:
root@teclast:~# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
Run Code Online (Sandbox Code Playgroud)
并尝试从我的Windows计算机访问该Web服务器http://0.0.0.0:8000或http://192.168.1.178:8000仅由地址,但没有成功,可用的网络服务器http://127.0.0.1:8000或http://localhost:8000那就意味着我无法从我的网络中的另一台电脑连接到这个网络服务器.是否可以从外部访问WSL?
如何插入pdb.set_trace()django 模板?或者也许在模板内运行一些其他调试。
我有以下模型和协会:
class Organization
has_many :buildings
end
class Building
has_many :counters
end
class Counter
has_many :counter_records
end
class CounterRecord
belongs_to :counter
end
Run Code Online (Sandbox Code Playgroud)
我想得到这样的东西
organization.counter_records(dimension_day: start_date...end_date)
Run Code Online (Sandbox Code Playgroud)
([dimension_day: start_date...end_date]- 这是条件).
如何organization通过所有这些模型获得计数器记录?