小编Byu*_*usa的帖子

ImportError:无法从“django.utils.encoding”导入名称“force_text”(/usr/local/lib/python3.9/site-packages/django/utils/encoding.py)

当我在 settings.py 的INSTALLED_APPS中添加“graphene_django”时,出现以下错误。

运行后

python3 manage.py runserver
Run Code Online (Sandbox Code Playgroud)

graphene_django 已成功安装

pip install django graphene_django
Run Code Online (Sandbox Code Playgroud)

这是我得到的完整错误:

Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 115, in inner_run
    autoreload.raise_last_exception()
  File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 381, in execute
    autoreload.check_errors(django.setup)()
  File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", …
Run Code Online (Sandbox Code Playgroud)

python django python-3.x graphql graphene-django

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

如何在Django中获取所有GET请求值?

如何在 Django 中获取所有这些 url 参数(1、12-18、5、生日快乐)?

https://domain/method/?1='12-18'&5='Happy birthday'
Run Code Online (Sandbox Code Playgroud)

我努力了:

https://domain/method/?1='12-18'&5='Happy birthday'
Run Code Online (Sandbox Code Playgroud)

但我只得到12-18。

python django get url-parameters python-3.x

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

我遇到 PayloadCMS 错误。验证错误:以下字段无效:电子邮件

我使用创建了一个有效负载应用程序, npx create-payload-app 并选择使用空白模板

我有这个。验证错误:以下字段无效:电子邮件

src/seed/index.ts

import { Payload } from 'payload';
import { customerForm } from './customerForm';

export const seed = async (payload: Payload) => {
  const customerFormJSON = JSON.parse(JSON.stringify(customerForm));

  const { id: customerFormID } = await payload.create({
    collection: 'customer', 
    data: customerFormJSON,
  });

};
Run Code Online (Sandbox Code Playgroud)

src/seed/customerForm.ts

export const customerForm = {
    id: '63c0651b132c8e2783f8dcae',
    updatedAt: '2023-01-12T21:25:41.113Z',
    createdAt: '2022-12-28T20:48:53.181Z',
    title: 'Customer Form',
    fields: [
      {
        name: 'firstName',
        label: 'First name',
        width: 50,
        required: true,
        id: '63adaaba5236fe69ca8973f8',
        blockName: 'first-name',
        blockType: 'text',
      },
      { …
Run Code Online (Sandbox Code Playgroud)

javascript content-management-system node.js typescript payload-cms

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

如何在 Windows 10 中打开显示设置(以编程方式,特别是使用 C#)?

我正在尝试使用 C# 在 Windows 10 中打开/启动显示。

我试过这个:

Process.Start("explorer.exe", @"shell:::{BB06C0E4-D293-4f75-8A90-CB05B6477EEE}");
Run Code Online (Sandbox Code Playgroud)

但它打开关于(关于计算机的信息)。

有什么帮助吗?

c# wpf microsoft-metro windows-10

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