Skip to content
Advertisement

Tag: django

Django – User Search

I’m trying to filter ListView based on post method from search bar in my basetemplate. So making it works like: I have done this, but it wont work. Could you please tell me what I’m doing wrong? views.py in my user app urls.py in my blog app search form in html rendered html with user names Answer override get_context_data method

How to show more objects in my html with django (queries)

I want to show more queries within my html page but it only shows a single object. I do not know how to add more This is in mysql, html, django1.11 and python 2.7.15 views.py i need add object mapa and competencias. The object alumno i dont have problem Answer User filter instead of get. Because, get returns a single

simple comment code won’t collaborate with notification app

my code for comment works fine but as soon as I add notification feature it doesn’t work, while notification kinda works. I’m using django-notification-hq 3rd party app. from here: https://github.com/django-notifications/django-notifications here’s my code views.py urls.py I added this single line, My new model Answer You are overwriting the save-method on the model, you need to pass the arguments to super()

Object of type datetime is not JSON serializable error

I have some issues with using a DateTime value in python. When I use session_start in the following code, I get an Object of type datetime is not JSON serializable error views.py model.py traceback I retrieve the value from a database view which is filled by other tables where the user fills in their data. Could someone help me with

Django WhiteNoise configuration is incompatible with WhiteNoise v4.0

I am trying to deploy my Django webapp on Heroku. I have been facing this same error everytime I try to deploy. ImportError: Your WhiteNoise configuration is incompatible with WhiteNoise v4.0 This can be fixed by following the upgrade instructions at: http://whitenoise.evans.io/en/stable/changelog.html#v4-0 ! Error while running ‘$ python manage.py collectstatic –noinput’. See traceback above for details. You may need to

Are there disadvantages of using __slots__?

I’m using Python 3.7 and Django. I was reading about __slots__ . Evidently, __slots__ can be used to optimize memory allocation for a large number of those objects by listing all the object properties ahead of time. My perhaps obvious question is why wouldn’t we want to do this for all objects? Are there disadvantages for using __slots__? Answer Fluent

Advertisement