Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to get read of django secret_key? is using get_random_secret_key() recommended?
I am wondering if I can generate secret key inside my django application and assign it to the SECRET_KEY variable instead of reading it from the env variables? # settings.py from django.core.management.utils import get_random_secret_key SECRET_KEY = get_random_secret_key() is it recommended or it is a bad practice? -
Django order_by alpha first then numeric on attribute with both
I've got a model that has an attribute grade that is a CharField and can be alpha or numeric (for example it may contain any of the following: "K", "A", "5", "2", "1", "4") I am trying to .order_by on my queryset, but would like the alpha to come first, then the numeric. So I would like to see the queryset ordered by "A", "K", "1", "2", "3", but I'm struggling to achieve this. I've seen some solutions that involve using .extra() but I'm trying to avoid that since it's being deprecated in Django. What is the best way to achieve this? my_things = ( Thing.objects.filter( location__in=locations, year=current_year, ) .annotate(first_letter_group=Substr("grade", 1, 1)) .values( "first_letter_group", ) .order_by("first_letter_group") .distinct() .order_by("grade") ) -
Command 'lualatex -interaction=batchmode texput.tex' returned non-zero exit status 127 after rendering a pdf using latex in Django
Hi i want to render a pdf using latex, but there was an error displayed during generate the pdf after pressing a button(for save and generate a pdf latex in same time): this is the error: Command 'lualatex -interaction=batchmode texput.tex' returned non-zero exit status 127. this my views.py: @login_required def forms_render_pdf_view(request, *args, **kwargs): if request.user.is_authenticated: if request.method == 'POST': form = ReportForm(request.POST, ) form.instance.user=request.user if form.is_valid(): form.save() obj_Formulaire = Loads.objects.filter(user=request.user).last() field_obj_load_between_posts = Loads._meta.get_field('load_between_posts') field_value_load_between_posts = field_obj_load_between_posts.value_from_object(obj_Formulaire) load_between_posts = field_value_load_between_posts if load_between_posts == True: field_obj_custom_load = Loads._meta.get_field('custom_load') field_value_custom_load = field_obj_custom_load.value_from_object(obj_Formulaire) qh = float(field_value_custom_load) else: qh = float(0) context = { 'qh': qh, } template_name = 'pages/test.tex' context = {'qh': qh} return render_to_pdf(request, template_name, context, filename='test.pdf') form = ReportForm() context = {'form': form} return render(request, 'pages/form_gelander_report.html', context) this is my settings.py: TEMPLATES = [ { 'NAME': 'tex', } INSTALLED_APPS = [ 'django_tex', ] -
How to set an if statement to True in a Django template?
I have a Django form that corresponds with a model and allows the user to add or remove an item from his watchlist. I want the submit button to say "Add to Watchlist" if the user has not added the item to his watchlist and "Remove from Watchlist" if the listing is already on the user's watchlist. Currently, the button says "Remove from Watchlist" (whether or not it has been added) and changes to "Add to Watchlist" once it has been clicked once. Then the button does not change. html <form action = "{% url 'listing' auction_listing.id %}" method = "POST"> {% csrf_token %} {{ watchlistForm }} {% if watchlist %} <input type = "submit" value = "{{ watchlist }}"> {% else %} <input type = "submit" value = "Remove from Watchlist"> {% endif %} </form> views.py @login_required(login_url='login') def listing(request, id): #gets listing listing = get_object_or_404(Listings.objects, pk=id) #code for comment and bid forms listing_price = listing.bid sellar = listing.user comment_obj = Comments.objects.filter(listing=listing) #types of forms comment_form = CommentForm() bid_form = BidsForm() watchlist_form = WatchListForm() closelisting_form = CloseListingForm() #comment_form = CommentForm(request.POST) #watchlist_form = WatchListForm(request.POST) #bid_form = BidsForm(request.POST) #code for the bid form bid_obj = Bids.objects.filter(listing=listing) other_bids = bid_obj.all() max_bid =0 for … -
Django, Nginx & Gunicorn - Download reset for large files
We are working on a Django website alongside with NginX and Gunicorn. We have to provide the possibility to download large tar.gz files (up to 30Go) which are permanently stored whithin the tree structure. Oddly, when we download one of these archives (~9Go) we get the 1-2 first Go, then the download resets and reinitialize from 0. The logs showed that the worker was timeout. I tried to serve the files in chunk sizes with Django : no change. I tried to set time_out values in NginX conf file: no change. The only way to have the download going to its end was to set an unlimited timeout (timeout 0) in gunicorn.service file. I don't understand very well why do I need to set this unlimited timeout on Gunicorn ... I though that NginX would be able to manage the file download. May you please enlight me about the reasons of this ? What are we doing wrong ? Thank you very much for your help gunicorn.service [Unit] Description=gunicorn daemon Requires=gunicorn.socket After=network.target [Service] User=dev Group=www-data WorkingDirectory=/web ExecStart=/web/env/bin/gunicorn \ --access-logfile - \ --workers 4 \ --timeout 0 \ --bind unix:/run/gunicorn.sock \ amused_website.wsgi:application [Install] WantedBy=multi-user.target /etc/nginx/sites-enabled/website server { listen 80; server_name myservername; … -
Get S3 presigned url for media in Django
we am using django rest framework for a project and here we are trying to avoid using serializers. We have our AWS S3 as private , hence we need to provide a presigned key for the user to be able to see the image . Initially , we had our S3 as public so we were using annotate function to convert the image path to image link like this : def getImageFormatter(key:str)->Func: """Function to Get Formatted URL""" return Case( When( **{f'{key}__exact':''}, then=Value(None) ), When( **{f'{key}__isnull':False}, then=Concat( Value(settings.MEDIA_ROOT), F(key),output_field=CharField() ) ), default=Value(None), output_field=CharField(null=True) ) The problem is , this only works for public S3 . For private how can we do so so that we can get image on annotate? like using a custom django db function or something else? Any leads will be appreciated . The database we are using is PostgreSQL. We are using boto3 and django-storages to connect to our s3 bucket. We are actually not trying to run it through a serializer , and we are getting the data directly by using annotate and values. -
CPanel configuration files
When upload django app i have problem when setup python app configuration files after add requirements.txt gives me an error these libraries are not accepted: matplotlib==3.5.1 pandas==1.3.5 Pillow==9.0.0 psycopg2==2.9.1 scipy==1.7.3 seaborn==0.11.2 Is there a solution? -
Django manage.py CLI within Pycharm no longer showing any output pertaining to API calls
I'm using Pycharm and you can open the manage.py CLI using ctrl+alt+R and it will usually show errors, status codes etc etc when you make API calls. Now for some reason it doesn't show anything after I run the server. API calls are definitely going through but it's not in the output here. I'm having another issue which is "PermissionError: [WinError 5] Access is denied" for certain API calls. Others work fine. I have switched to working on this project on my laptop so I had to install Pycharm etc fresh so maybe that has something to do with it. I've tried running pycharm as admin, restarting etc. Would appreciate any help. -
Transfer a Django project using Conda environment to a Docker container
I am new to Django and am trying to follow the book Django for Professionals 3.1 by William S. Vincent. In this context, I am trying to move a simple Django project currently on my system (Mac OS) using conda environment on the PyCharm IDE to a Docker container. The Problem The book uses pipenv for the project and suggests to enter the following code in the Dockerfile: However, since I am using a Conda environment for the project, I cannot use the above code in Dockerfile. What I Tried Step 1 I started by entering the following code to create the environment.yml file containing all packages that the project uses. (django_for_professionals_31) My-MacBook-Pro:django_for_professionals_31_ch1 me$ conda env export --no-builds > environment.yml My environment.yml file looks like the following*: name: django_for_professionals_31 channels: - defaults dependencies: - asgiref=3.4.1 - bzip2=1.0.8 - ca-certificates=2022.4.26 - certifi=2022.5.18.1 - django=3.2.5 - krb5=1.19.2 - libedit=3.1.20210910 - libffi=3.3 - libpq=12.9 - ncurses=6.3 - openssl=1.1.1o - pip=21.2.4 - psycopg2=2.8.6 - python=3.10.4 - pytz=2021.3 - readline=8.1.2 - setuptools=61.2.0 - sqlite=3.38.3 - sqlparse=0.4.1 - tk=8.6.12 - typing_extensions=4.1.1 - tzdata=2022a - wheel=0.37.1 - xz=5.2.5 - zlib=1.2.12 prefix: /opt/anaconda3/envs/django_for_professionals_31 Step 2 Then, based on this tutorial, I tried to write my Dockerfile, as shown … -
как сделать пост-запрос с изображением с помощью axios?
to create a post, the user must go through the form for creating posts and upload an image, but I don’t know how to do this i tried to send file event.target.files[0] but I received "POST /api/tests/ HTTP/1.1" 400 91 it didn't help, i tried to send event.target.files[0].name but that didn't help either TestForm.jsx import React, {useState} from 'react'; import axios from "axios"; function TestForm() { const [testInputs, setTestInputs] = useState({title: '', title_image: '', test_type: ''}); console.log(testInputs); axios.defaults.xsrfCookieName = 'csrftoken' axios.defaults.xsrfHeaderName = "X-CSRFTOKEN" const handleClick = () => { axios({ method: 'POST', url: 'http://127.0.0.1:8000/api/tests/', data: { author: 1, title: 'sad', title_image: testInputs.title_image.name, test_type: 2, question: [1, 3, 4], result: [1, 2] } }) } return ( <div> <form> <input onChange={(event) => {setTestInputs({...testInputs, title_image: event.target.files[0]}); console.log(event.target)}} type="file" placeholder='upload'/> </form> <button onClick={handleClick}>asd</button> </div> ); } export default TestForm; models.py class Test(models.Model): author = models.ForeignKey(User, on_delete=models.CASCADE) title = models.CharField(max_length=150) title_image = models.ImageField(default="images/IMG_1270.JPG/", null=True, blank=True, upload_to='titleImages/') test_type = models.ForeignKey(TestType, on_delete=models.CASCADE) question = models.ManyToManyField(TestQuestionBlok) result = models.ManyToManyField(TestResult, blank=True) def __str__(self): return self.title views.py class TestList(APIView): def post(self, request, format=None): serializer1 = TestSerializers(data=request.data) if serializer1.is_valid(): print(serializer1.data) return Response(serializer1.data, status=status.HTTP_200_OK) return Response(serializer1.errors, status=status.HTTP_400_BAD_REQUEST) -
How to return logs to Airflow container from remotely called, Dockerized celery workers
I am working on a Dockerized Python/Django project including a container for Celery workers, into which I have been integrating the off-the-shelf airflow docker containers. I have Airflow successfully running celery tasks in the pre-existing container, by instantiating a Celery app with the redis broker and back end specified, and making a remote call via send_task; however none of the logging carried out by the celery task makes it back to the Airflow logs. Initially, as a proof of concept as I am completely new to Airflow, I had set it up to run the same code by exposing it to the Airflow containers and creating airflow tasks to run it on the airflow celery worker container. This did result in all the logging being captured, but it's definitely not the way we want it architectured, as this makes the airflow containers very fat due to the repetition of dependencies from the django project. The documentation says "Most task handlers send logs upon completion of a task" but I wasn't able to find more detail that might give me a clue how to enable the same in my situation. Is there any way to get these logs back to airflow … -
how to redirect a django website from www to non www
How to redirect a django website from www to Non www. i have already tried library of django pip install django-redirect-to-non-www But No working. Please guide us how to perform the redirection in django website. Thank You -
Django ORM PostgreSQL DELETE query
I have 30 instances of the Room objects, i.e. 30 rows in the database table. In Python code I have Room.objects.all().delete(). I see that Django ORM translated it into the following PostgreSQL query: DELETE FROM "app_name_room" WHERE "app_name_room"."id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30). Why doesn't the Django ORM use a more parsimonious DELETE FROM app_name_room query? Is there any way to switch to it and avoid listing all IDs? -
How to add permissions for "class UserRetrtieveUpdateDestroyAPIView(generics.RetrieveUpdateDestroyAPIView)"?
I've created a model using an abstract user model class for Online flight ticket booking. I'm new to this so haven't added many functionalities to it. I'm sharing my model.py, admin.py, serializer.py, view.py. My question: In views.py -> "class UserRetrtieveUpdateDestroyAPIView(generics.RetrieveUpdateDestroyAPIView)" I want to give access for GET PUT DELETE for only ADMIN and USER who created this profile(owner). I'm using postman to check endpoints. "Please do check my abstract user model if there is any mistake". permission for "BookViewSet" and "BookingRetrtieveUpdateDestroyAPIView" I only want ADMIN and USER owner who created this booking to view or modify it. #models.py import email from pyexpat import model from django.db import models from django.conf import settings from django.db.models.signals import post_save from django.dispatch import receiver from django.contrib.auth.models import ( BaseUserManager, AbstractBaseUser ) GENDER_CHOICES = ( (0, 'male'), (1, 'female'), (2, 'not specified'),) class UserManager(BaseUserManager): def create_user(self, email, name,contact_number,gender,address,state,city,country,pincode,dob ,password=None, password2=None): if not email: raise ValueError('User must have an email address') user = self.model( email=self.normalize_email(email), name=name, contact_number=contact_number, gender=gender, address=address, state=state, city=city, country=country, pincode=pincode, dob=dob, ) user.set_password(password) user.save(using=self._db) return user def create_superuser(self, email, name,contact_number,gender,address,state,city,country,pincode,dob , password=None): user = self.create_user( email, name=name, contact_number=contact_number, gender=gender, address=address, state=state, city=city, country=country, pincode=pincode, dob=dob, password=password, ) user.is_admin = True user.save(using=self._db) return user … -
Problem with static file on vps (Django, gunicorn ,nginx)
My problem is when I request in a browser like 194.22.167.3 it can't find the static file. But if I write 194.22.167.3:8000 it finds the static file. This is my nginx default file from '/etc/nginx/sites-available/' server { listen 80; server_name 194.110.54.227; access_log /var/log/nginx/example.log; location ~ ^/(static)/ { root /home/ubuntu/KazArma/kazarm/static/; expires 30d; } location /{ proxy_pass http://127.0.0.1:8000; proxy_set_header Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } -
Django ForeignKey can't select
I have movies_movie and casts_cast tables. Each movie can have many cast. In model for movies i have the following: class Cast_movie(models.Model): movie = models.ForeignKey('movies.movie', on_delete = models.CASCADE, blank=True, null=True) cast = models.ForeignKey('casts.cast', on_delete = models.CASCADE, blank=True, null=True) def __str__(self): return self.name When i go to a movie page, i cannot select cast? I'd like to be able to search for a cast(not display all of them) and select, for the current movie page user is on. How do i solve? -
Inheritance Vs Composition: Angular State Management - Django Rest Framework
I am writing a frontend app uses data store "ngxs: a state management pattern library" in "angular" connected to backend "django rest framework". The store has common behavior for managing paginated data: Offset Limit pagination: which i use to manage data intended to be rendered as atable (example table of clients, payments, ..): fetch page form the server using query parameters (offset, limit) change page size using query parameters (limit) change the search terms using search query parameters (search) change the ordering using ordering query parameters (ordering) add custom filters, example: (age__exact>20) Cursor pagination: which i use to manage data intended to be rendered as an unordered (example chat messages) fetch next page form the server using query parameters (nextCursor) fetch previous page form the server using query parameters (previousCursor) change the search terms using search query parameters (search): example search for a chat message Assumptions: Features like pagination(next previous), search, are common for both pagination types. Both pagination types will be affected by CRUD operations (add/remove/update -> message, client). Entity is a generic type for objects fetch from server (Client, Chat messages, payment ..). My Appreoch: I started with OffsetLimitEntityStore and CursorEntityStore each of offset-limit and cursor pagination strategy. … -
Django UpdateView can edit user who created and user to whom record is assigned
Let's say I have model like class Record(models.Model): created = ...... assigned = ....... some_other_fields = ..... How should I modify test_func() in views to allow edit Record both to creator and user to whom the Record is assigned? I would like to enable functionality in frontend side, not in the django admin panel. I'm working with Class Based Views. Standard test_func in UpdateView looks like: def test_func(self): return self.request.user == self.object.created Thanks a lot! -
(DRF) Unable to pass in <int:id> to function via axios post request
I am trying to axios to send id=1 to the django url.py. frontend: const baseURL = 'http://localhost:8000/'; const axiosInstance = axios.create({ baseURL: baseURL, timeout: 5000, }); await axiosInstance.post(`api/public/favourites/1/`, { headers: { 'content-type': 'application/json', } }); url.py path('public/favourites/<int:id>/', add_favourites, name='add_favourites'), view.py @csrf_exempt def add_favourites(request, id): thread = get_object_or_404(Thread, id=id) if request.method == 'POST': if thread.liked.filter(username=request.user.username).exists(): thread.liked.remove(request.user.username) else: thread.liked.add(request.user.username) return Response(thread, status=status.HTTP_200_OK) However, I kept receiving error: ValueError: Field 'id' expected a number but got ''. I really can't find anything wrong in url.py & view.py, so I suspect there are mistakes in the axios request, I have tried deleting my whole database & removing all the migrations, still no luck. Anybody has an idea what is going on about the error? Much appreciated. -
Django CSRF verification failed in django 3.1, used to work in django 1.x
I'm resurrecting and old site which worked using django 1.x. I am running django 3.1.2 now. I converted to python 3 from 2.7. I have 3 forms that post to the site. They all work when running django server on the local machine. But when I test from another machine on my network they give CSFR cookie not sent the form: <form action="/blog/upload" method="POST" enctype="multipart/form-data"><ul><li><label for="id_title">Title:</label> <input type="text" name="title" maxlength="50" required id="id_title"></li> <li><label for="id_file">File:</label> <input type="file" name="file" required id="id_file"></li></ul><input type="hidden" name="csrfmiddlewaretoken" value="eYpdkogXUvof1IqJzgMvJcEGMBpXbvoNLTZNfEjz6aY7WebxbxsvId3nPmT7S4PF"> <input type="submit" value="Go" /> </form> The view: 219 def handle_uploaded_file(f, to_filename): 220 print("In handle_uploaded_file") 221 with open(f'uploads/{to_filename}', 'wb+') as destination: 222 for chunk in f.chunks(): 223 destination.write(chunk) 224 print(f"wrote {to_filename}") 225 226 227 def upload_file(request): 228 print("in upload_file") 229 if request.method == 'POST': 230 print("request.method == 'POST'") 231 form = UploadFileForm(request.POST, request.FILES) 232 if form.is_valid(): 233 print("form is valid") 234 print(request) 235 handle_uploaded_file(request.FILES['file'], request.POST['title']) 236 return HttpResponseRedirect('upload') 237 else: 238 print("in upload_file else clause") 239 form = UploadFileForm() 240 return render(request, 'blog_app/upload_form.html', {'form': form}) I suspect that there are new settings in settings.py but I haven't been able find an answer. -
Is it possible to manipulate image object's values in a Django template?
I have a UserImageForm in Django: class UserImageForm(forms.ModelForm): class Meta: model = UploadImage fields = ['image'] I likewise have a template, which looks like this: {% extends 'base.html' %} {% block content %} {% if user.is_authenticated %} <form method="post" enctype="multipart/form-data"> {% csrf_token %} {{ form.as_p }} <button type="submit">Upload</button> </form> {% if img_obj %} <h3>Successfully uploaded: {{img_obj.caption}}</h3> <img src="{{ img_obj.image.url}}" alt="connect" style="max-height:300px"> {% endif %} {% endif %} {% endblock content %} What is bothering me is if it is possible to attribute a value to img_obj.caption. In case this is possible, how can it be achieved? I tried it with the „set“ and „define“ keywords but to no avail. -
Cannot launch my Django project with Gunicorn inside Docker
I'm new to Docker. Visual Studio Code has an extension named Remote - Containers and I use it to dockerize a Django project. For the first step the extension creates a Dockerfile: # For more information, please refer to https://aka.ms/vscode-docker-python FROM python:3.10.5 EXPOSE 8000 # Keeps Python from generating .pyc files in the container ENV PYTHONDONTWRITEBYTECODE=1 # Turns off buffering for easier container logging ENV PYTHONUNBUFFERED=1 # Install pip requirements COPY requirements.txt . RUN python -m pip install -r requirements.txt WORKDIR /app COPY . /app # Creates a non-root user with an explicit UID and adds permission to access the /app folder # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app USER appuser # During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug # File wsgi.py was not found. Please enter the Python path to wsgi file. CMD ["gunicorn", "--bind", "0.0.0.0:8000", "project.wsgi"] Then it adds Development Container Configuration file: // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/docker-existing-dockerfile { "name": "django-4.0.5", // Sets the run context to one level up instead of the .devcontainer folder. "context": … -
Django: Celery only works on local but not production using the cookiecutter project
I set up a project using the django cookie cutter and deployed it with the docker option https://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html Celery perfectly works on my local machine and gives me a lot of logging information but on production i get nothing about Celery or redis at all. (I'm using Redis as the worker). Since i'm new to celery and couldn't find anything inside the cookiecutter or the celery doc i thought one of you might know more. Is there anything i have to do differently when using Celery with the django cookiecutter? Or is there a way to debug this? So far i tried the internal caprover logs and the docker logs. This is my dockerfile for production: ARG PYTHON_VERSION=3.9-slim-bullseye # define an alias for the specfic python version used in this file. FROM python:${PYTHON_VERSION} as python # Python build stage FROM python as python-build-stage ARG BUILD_ENVIRONMENT=production # Install apt packages RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ # psycopg2 dependencies libpq-dev # Requirements are installed here to ensure they will be cached. COPY ./requirements . # Create Python Dependency and Sub-Dependency Wheels. RUN pip wheel --wheel-dir /usr/src/app/wheels \ -r ${BUILD_ENVIRONMENT}.txt # … -
django.core.exceptions.FieldError: Cannot resolve keyword into field
#################################### I have following code : ##################################### class AppExpandAbstract(BaseModel): class Meta: abstract = True foreign_key = App target = models.ForeignKey( App, blank=True, default=None, on_delete=models.PROTECT, related_name="%(app_label)s_%(class)s", related_query_name="%(app_label)s_%(class)s", ) app_label = "com_longgui_app_proxy_nginx" class LongguiAppProxyNginxAppConfig(AppConfig): name = app_label class NginxAPP(AppExpandAbstract): class Meta: app_label = app_label is_intranet_url = models.CharField(verbose_name=_('Is Intranet URL', '是否内网地址'), max_length=128) class ExpandManager(models.Manager): """ Enables changing the default queryset function. """ def get_queryset(self, filters:dict={}): table_name = self.model._meta.db_table field_expands = field_expand_map.get(table_name,{}) queryset = self.model.objects.all() annotate_params = {} related_names = [] # values = [] # for field in self.model._meta.fields: # if field.name == 'password': # continue # values.append(field.name) for table, field,extension_name,extension_model_cls,extension_table,extension_field in field_expands: related_name = extension_name+'_'+extension_model_cls._meta.object_name related_names.append(extension_table) annotate_params[field] = F(extension_table+'__'+extension_field) # values.append(field) # return queryset.annotate(**annotate_params).select_related(*related_names).values(*values) queryset = queryset.annotate(**annotate_params).select_related(*related_names) print(queryset.query) return queryset.values() ######################################## when code run here,somthing wrong happens! ######################################### apps = App.expand_objects.filter( tenant_id=tenant_id, is_active=True, is_del=False ) ######################################## error log ######################################### Traceback (most recent call last): File "/home/fanhe/workspace/arkid-v2.5/.venv/lib/python3.8/site-packages/ninja/operation.py", line 99, in run result = self.view_func(request, **values) File "/home/fanhe/workspace/arkid-v2.5/arkid/core/api.py", line 143, in func response = old_view_func(request=request, *params, **kwargs) File "/home/fanhe/workspace/arkid-v2.5/.venv/lib/python3.8/site-packages/ninja/pagination.py", line 141, in view_with_pagination items = func(*args, **kwargs) File "/home/fanhe/workspace/arkid-v2.5/api/v1/views/app.py", line 33, in list_apps apps = App.expand_objects.filter( File "/home/fanhe/workspace/arkid-v2.5/.venv/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/fanhe/workspace/arkid-v2.5/arkid/core/expand.py", line 64, in get_queryset queryset = … -
Graphql Wrapper for Rest APIs with Django
Trying to implement wrapper for existing REST APIS using Django graphQL. Found similar one in JS but not in Django. https://graphql.org/blog/rest-api-graphql-wrapper/ Could anyone please suggest if there is a GraphQL Django wrapper for REST calls. Haven't found in documentation either