Zinu
Rup
Sorry sorry I am getting record by id only
Rup
I want to get it by other value
Tapdiq
Hello everyone, did anyone use dj-rest-auth? I have a few questions ..
Doragonsureiyā
Hello everyone, did anyone use dj-rest-auth? I have a few questions ..
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z"
Just ask about your problem directly! With ~90,000 people here, the probability that someone will help is pretty high.
How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Tapdiq
ok sorry, I use dj -rest -auth and I want to be redirected to another page after a successful login to another page, namely to another html
b
Forbidden (CSRF token missing or incorrect.): /follow/ [25/Mar/2021 20:19:07] "POST /follow/ HTTP/1.1" 403 2513
b
b
this is codr
Enigma
Kundan
Alda
Ghorz
Mr
I m new in python any guidance how to learn it to make website
Mr
Vandana
Hello everyone please .. how Create API for logo replacement through admin panel.
Doragonsureiyā
âshîsh
Anonymous
Can some one help me in the below requirement...1. I am executing some shell script in server machine from django...but the control is not coming back till it completes the execution...? But I want the control back after triggering the script
âshîsh
Idk
My login form pops up as a #login url when clicked on "login" button (which is present in the base template, so can be clicked from any hrl path). How do I POST the form data from any url and redirect it to the one the user is currently on.
PS - I am not using any django drfault form objects.
Example -
.../blog/#login
.../shop/#login
.../#login
Anonymous
Anonymous
Ok
Anonymous
Thanks...Ashish
Vandana
Vaibhav
Vishnu
How internationalization and localization in Django rest framework with simple steps can anyone help me out with this
Vishnu
Translation of language in rest framework I'm not using any models
Marcos
hello people, i'm very new on django, and I have a question with the configuration of the URLS .. how can I make a url for a referral system? I currently have a createview with a working formset in which I save two forms in a single POST, but I would like to have a special parameter such as url.com/referral/123123, in which 123123 it the ID of a register client
Ahmed
so - just read this error
Ashutosh
Hey guys,
I have one use case,
Let's assume we have a big project contains 20 plus apps...
So,
As apps increases it's hard to manage order of their context_preprocessors,
Middlewares.
So is it good idea to use weighted middleware, context....,
And then generate actual middleware list order-wise.
Ashutosh
⁉
~~~
i have 3 modules in my project..superuser, manager and customer...i created default UserCreation form and added all of the three in sam django.auth model...Now i need to check each of them ...is manager or not??...how to add new field to the default model??
Ashutosh
1) you can access via user_obj.manager, user_obj.superuser etc...
Or you can create decorators for views level access.
2) Create another user model and inherit django default user model. And remap everywhere ( that's the only way)
Shanks
How to return multiple functions
def A:
return self.send(), self.call()
Is it possible?
Pavel
Are there any pre-built csv django csv package to convert DRF model to csv by request via the same DRF?
#!/bin/sh Inَactive
Shanks
Shanks
Not using self here can cause problem
#!/bin/sh Inَactive
Shanks
def func1():
print("hello")
def func2():
a="hello"
return a
def f():
print ("Hello, Dcoder!")
return (func1,func2)
Shanks
What's wrong here nothing is getting printed
~~~
Shanks
âshîsh
AceT0ne
I am having some issues regarding css
AceT0ne
Like my half css is loading
AceT0ne
But the other parts it isn't
Vishnu
Guys how do we translate the contents in django rest framework can anyone help me with this
Renad
Neo
Hi I have nested serializer, how can i filter data based on column value, below is the serialier
class GetChildDataSerializers(serializers.ModelSerializer):
supporters = EventSupportedSerializer(source='eventsupportedby_set',
# source=EventSupportedBy.objects.filter(bl_status=True),
many=True, read_only=True)
partners = EventPartnersSerializer(source='eventpartners_set', many=True, read_only=True)
associates = AssociationSerializer(source='eventassociation_set', many=True, read_only=True)
speakers = EventSpeakersSerializer(source='eventspeakers_set', many=True, read_only=True)
media_partners = EventMediaSerializer(source='eventmediapartner_set', many=True, read_only=True)
exhibitor = ExhibitorSerializer(source='eventexhibitor_set', many=True, read_only=True)
dynamic_entries = EventDynamicMasterEntriesSerializer(source='eventdynamicentriesmaster_set', many=True,
read_only=True)
class Meta:
model = EventDetails
fields = '__all__'
hi any suggestions on this, currently i found this solution, but there must be a better way to do this:
class FilterDeleteListSerializer(serializers.ListSerializer):
def to_representation(self, data):
data = data.filter(bl_status=True)
return super(FilterDeleteListSerializer, self).to_representation(data)
and calling "list_serializer_class = FilterDeleteListSerializer" in meta class of the serializer.
NIDESH
Class 'post' has no 'object' member pylint(no-member)
Any idea?
Shubham
Sparsh
I want to make a doctor appointment system with django, any help or resources would be appreciated!
Tukhtamurod
AceT0ne
can some one check my repo as only half css is working
AceT0ne
https://github.com/sarthakpant772/Brute-force-website
Enigma
cccc
When I use FFMPEG to push data to HTTP, I cannot get it in real time. I can see it when FFMPEG stops. What should I do to see it in real time?
Neo
how can i save inmemoryupload file to static directory, i am not able to read the file.
AceT0ne
cccc
cccc
So what about your code
Neo
So what about your code
class MasterEventAdd(APIView):
def post(self, request):
from PIL import Image
register_data = None
try:
register_data = json.loads(request.data.get("value", None))
file = open(request.data['file'].file).read()
# file = request.data.get('file', None
# body = base64.decodebytes(request.data['file'].file)
# file = Image.open(BytesIO(body))
# file = type(f) #.file).read()
serializer = MasterEventSerializer(data=[register_data], many=True)
if serializer.is_valid():
serializer.save()
ids = [serializer.data[i]['id'] for i in range(len(serializer.data))]
return Response({"success": "created successfully",
"id": ids, "file": type(file)
})
return Response({"err": serializer.errors, "file": type(file)}) # , status=status.HTTP_400_BAD_REQUEST)
except Exception as e:
return Response({'error': str(e)})
cccc
file_name = request.FILES.get("file", None)
cccc
file = request.FILES.get("file", None)
cccc
Do you want to modify the uploaded avatar
-
Any good resources /courses to start django?
Doragonsureiyā
Any good resources /courses to start django?
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
cccc
no i juts want to save it to static directory
def post(request,):
ser = MasterEventSerializer(data=request.data)
if not ser.is_valid():
return Response(**)
user_object = models.Users(**ser.validated_data)
user_object.save()
cccc
Will he help us verify the file?
Neo
cccc
https://stackoverflow.com/questions/56737815/how-to-save-file-in-django-rest/56747770