Lalit
Lalit
مريم خالد
How I populate the social account provided by allauth to my custom user model. with social applications Google for a flutter application with allauth + dj_rest_auth. since i only get the token from google social auth , how can i get the other field in my custom user when the user log in using google
Careful
Careful
and in your forms.py
you should add classes and style for the fields
Afshin👀
Careful
Ok thanks
https://simpleisbetterthancomplex.com/tutorial/2018/11/28/advanced-form-rendering-with-django-crispy-forms.html
Careful
look at this
Careful
I had some issues with crispy now using django widgets tweak
Aby
I am making a chatbot , need to scrap data from FAQs of the same website and return as replies to bots
Is it possible ( getting error as both webpage and django is using same port for running)
Suryo Adhy Chandra
Postgresql
i think it depend on your pc that used to serve the database.
if you have low RAM and serve thousands data, it will be leaking.
The Inspired
Lalit
Anyone have any idea
Web developer
Web developer
Suren
Hi everybody, please help to solve, when I enter command
django-admin makemessages -l en -e html
get below error message
CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
Charly
Suren
And have you tried to do what the error says?
yes. when I tried command "pip install gettext" it gives me another error "ERROR: Could not find a version that satisfies the requirement gettext (from versions: none)"
"ERROR: No matching distribution found for gettext"
Mohammad Hossein
Hi everyone
I want to deploy a project on a server.
Do you have any instruction for it?
Is runserver command enough?
Mh
Suggest a youtube tutorial for learning django rest framework
Bekhruzbek
Learn how to upload a video for a movie website
Mohammad Hossein
.
In serializers.py file I'm getting an error in 1st line. "import rest_framework could not be resolved". Any suggestions on this ? How to solve this error ?
Mirco
.
.
Issue resolved. It was showing error bcz of virtual env.
Mirco
Mohammad Hossein
What is the main different between APIView and a normal djago view?
Mohammad Hossein
cj
What if we use them as each other?
you can, but that's nonsense, you can wear pants on your arms, right? yes you can, but is it worth to do that? does it make sense? no right, that you can do things doesn't mean that you should do them
Jairaj
Jairaj
I think he meant a function?
Shahzodbek
Mulünur
i take a picture with a camera and get an object like this
[
{"assetId": null, "base64": null, "duration": null, "exif": null, "fileName": null, "fileSize": 608752, "height": 4032, "type": "image", "uri": "file:///var/mobile/Containers/Data/Application/236D8E4D-C15C-47B8-8D0F-BD9BE29BC951/Library/Caches/ExponentExperienceData/%2540anonymous%252FNarniaApp-f3a3e2c5-afae-4102-a8a2-13f0b986914d/ImagePicker/5267C0FB-888D-4437-AA57-4562650A2A2E.jpg", "width": 3024}
]
after I take assets[0] - this is my picture. I think I need to send uri field to the backend.
If i try to send whole assets[0], like you said — app crashed. If i try to send assets[0].uri without field 'image' i get this error:
RESPONCE FROM POST{"image":["No file was submitted."]}
Because for a formData with file you need to 3 parameters
Mohammad Hossein
Anonymous
Mulünur
Seems like it's validation error. Can you send your full header?
my request is:
const response = await fetch(`${HOST_WITH_PORT}/api/items/`, {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data'
},
body: formData
})
const data = await response.json()
console.log("RESPONSE FROM POST" + JSON.stringify(data))
i tried to use FileUploadParser instead of FormParser (FormParser is for web, and i think my pictures from camera is raw). But no results
Anonymous
Try to send request without optional chaining
Anonymous
Anonymous
Also check type of object your camera returns
Jairaj
Your model serializer doesn't have class meta
Jairaj
Maybe you should try it from postman first
Anonymous
Anonymous
class ImageSerializer(serializers.ModelSerializer):
image = ImageField(
max_length=None, use_url=True,
)
class Meta:
model = Image
fields = ("id", 'image', 'owner', 'time_created', )
Brutus
i started learning channels but getting error in setting up websocket connection, tried google n all but no help
WebSocket connection to 'ws://127.0.0.1:8000/ws/' failed:
this is what i'm getting in console, checked all settings i know about no help
Mulünur
class ImageSerializer(serializers.ModelSerializer):
image = ImageField(
max_length=None, use_url=True,
)
class Meta:
model = Image
fields = ("id", 'image', 'owner', 'time_created', )
Thank you, I set max_length, but no result
class ItemsModelSerializer(serializers.ModelSerializer):
image = serializers.ImageField(use_url=True, max_length=None)
class Meta:
model = Items
fields = ('image', 'category', 'color', 'id', 'rmbg_image')
i tried just to fetch response from image uri and make it blob, but it also without luck, I get "network fail error"
Jairaj
Jairaj
Jairaj
If network error is coming, that's means there is problem with code
Jairaj
Александр
Hello, how can I get data from a table created with django models from an application without django?
when i try to get data i get an error:
django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
jūdê
I’m experiencing a “Register.__init__() got an unexpected keyword argument ‘refresh_token’” in the response body
While trying to register a user using django-graphql-auth package
Please if you’ve integrated this before, please help me out
Mulünur
I solved my problem with help of some wonderful person, who once again directed my attention to this link
Tl;dr — use base64
https://stackoverflow.com/questions/64452063/how-to-upload-an-image-from-a-react-native-app-expo-to-a-django-server
jūdê
bestmem
Can anyone recommend the django3.2 program for practice
Rohan
Rohan
3.2 was LTS if I remember correctly.
kiran
When i upload a file in django it works perfectly in local host
kiran
But in server it gives a error 500 internal server erroe on in case of large files.. is there any to upload large files without erroe
Baba
I'm trying to upload image from django admin panel in Pythonanywhere but it shows me this error.
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
I even installed pillow in my virtualenv but still not working
Nishanth Siraj
In shell, run:
pip install Pillow
Attention: PIL is deprecated, and pillow is the successor
Nishanth Siraj
From pillow import ...
Baba
From pillow import ...
Do I need to change the django default code to this?
I've already run "pip intall Pillow", still not working
Charly
Baba
But I don't have a requirement.txt file.
I just install directly
Charly
Baba
Tell me the steps plss, thanks
Om
Can anyone tell me why to drf if I can just direct submit the data using post request
Mirco