Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How does a multi-tenant application fit in Microservices based architecture?
I have a SaaS based multi-tenant monolith application (built with Django), that I want to divide into microservices based architecture. But I am not sure how to divide the application into correct partitions. And on what aspects should I take care of? In case of monolith application, it's easy to understand that I have a tenant model that decides the schemas but how this will be done in microservices if I want each service to be multi-tenant? Or should I even make the services multi-tenant? -
Unable to rebuild elasticsearch indexes when running in docker-compose
I am playing with a Django project and elasticsearch 6.3.1 (using django-elasticsearch-dsl). When I am running the project from my own environment having the elasticsearch running in a docker, then everything works fine. The command I am using to run the elasticsearch in docker is docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.1 When I am attempting to run the django project with the elasticsearch together in docker using docker-compose then I get the following error when running python manage.py search_index --rebuild from inside the container of the django project. elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'Root mapping definition has unsupported parameters: [prettyUrl : {type=text}] [summary : {analyzer=html_strip, fields={raw={type=keyword}}, type=text}] [score : {type=float}] [year : {type=float}] [genres : {analyzer=html_strip, fields={raw={type=keyword}, suggest={type=completion}}, type=text}] [id : {type=integer}] [title : {analyzer=html_strip, fields={raw={type=keyword}, suggest={type=completion}}, type=text}] [people : {analyzer=html_strip, fields={raw={type=keyword}, suggest={type=completion}}, type=text}]') Now if i try to add an object then the error coming up is RequestError(400, 'action_request_validation_exception', 'Validation Failed: 1: type is missing;') NOTE that i do not have any of these problems when I am running the django project from the terminal and the elasticsearch using docker run with the command above. The problems only occur when running the docker-compose The documents.py i am using … -
Aggregate the results of a union query without using raw
I have a table that looks like this date car_crashes city 01.01 1 Washington 01.02 4 Washington 01.03 0 Washington 01.04 2 Washington 01.05 0 Washington 01.06 3 Washington 01.07 4 Washington 01.08 1 Washington 01.01 0 Detroit 01.02 2 Detroit 01.03 4 Detroit 01.04 2 Detroit 01.05 0 Detroit 01.06 3 Detroit 01.07 1 Detroit I want to know how many car crashes for each day happened in the entire nation, and I can do that with this: Model.values("date") \ .annotate(car_crashes=Sum('car_crashes')) \ .values("date", "car_crashes") Now, let's suppose I have an array like this: weights = [ { "city": "Washington", "weight": 1, }, { "city": "Detroit", "weight": 2, } ] This means that Detroit's car crashes should be multiplied by 2 before being aggregated with Washington's. It can be done like this: from django.db.models import IntegerField when_list = [When(city=w['city'], then=w['weight']) for w in weights] case_params = {'default': 1, 'output_field': IntegerField()} Model.objects.values('date') \ .annotate( weighted_car_crashes=Sum( F('car_crashes') * Case(*when_list, **case_params) )) However, this generates very slow SQL code, especially as more properties and a larger array are introduced. Another solution which is way faster but still sub-optimal is using pandas: aggregated = false for weight in weights: ag = Model.values("date") \ .annotate(car_crashes=Sum('car_crashes')) … -
Getting Django error (models.E028). for 6 different models after moving from the Desktop folder to the var/www folder on Ububtu Server
I recently moved my django project files from a laptop to a web server. After moving the files I ran the django dev server to test things and everything was fine. After moving the project files once to the var/www folder I attempted again to see if everything still worked before finishing the process of launching the project. I am now getting a django error (models.E028) and don't know how to solve it. I have looked through the models.py folder where these models are and everything appears the same as before. Also I have yet to destroy the copies of the project on the laptop so I tried to launch it there and it works with no errors. Unfortunately the Django docs don't give further explanation of the error, or where to start looking for the cause. I'm sure the error has to do with moving the files from one location to another on the server, but I can't think of why it would affect the models. They have to be in the folder they are located in now, so moving them back isn't a solution. I moved the folder with the following command: sudo mv file/I/needed/to/move /var/www/ Here is … -
Django JSONField - get source text
When using a JSONField, the contents are automatically decoded from JSON into python objects when reading the value. I have a use-case where I'm encoding the string back into JSON to embed in a template. Is there any way to just get the raw JSON string from the object? -
Django - Create unique ID for multiple columns
I am creating a model in Django and want to create a unique ID that is "grouped" on multiple columns. For example, if Col1, Col2 are the same, but Col3 is unique, create a Group ID from that combination of similar and unique column values. UUID Col1 Col2 Col3 Group ID 1 1929 9183 8192 192843 2 1929 9183 8193 192843 3 1929 9183 8194 192843 4 1839 8391 9183 984821 4 1839 8391 9184 984821 -
Build Docker container for Django in Centos
I'm trying to build docker container in Centos VM. Getting error Here is the OS type: uname -a Linux host01 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux DockerFILE: # pull official base image FROM python:3.7-alpine # set work directory WORKDIR /usr/src/src # set environment varibles ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # install psycopg2 RUN apk update \ && apk add --no-cache --virtual build-deps gcc python2-dev python3-dev musl-dev \ && apk add postgresql-dev \ && pip install psycopg2 \ && apk del build-deps Getting ERROR: Step 6/15 : RUN apk update && apk add --no-cache --virtual build-deps gcc python2-dev python3-dev musl-dev && apk add postgresql-dev && pip install psycopg2 && apk del build-deps ---> Running in 3f4abc717bca fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/main: IO ERROR WARNING: Ignoring APKINDEX.00740ba1.tar.gz: No such file or directory fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/community: IO ERROR WARNING: Ignoring APKINDEX.d8b2a6f4.tar.gz: No such file or directory Getting the above error, is that related to OS, as the it is Alpine Linux. How to fix it the error? -
Django. 301 Redirect from old URL to new
Hello! Please tell me how to organize a redirect correctly. There is an old version of the site and a new one. In the old version (another CMS, not Django) the objects have their own URL, in the new revised scheme, and the objects have a different URL. In each object on the new site, there is a completed field with the old URL. In model.py it looks like this: old_url = models.CharField('Old URL', blank=True, max_length=100) I specifically moved the old url to a separate field. Or was it not necessary to do this? Question. How to set up a redirect correctly, so that after going to the object using the old URL, the site visitor will be redirected to the new URL of this object? -
Auto increment field in context of foreign key
I am writing as an (personal) exercise a little Issue tracker in django. I want to have for a model an integer field that is unique (auto incremented), but not for the whole model/table but in the context of a related model. class Parent(models.Model): name = models.CharField(max_length=10) class Child(models.Model): parent = models.ForeignKey(Parent, models.CASCADE) identifier = models.IntegerField() The goal is to have a parent classes with the names "ABC" and "XYZ". Now i want to create multiple instances of child classes and the identifiers should more or less auto increment in the context of the Parent class. Instance #1: parent is "ABC" -> identifier = 1 Instance #2: parent is "ABC" -> identifier = 2 Instance #3: parent is "DEF" -> identifier = 1 How do i achieve this in a transaction safe manner? -
I have a proble with Django, whit the manage.py file
I just began with Django, I'm following the steps of a youtube tutorial, but when I want to run this command: python manage.py runserver This is the error message: Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x03E82780> Traceback (most recent call last): File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "D:\Personal\Dev\cfehome\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run autoreload.raise_last_exception() File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\autoreload.py", line 251, in raise_last_exception six.reraise(*_exception) File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\six.py", line 685, in reraise raise value.with_traceback(tb) File "D:\Personal\Dev\cfehome\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "D:\Personal\Dev\cfehome\lib\site-packages\django\__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "D:\Personal\Dev\cfehome\lib\site-packages\django\apps\registry.py", line 85, in populate app_config = AppConfig.create(entry) File "D:\Personal\Dev\cfehome\lib\site-packages\django\apps\config.py", line 94, in create module = import_module(entry) File "D:\Personal\Dev\cfehome\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\__init__.py", line 4, in <module> from django.contrib.admin.filters import ( File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\filters.py", line 10, in <module> from django.contrib.admin.options import IncorrectLookupParameters File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\options.py", line 12, in <module> from django.contrib.admin import helpers, widgets File "D:\Personal\Dev\cfehome\lib\site-packages\django\contrib\admin\widgets.py", line 151 '%s=%s' % (k, v) for k, … -
400 Bad Request from Axios to Django, field is required
I'm trying to send a POST request from my React frontend using Axios import axios from 'axios' axios.post('http://server:port/auth/login', { username: 'admin', password: 'MY_PASSWORD', }, { headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' } }) .then(response => { console.log(response) }) .catch(error => { console.log(error.response) }); No matter what I do, I get a 400 Bad Request in response stating: "username":[This field is required], "password":[This field is required] I am using the Django REST framework in my Django Backend for authentication. Everything works fine using Insomnia but any requests through React results in a "Bad Request" django-cors-headers has been installed and configured as well. -
How to list Models in the django shell?
Say i have a simple model: class NewsFeed(models.Model): title = models.CharField(max_length=50) tags = models.TextField() def __str__(self) return self.title I have 50 entries and I want to display all the different tags field for each News Feed uniquely on the shell, how can i do so (bearing in mind the tags field isn't unique by default)? If i import the models and objects.all it, it simply displays the objects themself -
Translating a PHP project to Django framework
I'm a PHP developer and I'm very new to Django. I am stuck and don't know where else to turn to. I am trying to translate a program I developed in PHP into Django. So many aspects are working well, but I'm stick particular where I'm trying to display quizzes from a database. There is a database table called "table_assessment". It contains accessmemts. There is another table called "table_scores". Assessments are only sent to the database of the score is => 80%. That's the same exact thing I'm trying to implement in Django. My primary area of interest is the aspect where I get questions, options and answers all from one table, and update another table if the user scores =>80% Please help me out. My PHP code looks like this: <form id="form_assessment" rol="form" method="post" action='<?php echo $_SERVER["PHP_SELF"]."?assessment_id=".$assessment_id; ?>'> <?php $ql=mysqli_query($conn, "SELECT * from table_assessment where course_id ='".$assessment_id."'"); $count=0; while($row=mysqli_fetch_array($ql,MYSQLI_ASSOC)){ $count++; echo "<p>".$row["assessment_content"]."</p>"; echo "<ul style='list-style-type:none; required'>"; echo '<li><input type="radio" name="r_'.$count.'" value="a"/> '.$row["option_a"].'</li>'; echo '<li><input type="radio" name="r_'.$count.'" value="b"/> '.$row["option_b"].'</li>'; echo '<li><input type="radio" name="r_'.$count.'" value="c"/> '.$row["option_c"].'</li>'; echo '<li><input type="radio" name="r_'.$count.'" value="d"/> '.$row["option_d"].'</li>'; echo "</ul>"; } ?> <div> <input type="submit" id="btn_assessment" name="btn_assessment" class="btn btn-success" value="FINISH"> </div> </form> This checks to see if … -
Graphene Django mutation returning object with subobjects fails
When I execute a mutation (with SerializerMutation) and return the created object, the response contains an AssertionError that states User Error: expected iterable, but did not find one for field CreateTableMutationPayload.footSet The issue is in executor.py complete_list_value that checks that the footSet is an iterable. It is in fact a RelatedManager, which is not iterable as is. Normally, you'd just do a table.foot_set.all() to get the iterable. I find it stange that it is working fine in Queries but not Mutations. I created a sample project to illustrate this. I have a pretty simple model of Table with several Foot. Both objects are exposed with Relay and this works great. Querying: { tables { edges { node { id, name, height footSet { edges { node { id, number, style } } } } } } } } returns: { "data": { "tables": { "edges": [ { "node": { "id": "VGFibGVOb2RlOjE=", "name": "test1", "height": 11, "footSet": { "edges": [ { "node": { "id": "Rm9vdE5vZGU6MQ==", "number": 1, "style": "plain" } }, { "node": { "id": "Rm9vdE5vZGU6Mg==", "number": 2, "style": "Almost plain" } } ] } } } ] } } } But a mutation: mutation { createTable(input: { name:"test3" height: 60 … -
search user by username in django
views.py class CreateUserM(CreateModelMixin, ListAPIView): serializer_class = UserSerializer def get_queryset(self): qs = User.objects.all() query = self.request.GET.get('q') if query is not None: qs = qs.filter(username__search=query) return qs class Updareuser(UpdateModelMixin, RetrieveAPIView): def get_queryset(self): username = self.kwargs['pk'] return User.objects.filter(id=username) serializer_class = UserSerializer ``` url.py ```python urlpatterns = [ url(r'^$', CreateUserM.as_view(), name='list_view'), url(r'^(?P<pk>\d+)$', Updareuser.as_view(), name='list_vfiew'), ] I want to search a user by its username but this code have some errors when i filtering by id it works but about the other things have error i changed the Django User model with OneToOnefield . -
I am not able to get that why this error. And what is the solution for this
I am beginner so please bear silly questions if i remove highlighted lines 1,2,3(+ static line) my localhost it shows normal django homepage but after adding these highlighted lines, it shows error Page not found (404) Request Method: GET Request URL: http://localhost:8000/ Using the URLconf defined in portfolio.urls, Django tried these URL patterns, in this order: admin/ ^media/(?P<path>.*)$ The empty path didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. but admin page loads with no problem #urls.py file from django.contrib import admin from django.urls import path`enter code here` from django.conf import settings **<----- 1** from django.conf.urls.static import static **<----- 2** urlpatterns = [ path('admin/', admin.site.urls), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ** <--- 3** -
optional int(request.POST.get('timeout') throws error when empty
This field timeout = int(request.POST.get('timeout')) throws an error saying invalid literal for int() with base 10: '' this is my model field: timeout = models.IntegerField(default=10) The forms submits just fine if I submit number because the form interprets it as a string but my form handler will convert it into integer. But it fails if I leave the field blank. Seems like it can't process an empty string. What can I do ? -
django .validate() should return the validated data
I am able to get to the pdb.set_trace of the validate() function of the subclassed serializer, however I am still receiving this error: assert value is not None, '.validate() should return the validated data' AssertionError: .validate() should return the validated data class UserSerializer(BaseUserSerializer): user = BaseUserSerializer() class UnitSerializer(BaseUnitSerializer): prop = BasePropertySerializer() def to_internal_value(self, data): if isinstance(data, int): return self.Meta.model.objects_all.get(pk=data) class ProjectListViewSerializer(BaseProjectSerializer): unit = UnitSerializer() coordinators = UserSerializer(many=True) due_date = serializers.DateTimeField() start_date = serializers.DateTimeField() project_type = serializers.ChoiceField(choices=Project.PROJECT_TYPE_CHOICES, ) name = serializers.CharField() description = serializers.CharField() def validate(self, attrs): if hasattr(attrs, 'unit') and hasattr(attrs['unit'], 'is_active') and not attrs['unit'].is_active: raise serializers.ValidationError({'unit': ['Unit is not active, please activate this unit.']}) coordinators = attrs.get('coordinators', []) if not len(coordinators): raise serializers.ValidationError('Coordinator(s) required when creating a project.') if not attrs.get('due_date', ''): raise serializers.ValidationError('Due date required when creating a project.') if not attrs.get('start_date', ''): raise serializers.ValidationError('Start date required when creating a project.') if not attrs.get('project_type', ''): raise serializers.ValidationError('Project type required when creating a project.') if not attrs.get('name', ''): raise serializers.ValidationError('Project name required when creating a project.') if not attrs.get('description', ''): raise serializers.ValidationError('Project description required when creating a project.') import pdb;pdb.set_trace() return attrs class Meta: model = models.Project -
Using UUIDField in Django keeps creating new migrations
I have a simple model:: class HasUUID(models.Model): name = models.CharField(max_length=10) batchid = models.UUIDField(default=uuid.uuid4(), unique=True) running makemigrations gives me the migration:: operations = [ migrations.CreateModel( name='HasUUID', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=10)), ('batchid', models.UUIDField(default=uuid.UUID('79a2d9fe-e1d0-4d4b-884f-fad0bfb14f0f'), unique=True)), ], ), ] Running migrate gives me the new table no problem. But I can run makemigrations again and I get:: operations = [ migrations.AlterField( model_name='hasuuid', name='batchid', field=models.UUIDField(default=uuid.UUID('3b96231c-5848-430b-aa90-b6e41b11fd0a'), unique=True), ), ] and while I have lived with this for a while, manually removing the unnecessary code, I need to resolve it. so I think, make the default a separate function in the migrations as shown in various examples:: def create_uuid(apps, schema_editor): m = apps.get_model('web', 'HasUUID') for inst in m.objects.all(): inst.batchid = uuid.uuid4() inst.save() ... migrations.CreateModel( name='HasUUID', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=10)), ('batchid', models.UUIDField(blank=True, null=True)), ], ), migrations.RunPython(create_uuid), migrations.AlterField( model_name='hasuuid2', name='batchid', field=models.UUIDField(default=uuid.uuid4, unique=True) ), same problem. So I tried making the default a separate function in the model:: def create_uuid(): return uuid.uuid4() class HasUUID2(models.Model): name = models.CharField(max_length=10) batchid = models.UUIDField(default=create_uuid(), unique=True) and this gets me this migration:: migrations.CreateModel( name='HasUUID3', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=10)), ('batchid', models.UUIDField(default=uuid.UUID('335c3651-b04e-4ed8-a91d-f2da3f53dd8f'), unique=True)), ], ), and again, keeps generating new migrations. I've also tried without … -
Use 'generator object grouped' in Paginator. Django
I added to my queryset, function which groups my objects. It is necessary in my template to add <ul> every 3 occurrences of the object. My code in the template looks like this. {% for group in groups %} <ul> {% for object in group %} <li>{{ object }}</li> {% endfor %} </ul> {% endfor %} My views.py (queryset and function) def grouped(l, n): for i in range(0, len(l), n): yield l[i:i+n] groups = grouped(City.objects.all(), 3) Now trying to add Paginator in my views.py # paginator page = request.GET.get('page', 1) paginator = Paginator(groups, 5) try: objects = paginator.page(page) except PageNotAnInteger: objects = paginator.page(1) except EmptyPage: objects = paginator.page(paginator.num_pages) and it returns the following error (in my template): object of type 'generator' has no len() How can i use generator object grouped in Paginator. Is it possible to change the code easily to keep grouping and use Pagination (together)? Any help will be appreciated. -
after installing create project how to reopen django project 3.7 version in python windows 10
http://127.0.0.1:8000/ after successfully installed django how to reopen and what are the main purpose ? Can I again open in Python 3.7 version ? -
why am i getting a NameError at /?
NameError at / name 'respose_html' is not defined Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 2.2.4 Exception Type: NameError Exception Value: name 'respose_html' is not defined Exception Location: C:\Users\Jerry\Desktop\development\myproject\Blogs\boards\views.py in home, line 14 Python Executable: C:\Users\Jerry\AppData\Local\Programs\Python\Python37\python.exe Python Version: 3.7.4 from django.shortcuts import render from .models import Board from django.http import HttpResponse Create your views here. def home(request): boards = Board.objects.all() boards_names = list() for board in boards: boards_names.append(board.name) response_html = '<br>'.join(boards_names) return HttpResponse(respose_html) -
How can i customize the reset password email
I add html tags to password_reset_email.html but when the email is sended the tags is showed like string <div style="width: 100%; height: 450px; border: 1px solid #e8e8e8"> {% load i18n %}{% autoescape off %} Usted está recibiendo este correo electrónico porque ha solicitado un restablecimiento de contraseña para su cuenta de usuario. {% trans "Please go to the following page and choose a new password:" %} {% block reset_link %} {{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} {% endblock %} {% trans "Your username, in case you've forgotten:" %} {{ user.get_username }} {% endautoescape %} </div> -
DRF Serializing multiple models
I can't serialize multiple object as this answers says to do. In particular it gives me this error "Got AttributeError when attempting to get a value for field Functional on serializer GeneralSerializer. The serializer field might be named incorrectly and not match any attribute or key on the QuerySet instance. Original exception text was: 'QuerySet' object has no attribute 'Functional'." Someone can help me? My views.py is made like this General = namedtuple('General', ('Functional', 'Pfm')) @csrf_exempt def listall(request): if request.method == 'GET': general = General( Functional= SnpsFunctionalelement.objects.values('countexperiments','filetype',rsid=F('snpid__rsid'), FunctionalElement=F('elementid__name'), CellLine=F('celllineid__name')), Pfm = SnpsPfm.objects.values('start','strand','type','scoreref','scorealt',rsid=F('snpid__rsid'), pfm_name=F('pfmid__name')) ) serializer = GeneralSerializer(general, many = True) return JsonResponse(serializer.data, safe=False) my serializers.py class SnpsFunctionalelementSerializer(serializers.ModelSerializer): rsid = serializers.CharField(max_length=20) FunctionalElement = serializers.CharField(max_length=55) CellLine = serializers.CharField(max_length=55) class Meta: model = SnpsFunctionalelement fields = ['rsid', 'FunctionalElement', 'CellLine', 'countexperiments', 'filetype'] class SnpsPfmSerializer(serializers.ModelSerializer): rsid = serializers.CharField(max_length=20) pfm_name = serializers.CharField(max_length=50) class Meta: model = SnpsPfm fields =[ 'rsid','pfm_name','start','strand','type','scoreref','scorealt'] class GeneralSerializer(serializers.Serializer): Functional = SnpsFunctionalelementSerializer(many=True) Pfm = SnpsPfmSerializer(many=True) P.S.: I even tried to work without the DRF serializers doing this all_objects = [SnpsFunctionalelement.objects.values('countexperiments','filetype',rsid=F('snpid__rsid'), FunctionalElement=F('elementid__name'), CellLine=F('celllineid__name')), SnpsPfm.objects.values('start','strand','type','scoreref','scorealt',rsid=F('snpid__rsid'), pfm_name=F('pfmid__name'))] ser = serializers.serialize('json',all_objects) return JsonResponse(ser) but it gives me this error "QuerySet object has no attribute _meta" -
When to use React combined with Django?
I've been working with the django framework and mostly have been using html templates for its front end but im wondering whether i should switch to React if it's a big project? Alternativelyl, can i create a user interface application without using React as front end or is React / ReactRedux advisable when using Djngo?