我想让我的主Postgres DB(在Heroku上托管)复制到我笔记本电脑上的从属DB.这可能吗?
Heroku的文档讨论了Heroku中托管的主服务器和从服务器:https: //devcenter.heroku.com/articles/heroku-postgres-follower-databases
有人问是否有可能让Heroku外面的主人和Heroku内的奴隶(不是): 从Heroku跟随外部数据库
我还没有看到相反的答案 - 让Heroku的主人和外面的奴隶.
我为什么要这个?加快发展.由于我的应用程序在本地运行,而数据库在云端运行,往返时间很长,因此数据访问速度很慢.大多数数据访问都是只读的.如果我可以有一个本地奴隶,它会显着加快速度.
相关:如果我的笔记本电脑断开了一段时间怎么办?这会给主人带来麻烦吗?
我正在使用带有忍者的烧瓶.
我知道您可以使用多个占位符块定义基页模板:
<html>
<head>
[ standard meta tags, etc go here ]
{% block css %}{% endblock %}
</head>
<body>
[ standard page header goes here ]
{% block content %}{% endblock %}
[ standard page footer goes here ]
{% block javascript %}{% endblock %}
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我知道您可以使用单个占位符定义宏:
{% macro dialog() %}
<div class="dialog">
[ standard dialog header ]
{{ caller() }}
</div>
{% endmacro %}
{% call dialog() %}
<div class="log-in">
Log in or sign up! …Run Code Online (Sandbox Code Playgroud)