Category "django"

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 )

Images disappears from django web app deployed to heroku

I am working on a django project, writing rest APIs with django rest framework to use them in android application, my main idea is develop back end in django an

How to hide the Token model from rest_framework.authtoken in django admin panel

I tried to solve the problem using this two methods from rest_framework.authtoken.models import Token admin.site.unregister(Token) ----- from rest_framework.aut

Ho to create serializer for model having foreign keys to access that foreign keys tables data also?

I want to rewrite the following API in a more efficient way using the serializer. In the following API, the user and group are foreign keys. I want to return al

Django admin and normal user seperation

Everytime i logout of the normal user system it also logs me out of admin page. the normal user system is created using the AbstractUserModel provided by django

Error when creating a django superuser with Heroku - FileNotFoundError

I'm trying to deploy a django application on Heroku, but when it comes to the part where I need to create a superuser, I get an error: Traceback (most recent ca

Getting objects before validating data Django REST

I have to create a new Chat object using this view: class ChatListCreateView(ListCreateAPIView): permission_classes = [IsAuthenticated] serializer_class

Am trying to launch in Cpanel, but am getting a Module not found error

enter image description hereI'm new to Cpanel and am trying to launch my python Django project, I think I've set up everything correctly but am getting this err

How to return custom JSON response in DRF?

I have created API for News model: models.py class News(models.Model): title = models.CharField(max_length=255) created_at = models.DateTimeField(auto_n

ReactJS / Axios / Django: Update form with the current image from API

I'm trying to create an update form in React, the update works fine as I have set the default values that coming from (get method) using axios and set them as t

Using forloop.counter to iterate over list in django template

I have a list of objects named chargers_list and on my view I estimate when will the charging be done. List of estimates is the same size and is named eta. I it

How can I add two related nested instance in one request using DRF?

Hi I'm new to Django rest framework I have two models: class Location(models.Model): name = models.CharField(("name"), max_length=50) long = models.Char

Django's infinite streaming response logs 500 in apache logs

I have a Django+Apache server, and there is a view with infinite streaming response def my_view(request): try: return StreamingHttpResponse(map(

unhashable type 'list' when i enter on change_list in Django

I search for days for a solution for this problem. after touching the admin.py file to override the get_queryset and get_form methods I ran into the unhashable

Unable to serve static file in Django deployed to production in Digital ocean

Currently I deployed my django app in Digital ocean droplet. In localhost it works well but it cant serve js/css files in static folder when deployed to prod. H