Malik
TypeError at / 'builtin_function_or_method' object is not iterable Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.10 Exception Type: TypeError Exception Value: 'builtin_function_or_method' object is not iterable Exception Location: C:\Users\user\dev\cfehome\lib\site-packages\django\template\context.py in init, line 18 Python Executable: C:\Users\user\dev\cfehome\Scripts\python.exe Python Version: 3.7.2 Python Path: ['C:\\Users\\user\\Dev\\cfehome\\src\\cfehome', 'C:\\Users\\user\\dev\\cfehome\\Scripts\\python37.zip', 'C:\\Users\\user\\dev\\cfehome\\DLLs', 'C:\\Users\\user\\dev\\cfehome\\lib', 'C:\\Users\\user\\dev\\cfehome\\Scripts', 'c:\\python37\\Lib', 'c:\\python37\\DLLs', 'C:\\Users\\user\\dev\\cfehome', 'C:\\Users\\user\\dev\\cfehome\\lib\\site-packages'] Server time: Thu, 21 Feb 2019 00:04:08 +0000
Malik
this is the error
Malik
Windows is horrible
ohk.. but atm that is what im using bro
cj
that's why I don't use Windows, you don't have the flexibility you get in Linux 🤷🏻‍♂
Krishna Praneeth
Chen
I want ask how to send a delay task to celery using redis when the django app and celery in different programs
Chen
task.delay(*args)
I knew this,but my situation is my django website and celery task in different coding workspace.
Blue🦋
I knew this,but my situation is my django website and celery task in different coding workspace.
setup your celery with your django app server via redis server to working celery and django working together
007
How to add js in views.py
007
I want to take value inside input type in html using it's id/class
007
And search that value in db using views.py
007
Using filter
Mirco
and pass that value to your view
007
How to use js in template
George
Well, you can but you should not
007
So is there any method to get input value from template and search that value in DB
George
learn what views are
007
no, you do that in the DOM
Suppose Var temp = Document.getElementById("data").value And i want to pass temp to views.py
George
:)
007
Actually i don't have much knowledge about ajax... If you tell me exact method it will be helpful for me
George
This is only at client layer affecting Javascript so it's somewhat offtopic
007
Just like in view.py :- result = request.Get.get("data")
George
If your views are ok, you just have to work in learning how to use fetch api
007
Ok.. thanks ✌️✌️
Marcos
Hi o/. How can i change the default Django admin when I use "SimpleFilterList" to not show the "all" option?
Anonymous
Hi o/. How can i change the default Django admin when I use "SimpleFilterList" to not show the "all" option?
You have to first create a super user using this command : python manage.py createsuperuser
Anonymous
Be careful that you are in the same directory that have manage.py
Anonymous
After that put username email and password
Anonymous
Login in the admin by using this and in admin dashboard u can found users in there is your created user you can also add more than 1 user
Abel
Hello guys I am beginner for django is it safe to use bitnami django stack for django development
Patricia Franco
Hi! How can I create a seed for some tables that not change using insert command?
Marcos
You have to first create a super user using this command : python manage.py createsuperuser
https://imgur.com/gallery/MN0lKXq and the code https://dpaste.de/x8NR#L1,3,5,8
Marcos
"all"="todos" in portuguese
Marcos
I need remove or put this default field last. 😥
Mirco
https://imgur.com/gallery/MN0lKXq and the code https://dpaste.de/x8NR#L1,3,5,8
By overriding value() method , you should manage a default value
Baruc
Can I please, know why Django rest framework is not showing (it don't even exist in the rendered data) on rest framework routers. It is in a ModelSerializer. I specified the id field in the fields. Here is file content
Baruc
from rest_framework import serializers from campagne1.models import Ecouteur, Jour class EcouteurSerializer(serializers.ModelSerializer): class Meta: model = Ecouteur fields = ('id', 'nom', 'prenom', 'contact', 'date_naissance') #class Meta: # model = Ecouteur # fields = ('id','nom', 'prenom', 'contact', 'date_naissance') class JourSerializer(serializers.ModelSerializer): class Meta: model = Jour fields = ('date', 'numero')
Francis
Hello people, I am working on rest framework api... Anyone please guide me to material on how i should implement JWT....
Baruc
Hello people, I am working on rest framework api... Anyone please guide me to material on how i should implement JWT....
you can find help by searching for the Youtube channel Just Django. The have an implementation there with React for the front-end. Hope it help !
Francis
Followed it, doesn't show concept of user registration and login
Francis
It ddnt answer me
Mirco
Followed it, doesn't show concept of user registration and login
https://wsvincent.com/django-rest-framework-authentication-tutorial/
Francis
Thank u Mirco... Let me check it out
Mirco
Baruc
Followed it, doesn't show concept of user registration and login
https://www.youtube.com/watch?v=BxzO2M7QcZw&list=PLLRM7ROnmA9FxCtnLoIHAs6hIkJyd1dEx&index=3
Baruc
Followed it, doesn't show concept of user registration and login
https://www.youtube.com/watch?v=wupTjPTvovI&index=5&list=PLLRM7ROnmA9FxCtnLoIHAs6hIkJyd1dEx
Baruc
Thank u Mirco... Let me check it out
Afer you try the two links above too!
Francis
I can just use rest_framework.authtoken !!? Does it have any advantage to over jwt... or which is better!!?
.
I can just use rest_framework.authtoken !!? Does it have any advantage to over jwt... or which is better!!?
Plain token is immutable. If someone gets your token - you hacked. JWT expires so it is better for security
Mohamed
But you still need to active content security policy (CSP) so that they can't still the toke using javescript
Malik
You tried to loop over an object which can't be iterated.
oh yeahh so @ Ghorz Ace how do I solve this problem...
Izzati
hi, i want ask question about django rest framework . im new to DRF. i have problem with log in django rest framework . it happen when i add REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.TokenAuthentication', ),
Izzati
i cant log in as user .
Izzati
when i delete the authentication class it works
Izzati
i want to add token authentication
Izzati
using command i can generate token . it just log in have problem
Izzati
sorry for my bad english
.
Place your token in request header
.
Authentication: Token <your_token>
.
And optionally don't use tokenauth alone. Add also sessionauth. This is is my code snippet 'DEFAULT_AUTHENTICATION_CLASSES': (         'rest_framework.authentication.TokenAuthentication',         'rest_framework_jwt.authentication.JSONWebTokenAuthentication',         'rest_framework.authentication.SessionAuthentication',         'rest_framework.authentication.BasicAuthentication',     )
Izzati
THANK YOU
Izzati
😭thanks
Izzati
i add session auth and its works
inchidi
i add session auth and its works
that doesnt mean your token auth works tho