I have been trying to rebuild my Wagtail website as a docker container to be run on Fargate. For reasons, I started from scratch and rebuilt all my dependencies. After pip installing everything, the site works fine locally using venv. However, I get strange errors when launching the in the Docker container. Can anyone help me identify a fix for
Tag: django
Show all articles from specific category [django]
I want show all Articles from specific category in my template ‘category_articles.list.html’ at the link: path(‘category/<name_of_category_SLUG>/’ I have: URLS MODELS VIEWS ARTICLES_LIST.HTML template ARTICLE_DETAIL.HTML template finally…. CATEGORY_ARTICLES_LIST.HTMLtemplate I don’t know how put all articles to ARTICLE_DETAIL.HTML template… Answer You can iterate all articles from the reverse relation: I am not sure if you can use that in django templates and
Unexpected datetime behavior
I have a Django project where I used the strftime function like this in models.py: However, for some reason this returns a ValueError, even though according to a documentation (https://www.programiz.com/python-programming/datetime/strftime) this is a valid format string. Once I removed all the dashes, it worked normally. Why doesn’t this work? Do I need to import a module or something? Thanks. Answer
Django Query Multi Table
I’m trying to do a form query on a field and the goal is to get all the kids enrolled in all the teachers classes in this drop down menu. The query I have right now is getting all the classes a teacher is enrolled in . However how do I retrieve the kids within those classes. I attached a
Multi Language DjangoCMS
I want use multi language in my project . I had install cms app core . But this app only English language. But I want multi language when I choose option . So I have to create anorther app or create new template or anything ? . I don’t know how to do it . Let me know the solution
How can I add an instruction after an object creation in Django CreateView?
On my generic class based CreateView, I would like to perform an instruction which creates new objects from another model related to the current created object. Example: Collection is a model which is related to 3 differents Element objects. When I create a MyCollection object, which is related to a Collection and a User, 3 MyElement object must be created
Django rest framework’s StringRelatedField is throwing KeyError
I have the following model classes. and I have imported these classes as following as they are located in a separate package and this is my serializer class and views is and url has the following I am getting the following error I looked into the DRF example and this seems to be a simple thing to achieve. https://www.django-rest-framework.org/api-guide/relations/#api-reference But
Django: issue with template path for tenant
I have an app where depending on its category, a tenant is either directed to the app (and templates) at /dashboard/templates/dashboard or /dashboard2/templates/dashboard2. somehow, for dashboard2, the app is not found by Django and it tries to find those templates under dashboard. here is a dashboard2/views.py and the error: and the traceback: when try specifying /dashboard2/Supplier2.html I still get the
Why doesn’t my request.user have groups in Django?
I’ve got an endpoint built with Django Rest Framework, to which I now want to add permissions so that only users belonging to a certain group can access an endpoint. So I’m using token based access and inspired by this example I’m trying to use the following code: But unfortunately I get anAttributeError: ‘User’ object has no attribute ‘groups’ Why
Add styling to django Password reset forms
I want to add styling to django’s default password reset form such as classes and placeholders I have the following in my urls.py in the templates Answer yes of course you can overwrite django forms.