我一直在关注 django-oAuth-toolkit文档。在授权码步骤中,我已经注册了一个应用程序,如屏幕截图所示。
但下一步是这样的:
要启动授权代码流程,请转至此 URL,如下所示:
http://127.0.0.1:8000/o/authorize/?response_type=code&client_id=vW1RcAl7Mb0d5gyHNQIAcH110lWoOW2BmWJIero8&redirect_uri=http://127.0.0.1:8000/noexist/callback
但是,当我替换客户端 ID 并 ping 该 URL 时,它会将我重定向到以下 URL:
http://localhost:8000/noexist/callback?error=invalid_request&error_description=Code+challenge+required.
我尝试用谷歌搜索该错误,但这是一个非常常见的关键字,我无法找到与我的问题相关的任何内容。我可能错过了一些明显的东西,我是 Python 和 Django 的新手。
我希望我的用户能够将图像上传到我的网站。他们不必登录。
我有一个自定义页面模板,我想在其中执行此操作。我内部有以下代码块functions.php
wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');
....
---------more codes are here---------
....
else if( in_category( $excluded, get_the_ID() ) || get_page_template_slug() == 'mediaCollector.php') {
wp_enqueue_media();
wp_enqueue_style('media_collector', get_stylesheet_directory_uri() . '/mediaCollector.css');
wp_enqueue_style('style_responsive', get_stylesheet_directory_uri() . '/style-responsive.css');
wp_enqueue_style('font-awesome', plugins_url() . '/my-plugin/css/font-awesome.min.css');
wp_enqueue_script('mediaCollectorScript', get_stylesheet_directory_uri() . '/mediaCollector.js');
}
....
---------more codes are here---------
....
Run Code Online (Sandbox Code Playgroud)
这是单击“上传图像”按钮时(打开用户可以在其中上传媒体的弹出窗口)时发生的代码。
\$j = jQuery.noConflict();
/* Logo Upload */
\$j(document).ready(function() {
\$j('.upload-btn').click(function(a) {
var that = this;
a.preventDefault();
var b = wp.media({
title: 'Upload Image',
multiple: !1
}).open().on('select', function(a) {
var …Run Code Online (Sandbox Code Playgroud) 我在下面有这个代码.这是使用NgOptions绘制表单中某些选项的直接方式.
function NameCtrl($scope) {
$scope.theOptions = [{
'label': 'The Opt<sup>™</sup>',
'id': 3
}]
}Run Code Online (Sandbox Code Playgroud)
<html ng-app>
<head>
<meta charset="utf-8">
<title>Angular.js Example</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"></script>
</head>
<body ng-controller="NameCtrl">
<select ng-model="selectedOption" ng-options="x.id as x.label for x in theOptions">
<option value="">Select</option>
</select>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
我的问题是:我有什么方法可以选择在选择下拉列表中The Opt<sup>™</sup>呈现The Opt ™吗?因为我不能使用ng-bind-html.有什么办法可以实现吗?任何帮助表示赞赏.
javascript ×2
angularjs ×1
django ×1
html ×1
jquery ×1
ngsanitize ×1
oauth-2.0 ×1
python ×1
wordpress ×1