Good evening, I’m hoping someone knows an answer to my problem of getting all checked rows inside a table into a multidimensional list (after submit)? I know I can do something like this to get – for example – all the checked ids into a list: template: views.py But as mentioned, this will only get me a list of the
Tag: django
How to to use django createsuperuser –noinput command
I’m fairly new to django and python and guess this is a basic question, but if anyone is able to tell me what I’m doing wrong and/or how to correctly struture a non-interactive django createsuperuser command (https://docs.djangoproject.com/en/3.1/ref/django-admin/#createsuperuser), I’d be really grateful. I would like to use this to create a superuser on a google cloud-run app I have running, and
Can not print specifict values from an api response dictionnary (Dango)
i’m ne to Django and APIs and i’m struggling with this for days. Here’s my views.py file : And here’s the index.html : But when i try to do for example : i get an error : (TemplateSyntaxError at / Could not parse the remainder: ‘[“height”]’ from ‘t[“height”]’) Please help me and excuse me if it is a dumb question,
Exclude date from DateTimeField in Django
So I have a model that has a dateField and a dateTimeField. What I want is de Django database to exclude the date field from the dateTimeField. My models.py As you can see I have a date and an hour field. What I want is the hour field only to show the hour. How can I format that field to
How to create a form that make user is_active = False?
In my Django project, there are several types of users. User types are lead, manager, analyst. The Leads should change every user’s is_active attribute. I created a form and view for that. I have a users page and every user is listing here with a for loop. What I want is lead can block a user with is_active = False
How to create a filter a column in a data table in Django?
I have a data table in my Django project. This data table is for listing customers. The customer has attributes like name, country, email, etc… I want to put a button like a dropdown menu for listing countries of customers. (Excel-like or similar logic) But I just need this in the country column. How can I do that? I try
Error while try to make widget to the form in django
I get an error when I try to add a widget to the form. The error: The model The views The form class Video_form(forms.ModelForm): Answer You must assign valid widget in the Video_form: forms.FileField and forms.ImageField are fields not widgets.
how to perform post request on nested serailizers in django rest framework
Hii I am new to django rest framework i am able to perform put delete and get operations but unable to perform post operations models.py serializers.py urls.py views.py this is the json format when i perform get request As mentioned earliew whenever i perform put delete or get its working but its not a case with post the error i
Django Web App running on local Debian 10 but failing on Azure
I can run my web app on my local machine – no errors. But when porting the directory strcture to Azure, I get the ModuleNotFoundError: No module named ‘django’. Here is what I did: My app is publicly available on GitHub. The app runs in a virtual environment (called deploydjango). That is reflected in the tree structure of the repo.
Django template run {{ }} without execute
In django template I write <p>”{{sometext}}”</>p. But when it is executed it convert like <p>””</p>. How to avoid this. Answer You can work with the {% verbatim %}…{% endverbatim %} template tags [Django-doc] to turn of interpolation locally: