Eng_Salah Aldin Alhaj
ok but i don't know how to use environment variable with json file
Eng_Salah Aldin Alhaj
if you have example or post please share it with me
cj
if you have example or post please share it with me
here read this: https://github.com/joke2k/django-environ
Eng_Salah Aldin Alhaj
i know about this but google credtinal use json file
Erick
i know about this but google credtinal use json file
encode it as base64, put that value into a env var, read it from django and decode it there
Eng_Salah Aldin Alhaj
https://imgbox.com/gallery/edit/hpFM67ueaN/B8k3E76ZParMHfF7
Eng_Salah Aldin Alhaj
https://imgbox.com/gallery/edit/hpFM67ueaN/B8k3E76ZParMHfF7
google credtinal not like secret key . because its required file json
Eng_Salah Aldin Alhaj
this my first time to use .env with this type
cj
i know about this but google credtinal use json file
django-environ can read json values too ¯\_(ツ)_/¯ https://github.com/joke2k/django-environ/blob/main/environ/environ.py#L260
Eng_Salah Aldin Alhaj
if you give me simple example
cj
if you give me simple example
I guess you should first start learning basic Python
cj
¯\_(ツ)_/¯
Eng_Salah Aldin Alhaj
i swear already know about environment variable but i have't any ideas how to passing json to environment variable
Eng_Salah Aldin Alhaj
i have't basics google service
Eng_Salah Aldin Alhaj
ok what the next
Charly
ok what the next
nothing you should have it to be used
cj
ok what the next
learn Python, for sure that's your next step
Eng_Salah Aldin Alhaj
nothing you should have it to be used
https://imgbox.com/xNUePCNG
Eng_Salah Aldin Alhaj
if is only required Norma variables is not problem but the required is credtinal object
Tipu
Hey guyzz, Can you tell me how to register django custom filter/tags?? I have followed all steps but not working
Eng_Salah Aldin Alhaj
👆🏼👆🏼
my friend this is first time i use Google service you have lot experience about this things so you say every body hasn't same your experience hasn't learned Python
Charly
https://imgbox.com/xNUePCNG
So you code has a way to load the values from the env? the keys that is searching are the right ones?
Eng_Salah Aldin Alhaj
Eng_Salah Aldin Alhaj
So you code has a way to load the values from the env? the keys that is searching are the right ones?
I have no idea where to start Because it's the first time I deal with Google services
Charly
I have no idea where to start Because it's the first time I deal with Google services
so, have you checked the documentation of firebase on how to pass credntials?
Eng_Salah Aldin Alhaj
Charly
I just found how to use it from json file
and why do you wanted to use env vars then?
Erick
you have to put the json content into a env variable, then read id and parse it as json
Eng_Salah Aldin Alhaj
you have to put the json content into a env variable, then read id and parse it as json
do you mean like this: test={"key1":"blablabla"}
Erick
cat credentials.json | base64 # copy this value i export GOOGLE_CREDENTIALS={value_from_before} # in python GOOGLE_CREDENTIALS = json.loads(base64.decode64(os.environ.get(“GOOGLE_CREDENTIALS”))) something like that
cj
ok but when push project to GitHub Where will the keys come from?
and you said you know about environment variables ¯\_(ツ)_/¯
Erick
ok but when push project to GitHub Where will the keys come from?
you won’t need that credential in GitHub, that shuold be loaded when you deploy your app, and it will depends on how the deployment it’s gonna be
Eng_Salah Aldin Alhaj
and you said you know about environment variables ¯\_(ツ)_/¯
My friend, I'm a beginner if I wasn't, I wouldn't bother anyone in the group
Erick
what method? 🤔
Eng_Salah Aldin Alhaj
no no problem i will try your advice
Eng_Salah Aldin Alhaj
Thank you very much. Your advice helped me a lot. I will try it. Thank you for your time @erickgnavar
Kirill
Hi, everyone! Which library I shoud use to make search field with autocomplete?
Blockchain
Hello everyone. I have one problem. When I use gunicorn to serve django project, async orm query doesn't work. Could you let me know how to fix this issue?
Kirill
Kirill
Yeah!
Thank you.
S
Hello everyone I am working on one folder but when I'm trying to import something it's showing me error
Ana
Hello everyone Please I'm try to deploy my Django project offline for my client to be able to run it on his PC without installing Python. How should I go about it?
S
For example in django I created one project then create one app by "django-admin startapp newapp Then i go in newapp folder where I have python file urls.py where I want to use "from newapp import views" But it is showing me redline bottom of newapp folder
Mahmood
Hi everyone I'm trying to get the last element of a queryset in template I saw that we can't use the "last" filter because it's for the lists not querysets So i used the last method of the queryset {{q_list.last}} But sometimes strange here the last method give me the first element as the first method does Can anybody explain Thanks
Mahmood
I even tried to put a break point And i print the queryset and it's more than one item And the last and first methods give the same output using the debug console
Mahmood
There us method called latest I used latest("id") in the debug console and it gives the right answer But i wanted an explain why the last method gives wrong answer
Mahmood
I found the problem, i don't know if this is a bug or not my queryset was with order_by("display_order") and all the list display_order value were 0 It's strange it gives the same value in first and last methods Does not make sense Thanks everyone Sorry for long messages
Dembe
IntegrityError at /create work/ el valor nulo en la columna «fecha_nacimiento» de la relación «persona» viola la restricción de no nulo DETAIL: La fila que falla contiene (9, , null, f, , , , , f, t, 2022-10-20 23:12:26.457138+00, , null, F, ). Request Method: POST Request URL: http://localhost:8000/create%20work/ Django Version: 3.2.9 Exception Type: IntegrityError Exception Value: el valor nulo en la columna «fecha_nacimiento» de la relación «persona» viola la restricción de no nulo DETAIL: La fila que falla contiene (9, , null, f, , , , , f, t, 2022-10-20 23:12:26.457138+00, , null, F, )
Dembe
Yu are sendind a null value for fecha_nacimiento
no no, estoy enviando el formulario con todos los campos llenos. Pero lo que mas me preocupa es q el error me aparece en otro formulario que no tiene nada q ver con eso
Ana
deploy on pythonanywhere.com
It's unreachable
Ana
Okay it's working
Issue
cool
Maxim
https://t.me/django/226511
Rohan
Now it's working, I just added the root path from directory in static dir
S
Use this: from . import views
I tried it's not working
Doragonsureiyā
Do you want to hire someone?
Ritwik
how can I permanently change the configured language for html from django html to emmet html?
aRi
I tried it's not working
If you are in newapp's urls.py and you want to import newapp's views.py into that It's the way to import
Mohammad
Hi guys i have a question about postman. Is it good to be learnt while i'm working with api or later?