Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
DFR serialisation issue: combining django-simple-history and django-polymorphic
I am using regular Django models but have now started to incorporate a polymorphic model into my DFR REST API project using django-polymorphic and rest-polymorphic. I am also using django-simple-history to track changes to entries in my database. This all works fine for normal models and polymorphic models without a HistoricalRecords() field, but errors when trying to interact with any polymorphic model that has a HistoricalRecords() field: django.core.exceptions.FieldError: Cannot resolve keyword 'material_ptr_id' into field. In my serialiser for the polymorphic models, I use the following technique to serialise the history field: class HistoricalRecordField(serializers.ListField): child = serializers.DictField() def to_representation(self, data): return super().to_representation(data.values()) class ItemSerializer(serializers.ModelSerializer): history = HistoricalRecordField(read_only=True) class Meta: model = Item fields = ('history') Is there a way to exclude the material_ptr_id field from being taken into account by the serialiser as it is not part of the parent model but only the child models? Or are there any obvious other mistakes I am making? Thanks for any help with this. -
How do I redirect to a URL using data from a form input?
I'm trying to request a number from the user and redirect to a page website.com/players/number I'm unsure of how to do that I tried the below <form action = "/players/{content}" method = "post">{% csrf_token %} <input type ="text" name ="content"/> <input type ="submit" value="Search"/> </form> It doesn't really do anything. I'm unsure how to do this. thanks -
How to properly query with relation to AnonymousUser in django?
What I have: def get_queryset(self): user = self.request.user return Entry.objects.prefetch_related('likers', 'dislikers', 'favers').annotate( liked=ExpressionWrapper(Q(likers__id=user.id or 1), output_field=BooleanField()), disliked=ExpressionWrapper(Q(dislikers__id=user.id or 1), output_field=BooleanField()), faved=ExpressionWrapper(Q(favers__id=user.id or 1), output_field=BooleanField()), ) which is basically (user_related__foo=user.foo or impossible_user_foo) which prevents an unwanted behavior. I don't know if it is a bug or am I doing something wrong but ExpressionWrapper(Q(user_related__id=user.id), output_field=BooleanField()) when the user.id is None and when the user_related.all() is empty, gives True when annotated as in the example: >>> qs = Entry.objects.annotate( ... liked=ExpressionWrapper(Q(likers__id=None), output_field=BooleanField()) ... ) >>> >>> qs[0].likers.all() <QuerySet []> >>> qs[0].liked True >>> I was okay with writing at least a generic hack that would work on every situation with something like nope = object() Q(user_related__foo=getattr(user, 'foo', nope)) But this also doesn't work because nope is not valid for any given field. Now the question is: What is the standard way to generically handle this kind of queries? -
Could not get Retail Price in django oscar
I have created one parent product taj mahal tea in which I have created its child product taj mahal tea 1 kg variant and gave price(excl_tax) and Retail Price which you can see in this image. But when I am trying to access price object I could not get a retail price attribute in it. here is my sample code: from oscar.core.loading import get_class, get_model from oscar.apps.partner.strategy import Selector Product = get_model('catalogue', 'Product') product = Product.objects.filter(id=11) strategy = Selector().strategy() info = strategy.fetch_for_product(product) print(info.price) Output: FixedPrice({'currency': 'INR', 'excl_tax': Decimal('400.00'), 'tax': Decimal('0.00')}) Here is my testing code and its output: >>> strategy = Selector().strategy() >>> info = strategy.fetch_for_product(product) >>> info PurchaseInfo(price=FixedPrice({'currency': 'INR', 'excl_tax': Decimal('400.00'), 'tax': Decimal('0.00')}), availability=<oscar.apps.partner.availability.StockRequired object at 0x7f2db2324e80>, stockrecord=<StockRecord: Partner: Aapnik, product: Taj mahal 1 kg (xyz)>) >>> info.price FixedPrice({'currency': 'INR', 'excl_tax': Decimal('400.00'), 'tax': Decimal('0.00')}) Any help will be greatly appericiated. -
Open specific page from APNS (push notification) in Django\python
We used the django-push-notification package to send APNS messages. We expect to open a specific app page while the user clicks the notification. We see such implementations only in SWIFT code, Does anyone have an example\ can refer us to how this can be done with Django \ ionic \ python? ''' device = APNSDevice.objects.filter(registration_id=device_id).first(); device.send_message(message={"title": title, "body": body}) ''' -
Redirect request to the right view
Django==2.2.2 Urlpattenrs: urlpatterns = [ re_path(r'^campaigns/$', CampaignsListView.as_view(), name="campaigns_list"), re_path(r'^campaigns/(?P<ids>\w+)/$', CampaignsDetailView.as_view(), name="campaigns_detail"), ] My url: http://localhost:8000/campaigns/?ids=44174865,44151214,44049374 The problem: This url leads to CampaignsListView rather than to CampaignsDetailView. Could you help me direct this request to CampaignsDetailView? -
Django Nested Serilizer with post method
I have successfully created my serializer class with class with django and it works very nice only for GET Method but i need also POST method should work. Currently Post method not working... this is my serializer class: from rest_framework import serializers from . models import Author, Article, Category, Organization class OrganizationSerializer(serializers.ModelSerializer): class Meta: model = Organization fields = '__all__' class AuthorSerializer(serializers.ModelSerializer): organization = OrganizationSerializer() class Meta: model = Author fields = '__all__' class CategorySerializer(serializers.ModelSerializer): class Meta: model = Category fields = '__all__' class ArticleSerializer(serializers.ModelSerializer): author = AuthorSerializer() category = CategorySerializer() class Meta: model = Article fields = '__all__' Above snippet working only for GET method, not for POST Method... I need it should work for post method.. If you dont understand above serilizers, you can see my models: from django.db import models import uuid class Organization(models.Model): organization_name = models.CharField(max_length=50) contact = models.CharField(max_length=12, unique=True) def __str__(self): return self.organization_name class Author(models.Model): name = models.CharField(max_length=40) detail = models.TextField() organization = models.ForeignKey(Organization, on_delete=models.DO_NOTHING) def __str__(self): return self.name class Category(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name class Article(models.Model): alias = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) author = models.ForeignKey(Author, on_delete=models.CASCADE, related_name='author') title = models.CharField(max_length=200) body = models.TextField() category = models.ForeignKey(Category, on_delete=models.CASCADE) Can anyone tell me what … -
django duplicates the name of model for migration table
when i migrate my django 2 models it makes tables without any problem but the name of table is like this :nameofmodel_nameofmodel !!! so for example booking_booking !!! here is my code : from django.db import models # Create your models here. class Booking(models.Model): user_id = models.CharField(max_length=50, null=True ) operator_id = models.CharField(max_length=50, null=True ) computed_net_price = models.CharField(max_length=50, null=True ) final_net_price = models.CharField(max_length=50, null=True ) payable_price = models.CharField(max_length=50, null=True ) booking_status = models.CharField(max_length=50, null=True ) guest_name = models.CharField(max_length=50, null=True ) guest_last_name = models.CharField(max_length=50, null=True ) guest_cellphone = models.CharField(max_length=50, null=True ) from_date = models.DateTimeField(max_length=50, null=True ) to_date = models.DateTimeField(max_length=50, null=True ) is_removed = models.IntegerField(null=True ) and here is my serializer : from rest_framework import serializers from .models import Booking class BookingSerializer(serializers.ModelSerializer): class Meta: model = Booking fields =( 'user_id', 'computed_net_price', 'final_net_price', 'payable_price', 'booking_status', 'booking_status', 'guest_name', 'guest_last_name', 'guest_cellphone', 'guest_cellphone', 'guest_cellphone', 'operator_id', 'is_removed', ) so what is the standard naming of django and what if i want to have it in a different way and i am doing correctly or not -
Authenticating Users In Django With SSH Keys
I would like to users of my REST API written in Django to be able to authenticate using SSH keys. What I am doing is I have created an API to allow me to release software to my website via the command line. I want to authenticate using my ssh key when accessing that API. So I have in my user interface that I can add public ssh keys associated with my user account. Now how do I validate the keys in order to authenticate? What is it that I have to do? I have my API client that will make a post call to: https://examlple.com/api/release/ How can validate keys!? I have found a couple of python libraries but they are incomplete or unclear. Any step in the right direction would be helpfl. -
Django - Select multiple groups while creating new object
I am trying to create a django form where new objects should be created and one or more groups should be assigned (to view or edit) that objects. The problem is that in the db, not only the selected groups are save, but all groups where user has access. Here is what I tried: forms.py class MyForm(forms.ModelForm): Groups = forms.ModelMultipleChoiceField(queryset=Group.objects.all(),widget=forms.CheckboxSelectMultiple) class Meta: model = MyModel fields = ('Name','Groups') def __init__(self, user, *args, **kwargs): super(MyForm, self).__init__(*args, **kwargs) self.fields['Groups'].queryset=Group.objects.filter(user=user) Models.py class MyModel(models.Model): Name = models.CharField(max_length=50) Groups = models.ManyToManyField(Group) def __str__(self): return str(self.Name) Views.py def CreateObject(request): form = MyForm(request.user, request.POST) if request.method == 'POST': if form.is_valid(): publish = form.save(commit=False) Name = form.cleaned_data.get('Name') user = request.user groups = Group.objects.filter(user=request.user) instance = MyModel.objects.create(Name=Name) instance.Groups.set(groups) return HttpResponseRedirect('/') return render(request, 'pages/CreateObject.html', {'form' : form}) Can you help me figuring out how to save only the selected groups, not all groups where an user has access? Thanks! -
How to use labels resource file in Django like in .Net? [duplicate]
This question already has an answer here: Django - How to make a variable available to all templates? 2 answers My question is how to use labels or resource management like in .Net for example in .net we can define a key and value for a string so we can use every where like ( website title ) by just calling that key so later if you used the label 100 times and need to change is we can change in one place which teh resource file. <asp:Label ID="Label1" Text="<%$Resources:Resource, Greetings %>" runat="server" Font-Bold="true" /> ((( here we called teh greeting key to be teh value for teh label text))) how can we do this in Django #Django -
Does setting a unique_together cause droping of duplicates upon migration?
I have duplicates, for a pair of fields, in my database which I would like to drop. Can I do this by simply setting unique_together on the pair and migrating? I am using Django 2.0. Here is the model(with the unique_together already added): class Candle(models.Model): symbol = models.CharField(max_length=32) name = models.CharField(max_length=32) timestamp = models.DateTimeField() open = models.FloatField() high = models.FloatField() low = models.FloatField() close = models.FloatField() volume = models.FloatField() def __str__(self): return 'Candlestick for {} at {}.'.format(self.symbol, self.timestamp) class Meta: indexes = [ models.Index(fields=['symbol']), models.Index(fields=['timestamp']) ] unique_together = (('symbol', 'timestamp'),) Otherwise what is the best way to drop these duplicates, and avoid the insertion of new ones? -
Multifactor Authenticator in Django Rest Framework using Deux
I want to use multifactor authentication in my app which is built by using Djangorest Framework and angular. I want to use google authenticator for it. I found the library Deus in Django rest. It is difficult to integrate google authenticator. How can I do it? -
How to filter and query objects of a 3rd model based on fields of Profile model?
I am creating a management system for my college. I am new to django and please guide me through. Find this project repository or clone it : https://github.com/VickramMS/student-analytica.git So here is my question. I have three models. The User model, a Profile model (OneToOne-Relationship with User model), an Attendancee model (ForeignKey relationship with User model). Profile Model: class Profile(models.Model): #YEAR=Choices #DEPT=Choices user=models.OneToOneField(User,on_delete=models.CASCADE) Year=models.CharField(choices=YEAR) Department=models.Charfield(choices=DEPT) Attendancee model: class Attendancee(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) Hour = models.CharField(max_length=1, blank=True, help_text="Hour") subject = models.CharField(max_length=8, blank=True, help_text="Subject") date = models.DateTimeField(auto_now_add=True) presence = models.BooleanField(default=False) def __str__(self): return f'{self.user.username}' The objective is, i need to make filter fields in the template so that the staff can filter the students based on YEAR(Profile filed) and DEPARTMENT(Profile field) and display the forms to enter the value in the Attendancee model. So i tried this is my view from user.models import Attendancee def academics: if request.user.is_staff: context = { 'queryset': Attendance.objects.filter(user=User.objects.filter(profile__Year='FY').filter(profile__Department='CSE').values_list('username') #FY and CSE are choices return render(request, 'console/academics.html',context) else: ... The above snippet throws an error that the list goes out of range. I know that the problem is, when i query this, User.objects.filter(profile__Year='FY').filter(profile__Department='CSE').values_list('username') it will return a query set and not a single query, so that the filter … -
I am trying to implement blog app with Django.In my profile model i set on delete cascade but its not working?
I am trying to implement blog app with Django.I created profile model for profile image where id from auth_user model is foreign key in profile model.And i given on delete = cascade in profile model.But if i delete a user from auth_user in pgadmin 4 it says "update or delete on table "auth_user" violates foreign key constraint "blog_profile_user_id fk_auth_user_id" on table "blog_profile" models.py class Profile(models.Model): user = models.OneToOneField(User,on_delete=models.CASCADE) image = models.ImageField(default='default.jpg',upload_to='pics') -
Multiple self referenced ForeignKey relationship fields in Django model
Wich way should I create multiple self referenced ForeignKey fields in Django model? My current Model looks like: class WordCoreModel(models.Model, BaseModel): word_core = models.CharField(max_length=255, default="") word_russian_typed = models.CharField(max_length=255, default="", blank=True) word_english_typed = models.CharField(max_length=255, default="", blank=True) homonym = models.ForeignKey( 'self', on_delete=models.CASCADE, null=True, blank=True, related_name="core_words", related_query_name='homonym') synonym = models.ForeignKey( 'self', on_delete=models.CASCADE, null=True, blank=True, related_name="core_words", related_query_name='synonym') antonym = models.ForeignKey( 'self', on_delete=models.CASCADE, null=True, blank=True, related_name="core_words", related_query_name='antonym') class Meta: indexes = [models.Index(fields=['word_core'])] verbose_name = 'Core Word' verbose_name_plural = 'Core Words' def __str__(self): return self.word_core Please give me some best-practices examples. I searched a lot for different solutions. I don’t find examples when there are several fields in the model. -
Django API: grabing Nested Json for UnitTest
I have api end point and trouble in garbing item from nested json... I am writing test like this and printing what data it me appears: class TestSingleArticle(TestCase): def setUp(self): article = ArticleFactory2.create() self.url = reverse('article-single2', args=[article.alias]) def test_single_article_get(self): request = self.client.get(self.url) print(request.data) When i run this, i see following json in terminal {'alias': '508674f2-b570-47f1-b1d8-01592a3af359', 'author': OrderedDict([('id', 1), ('organization', OrderedDict([('id', 1), ('organization_name', 'org name'), ('contact', '256644')])), ('name', 'jhon doe'), ('detail', 'this is detail')]), 'category': OrderedDict([('id', 1), ('name', 'sci-fi')]), 'title': 'i am title', 'body': 'i am body'} I am trying grab contact from above json but i failed.... -------------------- If you dont understand above statement, see these optional hint for you. This is my serilization class: from rest_framework import serializers from . models import Author, Article, Category, Organization class OrganizationSerializer(serializers.ModelSerializer): class Meta: model = Organization fields = '__all__' class AuthorSerializer(serializers.ModelSerializer): organization = OrganizationSerializer(): class Meta: model = Author fields = '__all__' class CategorySerializer(serializers.ModelSerializer): class Meta: model = Category fields = '__all__' class ArticleSerializer(serializers.ModelSerializer): author = AuthorSerializer() category = CategorySerializer() class Meta: model = Article fields = '__all__' and below are my models: from django.db import models import uuid class Organization(models.Model): organization_name = models.CharField(max_length=50) contact = models.CharField(max_length=12, unique=True) def __str__(self): return self.organization_name … -
Django urlpatterns regex is imprecise, getting 404?
I'm working on Django API URLs, and trying to recognize this type of HTTP request: DELETE http://localhost:8000/api/unassigned_events/dddd-dd-dd/d or dd/ - d for digit, whilst saving each sector in an argument. e.g. DELETE http://localhost:8000/api/unassigned_events/2019-06-20/1/ My regex path expression is: path(r'^api/unassigned_events/(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})/(?P<cls_id>[0-9]{1,2})/$', UnassignedClassRequests.as_view(), name='delete') The HTTP request is the given example above, but I'm receiving a 404 error instead of the view's functionality. Here's the to-be-called view method: class UnassignedClassRequests(APIView): @staticmethod def delete(request): UnassignedEvents.objects.filter(date=request.date, cls_id=request.cls_id).delete() return HttpResponse(status=status.HTTP_201_CREATED) and the error I'm getting on Chrome: DELETE http://localhost:8000/api/unassigned_events/2019-06-20/1/ 404 (Not Found). I've also tried this regex expression for the path, not succeeding: path(r'^api/unassigned_events/(?P<year>[0-9]{4})-(?P<month>[0-9]{2})-(?P<day>[0-9]{2})/(?P<cls_id>[0-9]{1,2})/$' UnassignedClassRequests.as_view(), name='delete') What am I doing wrong? -
__init__() got an unexpected keyword argument 'use_required_attribute'
I don't know why in some pages give me this error, and in others dosen't show me the error I try to add a requiered attrbute but dosen't work, I don't how to add it Model class Vehicle(models.Model): registration = models.CharField(max_length=200, default='') vehicle_type = models.ForeignKey(VehicleType, on_delete=models.CASCADE) def __str__(self): return self.registration class Meta: verbose_name_plural = "Vehicles" Form class VehicleForm(ModelForm): class Meta: model = Vehicle fields = ['registration', 'vehicle_type'] View def vehicles(request): vehicles = Vehicle.objects.all() context = { 'title' : 'Vehicles', 'generic_objects' : vehicles } return render(request, 'vehicle/index.html',context) def vehicle(request, id): VehicleFormSet = modelformset_factory(Vehicle, exclude=(), extra=0) #Add a vehicle if request.method == 'POST': formset = VehicleFormSet(request.POST, request.FILES) if formset.is_valid(): formset.save() return HttpResponseRedirect('/favorita/vehicles') #Edit the vehicle else: vehicles_search = Vehicle.objects.filter(id = id) if vehicles_search: formset = VehicleFormSet(queryset=vehicles_search) else: formset = formset_factory(VehicleForm) return render(request, 'vehicle/details.html', {'formset': formset, 'id':id, 'title':"Vehicle"}) def delete_vehicle(request, id): Vehicle.objects.filter(id=id).delete() return HttpResponseRedirect('/favorita/vehicles') The error image -
I am trying to implement blog app with Django.I created registration form with profile pic upload.But its returning IntegrityError
I am trying to implement blog app with Django.I created registration form with profile pic upload.But its returning integrity error null value in column "user_id" violates not-null constraint DETAIL: Failing row contains (7, pics/P_Wk6m1b3.png, null). #models.py class Profile(models.Model): user = models.OneToOneField(User,on_delete=models.CASCADE) image = models.ImageField(default='default.jpg',upload_to='pics') #views.py def register(request): if request.method == "POST": form = Register(request.POST,request.FILES) if form.is_valid(): profile = Profile() email = form.cleaned_data['Email'] User_name=form.cleaned_data['Username'] Password=form.cleaned_data['Password'] Confirm_Password=form.cleaned_data['Confirm_Password'] firstname=form.cleaned_data['Firstname'] user=User.objects.create_user(username=User_name, password=Password,email=email,first_name=firstname) user.save(); insert = Profile(image = request.FILES['picture'], user_id=request.user.id) insert.save() return redirect('/') else: form = Register() return render(request,'register.html',{'form': form}) #forms.py class Register(forms.Form): Email = forms.EmailField(widget=forms.TextInput(attrs= {"class":"inputvalues"})) Username = forms.CharField(widget=forms.TextInput(attrs= {"class":"inputvalues"})) Password = forms.CharField(widget=forms.PasswordInput(attrs= ({"class":"inputvalues"}))) Firstname = forms.CharField(widget=forms.TextInput(attrs= {"class":"inputvalues"}),max_length=30) Lastname = forms.CharField(widget=forms.TextInput(attrs= {"class":"inputvalues"}),max_length=40) Confirm_Password = forms.CharField (widget=forms.PasswordInput(attrs=({"class":"inputvalues"}))) Image = forms.ImageField() def clean_Email(self): if validate_email(self.cleaned_data['Email']): raise forms.ValidationError("Email is not in correct format!") elif User.objects.filter(email = self.cleaned_data['Email']) .exists(): raise forms.ValidationError("Email aready exist!") return self.cleaned_data['Email'] def clean_Username(self): if User.objects.filter(username = self.cleaned_data['Username']).exists(): raise forms.ValidationError("Username already exist!") return self.cleaned_data['Username'] def clean_Confirm_Password(self): pas=self.cleaned_data['Password'] cpas = self.cleaned_data['Confirm_Password'] if pas != cpas: raise forms.ValidationError("Password and Confirm Password are not matching!") else: if len(pas) < 8: raise forms.ValidationError("Password should have atleast 8 character") if pas.isdigit(): raise forms.ValidationError("Password should not all numeric") <!-------register.html> {% extends 'layout.html' %} {% block content %} <div class="box"> <h2> <center>Register</center> … -
How to return a html page when user send a post request in Django Rest framework
i want to return a HTML page with value posted posted by user in django restframework Model i have created is class DetailView(viewsets.ModelViewSet): queryset= Detail.objects.all() serializer_class = DetailSerializer @action(methods=['GET'],detail=False) def get(self,request): first_name= request.POST.get("first_name") last_name = request.POST.get("last_name") return redirect ('index.html/') url: router = routers.DefaultRouter() router.register('detail',views.DetailView) index.html: {{first_name}} {{last_name}} i want to automatically return a html page with value posted by them -
How to change schema per request with Django & Oracle?
I need to find some way to change schema per request on Django & Oracle. is there any way ? thanks -
How to separate 2 signals in one handler in Django
Question is – is it possible in the handler function specified bellow distinguish a situation when it receives post_save or post_delete signal accordingly. I mean in general, but not by implicit characteristics like presence or lack of ‘created”, for example. I can divide 2 signals into 2 handlers, butt it would be less convenient... @receiver([post_save, post_delete], sender=Article) def invalidate_by_Article(sender, instance, **kwargs): show_by_heading_page_url = reverse('articles:show_by_heading', args=(instance.foreignkey_to_subheading_id,)) article_content_page_url = reverse("articles:detail", args=(instance.foreignkey_to_subheading_id, instance.id)) article_resurrection_url = reverse("articles:resurrection") main_page_url = reverse('articles:articles_main') urls = [show_by_heading_page_url, article_content_page_url] if not instance.show: urls.extend([article_resurrection_url, main_page_url]) if kwargs.get("created"): urls.append(main_page_url) list(find_urls(urls, purge=True)) -
Production build fails on `RUN npm install && npm cache clean --force` step
Running docker-compose -f production.yml build fails at Step 4/36 : RUN npm install && npm cache clean --force. It complains that "npm WARN deprecated set-value@2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version." I've had a look at what depends on set-value and it looks like there's 3 or 4 packages that require it. Running this on local.yml warns but does not fail to build. -
Django Serlizing multiple foreginkey related models
I am having trouble in showing cross relation data in my api end-point this is my serlization class: class ArticleSerializer(serializers.ModelSerializer): # these two variables are assigned coz, author and category are foregin key author = serializers.StringRelatedField() category = serializers.StringRelatedField() class Meta: model = Article fields = '__all__' Above serialization working fine but not satisfy needs. And this is my models from django.db import models import uuid class Organization(models.Model): organization_name = models.CharField(max_length=50) contact = models.CharField(max_length=12, unique=True) def __str__(self): return self.organization_name class Author(models.Model): name = models.CharField(max_length=40) detail = models.TextField() organization = models.ForeignKey(Organization, on_delete=models.DO_NOTHING) def __str__(self): return self.name class Category(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name class Article(models.Model): alias = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) author = models.ForeignKey(Author, on_delete=models.CASCADE, related_name='author') title = models.CharField(max_length=200) body = models.TextField() category = models.ForeignKey(Category, on_delete=models.CASCADE) this is my views: class ArticleSingle(RetrieveAPIView): queryset = Article.objects.all() serializer_class = ArticleSerializer lookup_field = 'alias' and currently my end-point showing like these but i dont like it: HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accept { "alias": "029a4b50-2e9a-4d35-afc6-f354d2169c05", "author": "jhon doe", "category": "sic-fi", "title": "title goes here", "body": "this is body" } I want the end-point should show the data with author details like, author, organization_name, contact, etc if you dont …