Category "django"

Django / How to evaluate a django variable inside a bracket expression?

In my html file I need to define a variable for a js file. <script> var gltf_home = "{% static '/3d/ {{ scene.GltfFileToLoad }} ' %}"; </script> w

Why do i have to restart the Django server every time I make some changes in views?

I am new to Django and every time I make a change in veiws.py or urls.py I have to run python manange.py run server. This is hectic as for every small change I

ModuleNotFoundError: No module named '_tkinter' Heroku

I am trying to deploy a webapp using Heroku and it get deployed but it gives internal server error when I try to open it. The complete log as from heroku logs -

Django SQL Server studio backend doesn't support altering from/to AutoField

Please help me I tried to connect to the database The connection was successful and the rules were lifted, but I have this problem raise NotImplementedError("t

Unable to import djstripe.models to views.py

All the migrations have been successful and all the models and tables have been imported successfully by running below command: python3 manage.py djstripe_sync_

How can I add tailwind css to an existing django app

I already have a Django project with many apps and one of them is demo_app. I have some views and templates added to the demo app but I want to start using tail

Djongo migrate models cons

Its's nice to see mongodb is connected with django but doesn't support completely. I explain why so because when you install any third party packages to your pr

Pytest hangs indefinitely running tests after Selenium image update

A day ago selenium updated their standalone-images (https://hub.docker.com/search?q=selenium&type=image) and at the same time selenium 4.0.0 was released on

Problem upgrading django 2.2.27 to 2.2.28 on Mac

I have a Django application that I'm trying to upgrade the django module from 2.2.27 to 2.2.28 to close a SQL injection attack vector. I'm running this on a rec

Images from database not displaying in Heroku Django after hosting

I have few images in my SQLite database which I will be changing from admin panel over a period of time. I have hosted the django app in heorku(free service). A

How to setup Django permissions to be specific to a certain model's instances?

Please consider a simple Django app containing a central model called Project. Other resources of this app are always tied to a specific Project. Exemplary code

Want to send extra data from BasePermission to Queryset in ModelVIewSet DRF

Here is My Seller Model which has User as OneToOneField #models.py . . class CompanyProfile(models.Model): user = models.OneToOneField(User, on_delete=mode

Django Admin Page not found when including MEDIA_ROOT setting

this is my first question so please point me to the right direction in case I miss something of importance ☺️ So my problem is the following: I'm c

Django: After updating a template, the changes are not reflected upon refreshing the page in the browser

I am testing a class based view in my Django application. I am currently in development, so I want to see changes in the browser as soon as I make any change in

How do I filter models from the Django admin sidebar while keeping them on their children's change page form?

I have a setup that looks like this: Because 'Charities' and 'Interventions' aren't meant to be edited except from the Evaluations and Max Impact Fund Grants p

What is wrong with this inkscape extension?

I am not a programmer. I used to use an inkscape extension that was designed to change the path in inkscape to Gcode. Recently this extension stopped working gi

Django uses untranslated strings instead of translations

I have a small Django application, which I tried to localize. In the urls.py I have urlpatterns += i18n_patterns( path('add_request/',AddRequest.as_view(),name=

Django models: is it possible to force icontains on filter/get for specific field using a manager?

Let's say I have a model with a string field similar to this class Product(models.Model): upc = models.CharField(max_length=12, blank=False, null=False) Is

How to show on template just a Model with Foreign Key Django?

I'm getting on the template all the Router Model created. I mean if user A create a Router Model when I log in with user B I can see what user A create. how can

How to Print celery worker details on windows and mac

I actually had issues printing mine on command prompt because I was using the wrong command but I found a link to a project which I forked Project (If on Mac )