Skip to content
Advertisement

Tag: django

Django: how to write django signal to update field in django?

i want to write a simple django signal that would automatically change the status of a field from live to finished, when i check a button completed. I have a model that looks like this when i check the won button that is in the PredictionData model, i want to immediately changes the status of the Prediction to finished. NOTE:

Django – CRUD functionality, Edit Profile Details

I am new to Django but I am creating a Realtor application, I would like the user to be able to update their details using CRUD functionality in the UI. But I can’t get my request to work: Heres is my code (views.py): Then here is (urls.py) ] Lastly, here is my code snippet from the requested link in the

os.getcwd() raise Exception with django dev server

I have a django project running inside docker, and the service is up with the command of python manage.py runserver, with file autoreload open, and using threadings. My code invokes shutil.make_archive() which will then invoke os.getcwd(), and from time to time, os.getcwd() will raise FileNotFoundError, by searching more information, now I realized that the error might be caused by the

Query unique values inside django forloop

I have a query where I should avoid double entry of the same question. In fact, I would like to get only unique values but, I am using the distinct() django function which isn’t working. I have these models: and the query is: What I would like to achieve is to have all different questions for each different topic inside

How to fix website picture problem on HTML

Is there a problem with this code I tried reformatting the code, by replacing the products.url into the alt brackets. But it was what i typed on in the brackets that showed up. Answer I am not exactly sure what your problem is but I see problem in code, try replacing: to and then update this lines with new variable

Make option HTML tag set something in the url – Django

I am trying to do something, but I don’t know if it’s acutally possible… Basically I’m trying to pass information in the url… (something like this) but instead of using a text input I would like the user to simply click an option in a dropdown menu… (like this) Is it possible to do so? Hopefully I’ve explained myself decently

Django runserver_plus pyOpenSSL not installed error, although it is

Linux Mint 19.3, Python 3.8 virtual environment. So I try to run runserver_plus using ssl: Then I get following error: But the deal is that pyOpenSSL is already installed within my environment. Here is pip list output: Thanks in forward for any help! I’ve tried to install different versions of pyOpenSSL, both erlier and later. Unsuccessfully. Runserver_plus starts successfully without

List View is not working but get_context_data() works

I have a ListView but when I call it only the get_context_data method works (the news and category model, not the product) when I try to display the information of the models in the templates. view: There is also this piece of code: context = super().get_context_data(**kwargs) If it’s written before: categories = Category.objects.all() The Product model is show but not

Advertisement