cost 99 ms
Django中如何組合多個自定義管理命令?

[英]How to combine multiple custom management commands in Django?

我用通常的方式為我的 Django 項目寫了一組命令。 是否可以將多個命令合並為一個命令? 為了簡化步驟,我使用了以下命令:導入文件、從文件中讀取元數據、創建縮略圖等。現在的目標是創建一個“全部執行”命令,以某種方式導入這些命令並一個接一個地執行它們。 怎么做? ...

無法解析余數:'{%get(gender='F')%}.fullname' from 'x.parent.{%get(gender='F')%}.fullname'

[英]Could not parse the remainder: '{%get(gender='F')%}.fullname' from 'x.parent.{%get(gender='F')%}.fullname'

我在獲取模板中的數據時遇到問題。 我正在 python 文件中編寫代碼以使其正常工作。 它讓我得到Parent Fullname ,但是當我在模板中寫它時,比如: 它讓我Could not parse the remainder: '{%get(gender='F')%}.fullname' fr ...

如何從與 model 相關的外鍵檢索屬性到與 model 相關的另一個外鍵?

[英]How to retrieve attributes from a foreign key related model to another foreign key related model?

我正在使用 django 4.1.2 和 python 3.10.8。 我有三種模型,一種用於用戶管理,一種用於問題,另一種用於答案。 它們描述如下:class User(AbstractUser): phone_number = models.CharField(max_length=1 ...

多表 inheritance 和兩個多對多通過 model 在管理內聯中不起作用

[英]Multi-table inheritance and two many to many via through model not working in admin inline

我正在嘗試根據用戶的要求從 django 管理員創建導航菜單。 Model 看起來像這樣: Page和Category可以是不同類型的菜單項,所以,我使用了inheritance。現在我想將MenuItem綁定到一個Menu,因此我在下面添加了兩個模型。 我需要菜單項的父鍵來遍歷從父級到子級的菜 ...

如何在表格上顯示可用的衣服尺碼? Django

[英]how to show avaliable sizes of clothes on the form? Django

我正在 Django 開發在線服裝店。現在我遇到了這個問題:我有一個表格可以幫助用戶將一些衣服添加到他的購物車中。 我需要展示這件衣服有哪些尺碼可供選擇。 為此,我需要引用數據庫。 但是如何從形式上做到呢? 模型.py: 我的表格: forms.py 使用這種形式的視圖: 視圖.py 商店/產品 ...

視圖 post.views.view 沒有返回 HttpResponse object。它返回的是 None

[英]The view post.views.view didn't return an HttpResponse object. It returned None instead

我想在下一步中使用 PostCreateView 和 go 創建一個新帖子到新帖子的詳細信息頁面,但我收到此錯誤: (視圖 post.views.view 沒有返回 HttpResponse object。它返回了 None。) 觀點 楷模 網址 ...

Apple SSO 在 Django 4 升級后中斷

[英]Apple SSO breaks after Django 4 upgrade

從 django 3 升級到 django 4 后,“使用 Apple 登錄”功能開始出現以下錯誤由於錯誤,您的請求無法完成。 請稍后再試。 javascript,前端html,Apple ID url都是一模一樣的,控制台也沒有有用的報錯。 到底是怎么回事? ...

在管理面板中創建的用戶無法登錄管理面板

[英]the user created in the admin panel cannot log in to the admin panel

我有一個自定義用戶 model: 在管理面板中注冊: 當我創建超級用戶或具有員工身份的用戶並嘗試登錄時,出現一條消息: Please enter the correct username and password for a staff account. Note that both fields ...

Django-->TypeError: __init__() 得到了一個意外的關鍵字參數“providing_args”

[英]Django-->TypeError: __init__() got an unexpected keyword argument 'providing_args'

我在 docker 上運行我的 django-app-api 服務器,但我被困在一個特定的地方。 由於以下錯誤,服務器沒有生成: TypeError: init () got an unexpected keyword argument 'providing_args' 使用 docker-co ...

Django /static/ 文件未找到,404 錯誤

[英]Django /static/ files not found, 404 error

我在加載 static 文件時遇到問題。 它根本不會在我的頁面上加載圖像。 當我查找地址時,它會顯示 /apps/assets/img..... 但它應該是 /static/assets/img ,就像主頁和登錄頁面上一樣。 (/apps/ 是我的視圖名稱,但我不明白為什么它會那樣加載它..(所有 ...

Django 問題,無法上傳包含產品的分類頁面

[英]Django issue, Categories Page can't be uploaded with products in it

$ 你好,我嘗試通過 django 加載類別產品列表,如下面的代碼所示,它永遠不會加載,並且總是報錯,甚至沒有看到類別的“Int:id”,請我需要一些幫助來弄清楚我的問題是什么,...您好,我嘗試通過 django 加載類別產品列表,如下面的代碼所示,它永遠不會加載,並且總是出錯,即使沒有看到該類 ...

Django static 文件路徑的別名

[英]Django alias for static file path

我有一個 Django 4.1 項目,並希望使用 static 文件為目錄創建別名。 所以,在settings.py我有STATIC_URL = "static/" 我所有的 static 文件都在example.com/static/...中。 我想創建 static 文件目錄之一的快捷方式。 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM