Naciima
am trying to load json file into django shell
Anonymous
I have a post detail page where I want to show single post as well as comments but how can I pass two querysets one for post and another for comments in a single class inherited from views.generic.detailview
Naciima
JSONDecodeError: Expecting value: line 1 column 1 (char) codes seems to be okey its my first time to load json file into manage i thing its idenatation issue tried to fix it issue is still there
snc
DP
I started with pip install virtualenvwrapper-win
The error was: couldn't install packages due to an environment error: [WinError2] the system cannot find the file specified
Nikolay
Naciima
snc
DP
Also, my pip version is 19.2.3
On Using command python -m pip install --upgrade pip
The error is: could not install packages due to environment error: access is denied
snc
DP
DP
Yusuf
Nikolay
Engnr
Raman
Nikolay
snc
snc
snc
what command should I write?
you don't need command.... just browse down until u see a list
like this
INSTALLED_APPS=[
'example app',
'example app 2',
]
Raman
Nikolay
yes I did..
did you type there name of your application?
snc
added 'pillow' in the list
snc
and share your that list here
Raman
Raman
can I send you the image personally?
Raman
Nikolay
snc
Nikolay
..
when you share your code here someone else could help you too, but of couse you can
Nikolay
snc
snc
Nikolay
isa
Hello guys. I am fetching data from another system and There are some double records. Is there a easy way to delete these double records ?
Nikolay
isa
around 2-3 thousand records
isa
isa
There is no special django library function.
Nikolay
around 2-3 thousand records
for i in ModelName.objects.all():
if ModelName.objects.filter(i.duplicated_field).count() > 1:
ModelName.objects.filter(i.duplicated_field).first().delete()
maybe something like this?
isa
isa
yes like this.
Anonymous
How to create sub serilizer in django REST api
DP
ROG 💻
Hello everyone, because when I try to show the response of an API response I get this message?
Sai
Hi
I'm tried to upload Base64 data to s3 using boto3. File getting saved into s3 bit it says unsupported file format after I download it. Help required
ROG 💻
string indices must be integers"
ROG 💻
in the shell without problem it shows me the message
ROG 💻
(env) PS C:\Users\Luomo\Desktop\SAP\AppWeb> python .\manage.py shell
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import json
>>> imaginary_response = {
... "error": {
... "code": -5002,
... "message": {
... "lang": "en-us",
... "value": "Cash amount must be positive "
... }
... }
... }
>>> response = json.dumps(imaginary_response)
>>> response = json.loads(response)
>>> response["error"]["message"]["value"]
'Cash amount must be positive '
>>>
Presence
Hi all I'm using dj rest auth
LinuxBugs
Presence
How can I use social authentication in it
Presence
I'm not able to understand method given in the documentation
Presence
Create new view as a subclass of dj_rest_auth.registration.views.SocialLoginView with FacebookOAuth2Adapter adapter as an attribute:
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter from dj_rest_auth.registration.views import SocialLoginView class FacebookLogin(SocialLoginView): adapter_class = FacebookOAuth2Adapter
ROG 💻
ROG 💻
response_dict = json.loads(response)
ROG 💻
and testing from the interactive shell I can access the property "value"
ROG 💻
(env) PS C:\Users\Luomo\Desktop\SAP\AppWeb> python .\manage.py shell
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> imaginary_response = {
... "error": {
... "code": -5002,
... "message": {
... "lang": "en-us",
... "value": "Cash amount must be positive "... }
... }
... }
>>> response = json.dumps(imaginary_response)
>>> response = json.loads(response)
>>> response["error"]["message"]["value"]
'Cash amount must be positive '
ROG 💻
but when trying to show only the message in an alert this message comes out
ROG 💻
string indices must be integers
Khalil Ibnu Omar
Hi everyone,
I need suggestions for the best way to build a multi vendor e-commerce using drf in backend and Vue js or another in frontend
Anonymous
how can we use django rest api on django template
Khalil Ibnu Omar
Khalil Ibnu Omar
What are requirements and Use cases ?
Anonymous