我正在运行单个实例t1.micro来使用开源erp程序来托管centos现在我还希望用第二个erp程序托管另一个实例.这是否在我的免费等级限制范围内.
我可以使用/启动的实例#是否有计数?
我可以关联多少弹性Ip?
从flask实现一个简单的静态站点,但浏览器说找不到模板,shell返回404
jinja2.exceptions.TemplateNotFound
TemplateNotFound: template.html
Run Code Online (Sandbox Code Playgroud)
主要的python代码:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def template_test():
return render_template('template.html', my_string="Wheeeee!", my_list=[0,1,2,3,4,5])
if __name__ == '__main__':
app.run(debug=True)
Run Code Online (Sandbox Code Playgroud)
我有以下文件结构:
flask_new_practice
|--template/
|--template.html
|--run.py
Run Code Online (Sandbox Code Playgroud) 以前使用.net 2.0,您可以通过这种方式添加json内容
services.AddJsonOptions(options => {
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
});
Run Code Online (Sandbox Code Playgroud)
要么
services.AddMvc().AddJsonOptions(options => {
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
});
Run Code Online (Sandbox Code Playgroud)
我意识到我不能用.net 2.1做同样的事情.
我收到此错误:
'IServiceCollection' does not contain a definition for 'AddJsonOptions'
and the best extension method overload 'MvcJsonMvcBuilderExtensions.AddJsonOptions(IMvcBuilder, Action<MvcJsonOptions>)'
requires a receiver of type 'IMvcBuilder
Run Code Online (Sandbox Code Playgroud)
有人有解决方案吗?