Category "django"

using Django "include" template tag as nested - side effects?

Does anyone know or have any experience about bad side effects of using "nested include tags"? (I mean including a template file which itself includes another t

Simple internal server error because running uwsgi keeps on deleting the .sock file

I'm trying to deploy my first Django application by following these steps. The problem I have is that, for some reason, running uwsgi --emperor venv/vassals/ --

unique=True gives already exist! Even if interchanging the values of two objects

To display objects (members) in particular order, I have made a field, order: order = models.IntegerField(unique=True,null=True,blank=True) so that I can do an

How do you create a gitignore file in pycharm? (windows)

What i could find relating to git settings on pycharm

Invalid literal int() with base 10: '[' when doing a filter with request.body

def patch(self, request): Claim.objects.filter(id__in=request.body).update(....) return HttpResponse(status=200) I'm trying to update some of m

django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'project.routing'

I have installed django channels and I have added routing.py in project root folder and added the line ASGI_APPLICATION = 'project.routing.application' but whe

Why console is showing templates not defined error in django

I am new to django , I am facing one while django running server , I have copy and paste my code please tell me what is wrong with my code 'DIRS': [templates],

CSRF verification failed with 403 error when deployed to AWS elastic beanstalk

After creating a Django project in local, where we tested that all the functionality was working as expected, we finally deployed it in Amazon Web Services Bean

Is it able to resume downloading when the connection is lost in Django?

from django.http import FileResponse def send_file(): #some processes response = FileResponse(open(file_name, 'rb'),as_attachment=True) return respo

how do I make a page only to be accessed through redirection from a stripe checkout session page, in django?

I want a page (view) to be only accessed through redirection from stripe checkout session page, and not accessible in any other way. Here is the page that I wan

Bootstrap-ui Modal is coming up blank when set inside angular-gantt

I am having difficulties trying to get my modal to come up. I am not sure if it is because modal is not compatible with angular-gantt or if I have the code wron

Django. ''The `actions` argument must be provided when calling `.as_view()` '' when I try to allow DELETE, PUT, ETC

I have to allow delete and update requests from front for my objects of some model. I wish to delete instance and appropriate row in DB. I tryed to use info fr

Django version downgraded when I install third party Django package

When we upgrade Django version this two packages prompted incompatible Installing collected packages: django Attempting uninstall: django Found existing i

django settings default time zone

here is a question i can use django time zone for utc and it worked fine but when i switch the default time zone to 'Asia/Tehran' it wont work and i get the err

How to deal with django migration postgres deadlock?

So, I was deploying the django app to production and then the infamous postgres deadlock situation happened. This happens during the django migration. Django ve

ImportError: cannot import name 'ProductDetails' from 'pages.views'

I have written test case for views for details page. Here is below code I have written, When I am running Pytest in terminal it raising these error. My project

"Cannot import ASGI_APPLICATION module %r" % path channels problem

I got this error: ImproperlyConfigured("Cannot import ASGI_APPLICATION module %r" % path) Here is my routing.py: from channels.routing import ProtocolTypeRouter

Why static files are not loading? | Django

I'm trying to load static files, but it's showing following error: GET http://127.0.0.1:8000/static/css/user/style.css net::ERR_ABORTED 404 (Not Found) - home:2

Default value in Django Model

I have a model named "Product" and it has an attribute like price, quantity, and remarks. Thru the models.py, if remarks has a property of "null=True", it will

How to add a calculated field to a django admin inline

I am trying to add a calculated field to a Django Admin Inline. Consider this set of classes: models.py: class MyGroup(models.Model): group_name = models.Cha