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
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
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
Naciima
https://youtu.be/9N6a-VLBa2I
this is the man am following his django series
DP
try pip install virtualenv
Thanks! It worked!
Nikolay
Thanks! It worked!
I think its another package)
snc
I think its another package)
wrapper is manager for multiple virtual env while virtual env one is standalone env
Nikolay
yes when make that it comes with error that one
I think something wrong with your json file
Raman
have you added it to django installed app
how to do it? please explain
Nikolay
snc
who needs all this when we have poetry and pipenv =)
when working with multiple local api. xd
Raman
in settings. py
what command should I write?
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', ]
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
Nikolay
added 'pillow' in the list
as i remember pillow works without it
Raman
can I send you the image personally?
snc
as i remember pillow works without it
i was banned from messaging for 5 min,why?
Nikolay
..
when you share your code here someone else could help you too, but of couse you can
Nikolay
LinuxBugs
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
Try to use python -m virtualenv "nameofenv" while creating virtual environments. The other methods have many ambiguities when you proceed further because of non standardness across platforms
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
i am old here xd
maybe bug, I just mention that it is 5 min muting
isa
around 2-3 thousand records
LinuxBugs
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 ?
If the data is fetched all at once... Then you can just do a loop and delete the double records. If it's streaming data , then you have to track double data by storing tracking index in file or memory depending on the persistence of your program and check every new record in this index file.
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
yes like this.
Anonymous
How to create sub serilizer in django REST api
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
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
LinuxBugs
Running cmd prompt as administrator worked
Even that... Is not a good idea some times. But okay it works. When you move your Django to production, you might want to go with standard procedure.
ROG 💻
How are you handling your API response and parsing it?
Ok, the API response I keep it like this
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
Andrej
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
Hi, the best way is to start :-) What do you mean with best way? What are your requirements and use cases? Would you like to build a simpler Amazon clone?
Anonymous
how can we use django rest api on django template
LinuxBugs
how can we use django rest api on django template
https://www.django-rest-framework.org/api-guide/renderers/#templatehtmlrenderer 👍
Khalil Ibnu Omar
What are requirements and Use cases ?
LinuxBugs
What are requirements and Use cases ?
https://www.youtube.com/watch?v=7b8r1eioNPY 👍
Anonymous
What are requirements and Use cases ?
I want to create a mobile app and web application(like admin panel and website)
Anonymous
https://www.django-rest-framework.org/api-guide/renderers/#templatehtmlrenderer 👍
I want to create a mobile app and web application(like admin panel and website)
Anonymous
I want to create a mobile app and web application(like admin panel and website)
i have created phone no login API and want to use same api on django template but dont know how