Harish
Arvindhan
Coding
from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
Can anyone help me solve this error I don't understand it, I'm just a beginner in django
Almaz
Anonymous
how can we keep track of video streaming progress in Django Rest Framework, when we are giving url of youtube to frontend(App).?
Azad
Hi...
All....
I am facing issue to install pip install mysqlclient
Azad
I am not able to open mysql
꧁❦ I'm Farooq ❦꧂
I have one requirement
table1:
device_mac_a -- device_mac_b
device 1. -- device 2
device 2 -- device 3
device 3. -- device 1
output:
{
device 1 :{device 2, device 3},
device 2:{device 1, device 3},
device 3:{device 1, device 2}
}
꧁❦ I'm Farooq ❦꧂
Oloba
Hey Django gurus. There is this problem I usually encounter when collecting static. At times it works at times it doesn't. And I have tried to see the difference is static folder isn't copied in the root folder. Anyone with a better solution to this?
Son
hellow am asking how can i produce 8 random digits in my model using token
Son
or uuid
Son
without repeatation
Alex
> There is this problem I usually encounter when collecting static. At times it works at times it doesn't.
That tells me precisely nothing. Is there is any error or what?
The algorithms is simple - specify STATIC_ROOT directory. Usually people set it as <project_dir>/static/, but actually you can put it wherever you want. And be sure that when you run manage.py collectstatic it has unix rights to access that dir. As well that your frontend server (usually nginx) has rights to read that dir as well
Alex
dคv¡d
i use form from ModelForm and i can add attr as what i want.. but i don't how i use that form again to use for update that field? pls help. Thank you so much
Alex
Oloba
Oloba
dคv¡d
игорь/igor
can anyone have logic for this..? thanks in advance
It looks like graph, as a data structure I mean. You could create a class for that and use it to generate whatever you want.
class MyGraph:
def __init__(self, edges=[]):
self.gdict = {}
if len(edges)!=0:
for e in edges:
self.add_edge(e.device_mac_a, e.device_mac_b):
def add_edge(self, vertex1, vertex2):
if vertex1 in self.gdict:
self.gdict[vertex1].append(vertex2)
else:
self.gdict[vertex1] = [vertex2]
def whole_dict(self):
result = {}
for key, val in self.gdict.items():
if key in result.keys():
result[key] = list(set(result[key].extend(val)))
else:
result[key] = list(set(val))
for v in val:
If v in result.keys():
result[v].append(key)
else:
result[v] = [key]
return result
devices = table.objects.all()
graph = MyGraph(devices)
graph.whole_dict()
Sorry if it is overwhelming ;) it should work though
Almaz
Hello, everyone! Is there any other way to create password reset by django and don't allow less secure in Gmail and also don't write manually only one Gmail address?
HARILAL
hi,how to make filter in django admin.i have 2 models competition and prize..i want comepetions to be filtered in prize admin.models are given below..can anyone help me
HARILAL
class Competition(BaseModel):
title = models.CharField(max_length=255)
HARILAL
class Prize(BaseModel):
competition = models.ForeignKey('competition.Competition', on_delete=models.CASCADE)
Oloba
꧁❦ I'm Farooq ❦꧂
игорь/igor
Owolabi
Is there a way I can integrate Google map to Django admin for tracking drivers location and movement on a chauffeur project? any help please.
꧁❦ I'm Farooq ❦꧂
Anonymous
is there a way to get all attributes of a Serializer field as json ?
Sanjay Krishnan
Anonymous
Anonymous
Sanjay Krishnan
here https://dpaste.org/B3oQ#L1
You can access them using _meta in model object
Modelname._meta.fields
It will return a list of those fields, loop through them and use dict method to get the value you need
Ahmed
Got it, thanks
Anonymous
Anonymous
like max_length, required, allow_blank
pat
Simple questions guyz.. I'm trying to connect signals to channels..
To I really need channels_layers to achieve it?
Mansi
I want to connect django to SQL server. Then where should I create the table in models.py OR create tables in SQL server and utilise them in django?
pat
Mansi
Want to connect to MS SQL server. Does it works for that too?
M
Hello. Im trying to debug locally websocket in django python but cannot get server logs. I can see them on heroku but not locally. Anyone have any idea how i can get debug logs of websocket?
pat
Tiago
I'm having trouble updating on django
Tiago
Can someone help me?
Saurav
SC?
Doragonsureiyā
Can someone help me?
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
Tiago
ok
Tiago
my update dynamic object passing param
Model = apps.get_model('spread_sheet', camel_case(sheet))
update = Model.objects.filter(id=data['id'])
kuzmich
Hey there guys!
I got a server running on gunicorn and there is cloudflare as proxy
I started facing CORS error when there are around 10 async requests and the page gets reloaded less than a sec
It can happen when those 10 requests are sent several times
ANY HELP APPRECIATED
UPD:
I found this in response headers on those requests that failed: expires: Thu, 01 Jan 1970 00:00:01 GMT
JavinP
Can someone please suggest a book that explains how to handle transactions and OAuth2 in Django?
Anonymous
Hi everyone! I require info on how NDArrayField is used, specifically how it can be saved in the Postgres database using forms.ModelForm, I already did it using the form.save () but I get the following error: ValueError: Cannot load file containing pickled data when allow_pickle=False. PLEASE ADVICE. THX!
Jerome
pat
игорь/igor
Amir
Hi guys. What is the difference between TestCase and SimpleTestCase? In test writing
JavinP
JavinP
HamidReza Fekri
hello , I'm learning django and my second project is e-commerce web app i finish product app and customer but I have no idea about order app how to write views in this app i hope someone can recommend me good source to study about it and also i want to use class view for this
Doragonsureiyā
Anonymous
Anonymous
guys is it ok for clients to use the django admin interface ?
Anonymous
Anonymous
i don't see why though
Gordrick
Anonymous
I need help to establish real time communication with help ot aiortc.
Charly
Wizuba
Hi is there a django's roadmap ?
Joel
Hi, does anyone know how to handle the aggregate "_id" that django does automatically in its primary keys, what happens is that I am working with an already established database, its tables have the id field and the foreign ones id_table1
And when I want to call objects.select_related (id_table1) I get an error that the name id_table1_id is not valid, since django adds it automatically
Does anyone know how to control that aggregate, or how to make django skip that in the DB
Thanks in advance