小编viv*_*vkv的帖子

错误:redirect_uri_mismatch::redirect_uri 必须与注册的回调 URL 匹配

所以我尝试使用 Github OAuth API 在 Flask 中学习 OAuth,并且我正在使用flask_dance它的库。我能够在 Github 上对自己进行身份验证并返回到我的应用程序,但在其显示404 Not Found Error和 url 中http://localhost:5000/login/authorized?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application...,回调 url 似乎是正确的,因为它是我在 github 上提供的内容,但仍然显示redirect_uri mismatch我正在阅读此处的文档,并了解到我们可以redirect_uri从请求中删除参数,但我不确定如何执行此操作。(我使用的是 Windows 10)
任何帮助都会很好。谢谢。

此处显示

应用程序.py

from flask import Flask, redirect, url_for
from werkzeug.contrib.fixers import ProxyFix
from flask_dance.contrib.github import make_github_blueprint, github

app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
app.secret_key = "supersekrit"
blueprint = make_github_blueprint(
    client_id="xxxxxxxxx",
    client_secret="xxxxxxxx",
)
app.register_blueprint(blueprint, url_prefix="/login")

@app.route("/signup")
def index():
    if not github.authorized:
        return redirect(url_for("github.login"))
    resp = github.get("/user")
    assert …
Run Code Online (Sandbox Code Playgroud)

oauth github-api flask python-2.7

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

Python 2.7 Tkinter 如何更改按钮文本的文本颜色

Button1 = Button(root,text='恢复图像',前景=“红色”,compound=“中心”)

这种类型的代码不起作用。它说未知选项“-foreground”。

这是完整的代码 -

from Tkinter import *
from ttk import *
def change():
   label.config(text="Hey dude !!")
   label.config(image = img1,background='blue',foreground='yellow')
def click():
         if button1.instate(["disabled"]):
                label.config(image = img1,background='yellow',foreground='green')
                button1.state(['!disabled'])
                button.state(['disabled'])
         else:
                label.config(image = img,background='yellow',foreground='green')
                button1.state(['disabled'])
                button.state(['!disabled'])
root = Tk()
label = Label(root)
img=PhotoImage(file='C:\\Users\\Vivek\\Desktop\\x.gif')
img1= PhotoImage(file='C:\\Users\\Vivek\\Desktop\\y.gif')
img2 = PhotoImage(file='C:\\Users\\Vivek\\Desktop\\z.gif')
button = Button(root)
button.pack()
button1 = Button(root,text='Revert image',compound="center")
img2_small = img2.subsample(30,80)
button.config(image=img2_small,text='Change image',compound='center')
button1.state(["disabled"])
button1.pack()
label.pack()
button.config(command=click)
button1.config(command = click)
label.config(image = img,background='yellow',foreground='green')
label.config(text = 'Hey dude watsup ?? Are you …
Run Code Online (Sandbox Code Playgroud)

python text tkinter colors button

5
推荐指数
1
解决办法
3万
查看次数

每个DAPP都有自己的区块链吗?

我正在学习区块链技术。我阅读了很多教程,并且了解了区块链是什么的基本概念,但我对以下事实感到困惑:是否有单独的区块链用于单独的 DAPP,而使用该 DAPP 的人只会成为该 DAPP 区块链的一部分,以及以太坊区块链中的区块真的包含什么?

如果有人能消除我的新手疑问,那将非常有帮助。提前致谢 :)

blockchain ethereum

5
推荐指数
1
解决办法
722
查看次数

如何在Jenkins中使用Maven从多个套件中运行特定的TestNG套件

我有一个带有3个TestNG套件和4个测试类的maven项目,我想在jenkins中运行一个特定的套件,我进行了很多搜索,但发现只有一个命令test -DsuiteXmlFile=Jquery.xml可以指定该特定套件,但是当我这样做时,它将全部运行其他套房也是如此。我在这里呆了很长时间,请引导我完成整个过程。而且我还想知道是否可以进行任何设置,以便如果我选择运行一个套件,则可以运行该套件的任何特定类。我在这里附加了我的项目结构的图像,任何输入将不胜感激。谢谢 :)

项目结构

Guru99.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="WebGuru99">
  <test thread-count="5" name="TestGuru99">
    <classes>
      <class name="com.selenium.vivek.Example2.WebGuru99_1"/>
      <class name="com.selenium.vivek.Example2.WebGuru99_2"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->
Run Code Online (Sandbox Code Playgroud)

Jquery.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="WebJquery">
  <test thread-count="5" name="TestJquery">
    <classes>
      <class name="com.selenium.vivek.Example2.WebJquery"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->
Run Code Online (Sandbox Code Playgroud)

Rediff.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="WebRediff">
  <test thread-count="5" name="TestRediff">
    <classes>
      <class name="com.selenium.vivek.Example2.WebRediff"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- …
Run Code Online (Sandbox Code Playgroud)

testng maven jenkins

4
推荐指数
1
解决办法
2252
查看次数

类型“DebugElement”上不存在属性“click”

我刚刚开始《Karma》和《Jasmine》。我陷入了无法对组件执行单元测试的困境,我想要触发的函数与*ngIf某些特定值的按钮的条件绑定。

我的组件.ts

import { Component, Input, EventEmitter, Output } from '@angular/core';
import { Location } from '@angular/common';
import { XService } from 'src/app/services/x-service';

@Component({
  selector: 'my-head-component',
  templateUrl: './headComponent.html',
  styleUrls: ['./head.scss']
})
export class MyComponent {
  @Input() variableX = '';

  @Output() outVar1: EventEmitter<string> = new EventEmitter();
  @Output() outVar2: EventEmitter<string> = new EventEmitter();

  y1='';
  y2='';
  constructor(private location: Location,
    private xServ:XService ) { }

  lookBack() {
    this.location.back();
  }

  doSearch() {
    this.y1= '';
    this.y2 = '';

    this.outVar1.emit(this.y1);
    this.outVar2.emit(this.y2);
  }

   ...
}
Run Code Online (Sandbox Code Playgroud)

headComponent.html …

jasmine typescript karma-jasmine angular angular-cli-v7

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

在python 2.7中将图像添加到Tkinter的文本小部件中

我是Tkinter的新手,我正在尝试将图像添加到Tkinter python 2.7中的文本小部件中.我在互联网上查找了一些资源,据我所知,这是代码,但它给出了错误 - "

File "anim.py", line 11, in <module>
    text.image_create(END,image=photoImg)
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 2976, in image_create
    *self._options(cnf, kw))
  TypeError: __str__ returned non-string (type file) 
Run Code Online (Sandbox Code Playgroud)

"

请告诉我哪里出错了.提前致谢 :)

from PIL import Image,ImageTk
from Tkinter import *
root = Tk()
root.geometry("900x900+100+100")
image1 = open('IMG_20160123_170503.jpg')
photoImg = PhotoImage(image1)
frame = Frame(root)
frame.pack()
text = Text(frame)
text.pack()
text.image_create(END,image=photoImg)
root.mainloop()
Run Code Online (Sandbox Code Playgroud)

python tkinter python-imaging-library

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