小编jmn*_*jmn的帖子

在Emacs中杀死缓冲区时"差异,保存或杀死"

当试图杀死包含Emacs中的更改的缓冲区时,会显示消息:"Buffer [buffer] modified; kill all any?(yes or no)".

而不是这个我想让Emacs问我是否要:1.查看更改的差异,2.保存缓冲区,3.杀死缓冲区.

怎么样?

emacs

19
推荐指数
2
解决办法
2436
查看次数

7
推荐指数
1
解决办法
1013
查看次数

graphene-django 中的自定义参数

如何使用 graphene-django 在 GraphQL 中创建自定义参数?

我目前在 schema.py 中有此配置:

class Post(DjangoObjectType):
    class Meta:
        model = FeedPost
        interfaces = (graphene.relay.Node,)
        filter_fields = ['id']

class Query(graphene.ObjectType):
         post = graphene.Node.Field(Post)

    def resolve_post(self, info, **kwargs):
        username = kwargs.get('username')
        u = User.objects.get(username=username) 
        users_sources = FeedSource.objects.filter(user=u)
        return FeedPost.objects.filter(feed__feedsource__in=users_sources).annotate(
             source_title=F('feed__feedsource__title')
    )
schema = graphene.Schema(query=Query)
Run Code Online (Sandbox Code Playgroud)

但我无法弄清楚如何使“用户名”成为“post”的实际 GraphQL 查询中的必需参数。

django graphql graphene-python

6
推荐指数
1
解决办法
1144
查看次数

Traefik v2 作为没有 docker 的反向代理

我已经阅读了文档,但我无法弄清楚如何配置 Traefik v2 以在不涉及 Docker 的情况下将 Nginx 替换为网站(虚拟主机)的反向代理。理想情况下,我们也会加密 https。

我有一个在http://127.0.0.1:4000运行的服务,我想从http://myhost.com:80反向代理

这是我到目前为止提出的配置:

[Global]
checkNewVersion = true

[log]
  level = "DEBUG"
  filePath = "log-file.log"

[accessLog]
  filePath =  "log-access.log"
  bufferingSize =  100

[entrypoints]
    [entrypoints.http]
    address = ":80"

[http]
    [http.routers]
       [http.routers.my-router]
          rule = "Host(`www.myhost.com`)"
          service = "http"
          entrypoint=["http"]

    [http.services]
          [http.services.http.loadbalancer]
            [[http.services.http.loadbalancer.servers]]
              url = "http://127.0.0.1:4000"
Run Code Online (Sandbox Code Playgroud)

reverse-proxy traefik

6
推荐指数
1
解决办法
6855
查看次数

是否可以禁用 Google Cloud Run 的 Stackdriver 日志记录?

我在 Google Cloud Run 上建立了一个小项目,我正在查看生成的成本,Stackdriver Logging 看起来相当昂贵。是否可以禁用它?如何?我在文档中找不到它。

google-cloud-platform google-cloud-run

2
推荐指数
1
解决办法
1288
查看次数