Doragonsureiyā
pls how do i share via paste bin?
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
k
Better to share code via pastebin or similar
https://github.com/graphql-python/graphql-ws This is the library. the subscription example works perfectly fine. but when i try an alterd version of it, it doesn't work at all
Артем
How made widgets in admin dashboard with metriks and sentry issues?
Breeze
you user table has no filed/column called phone number
This is my views.py https://dpaste.org/DPNQ
k
Share your code I don't care about the library now
https://pastebin.com/PL5Efv32 This is my code. Please do let me know. any and all help is appreciated.
Nisis
I am trying my to integrate tincymce with django but when I try to upload an image.i get "Forbidden (CSRF token missing or incorrect.):/media/ . It is sending a post request as seen from the terminal. How do I fix this? Searched online but I didn't get any resolution
Nisis
With {%csrf_token%}
I'm not using forms.... integrating it in the model so I can use it from admin
priyanka
In django music app there is a bug when I click to favorite it star marked but when I unclick it is showing favorite then also. How to resolve this please anyone help me out
William
In django music app there is a bug when I click to favorite it star marked but when I unclick it is showing favorite then also. How to resolve this please anyone help me out
Use .exists() when adding to favourites. Also, check If you are implementing the correct API for adding to favorites and removing from favorites functionality.
mAXY
I just got he project on backend authentication in that i need to use username, email & otp authtication but i'm bit confuse that what authentication and permission i need to set and where to set on drf or on django
k
It's locked
can you please check now again if you don't mind https://pastebin.com/PL5Efv32
Gaurav
How to avoid m2m alter field error while altering a pre existing field
Gaurav
What i want to do is add a through model to an existing field but it gives me error
Gideon
Hi all! who has a resource, book or channel that details django orm optimization? thanks
Mani
Hello, If I query database from one VM in local, and with same ip as local (127.0.0.1), will it be accepted by django ORM ?
Valter
Hi, I hope that someone can help me with a filter. I have a table TASK(that is user related as one to many) and the active user(not own the task) want send a email for a task creator (in order to get more information about the task), so I need filter Task.user.id and get the email for that user in order to communicate to then. I hope this makes sense so please help. here is the code https://dpaste.org/aNWT
Valter
are talking about line 2 or 3 in the code?
k
can you please check now again if you don't mind https://pastebin.com/PL5Efv32
@pyflare if you dont mind i'd really like you opinion and direction on this
Mirco
@pyflare if you dont mind i'd really like you opinion and direction on this
The code is really confused, my strongly suggestion is to take a course about Django and GraphQL and play more
Valter
First lines
how can I achieve that, what I'm doing wrong? eg.(email=request.id.email)
Mirco
how can I achieve that, what I'm doing wrong? eg.(email=request.id.email)
You are not using your Task model at all You talked about a TASK table so I suppose you have a Task model
Valter
yes, but the email comes from user table(where all user are), this is why it is a bit hard as I need filter the email based on task table user_id.
λ701
How to loop over two django queries at once? i want to loop over two django queries at once i have tried zip function from python and passing that as context but the query does not show up fully in the rendered html
Mirco
yes, but the email comes from user table(where all user are), this is why it is a bit hard as I need filter the email based on task table user_id.
The task table has the user as relationship Based on what you said You can filter it directly Study better hoe Django models work You are a lot confused
Ixlos
hello every one i have employee model(last name, addrress, ....) attendance model (employee=FK, type=choice(in, out), when=datetime) for example employee model 1 | Piter | Vlahoski| 2 | Donny | Pet| .................. attendance 1 | 1(employee id) | 1(in) | 2021-10-21 08:13:00 2 | 1(employee id) | 1(out) | 2021-10-21 10:15:00 3 | 1(employee id) | 1(in) | 2021-10-21 12:13:00 4 | 1(employee id) | 1(out) | 2021-10-21 15:00:00 5 | 2(employee id) | 1(in) | 2021-10-21 15:28:00 ............................................. and how can i get total hours by day every employee?
H
File "/home/hira/PycharmProjects/cms1021/cms/django/db/migrations/loader.py", line 200, in build_graph self.load_disk() File "/home/hira/PycharmProjects/cms1021/cms/django/db/migrations/loader.py", line 99, in load_disk directory = os.path.dirname(module.file) File "/usr/lib/python3.8/posixpath.py", line 152, in dirname p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType
H
can anybody help y I am getting this
Valter
amazing , thank you guys.
͏
Should the default generated settings.py file be pushed to public repo without secret key (i.e. replaced with env variable) or completely added to gitignore?
Shiddharaj Sinh
Hello friends i am reading django i have created a django models and in that i have asked the user for his name and password and then i have created a model form of that models and sent that model form to my template and from there the user's The data is taken and stored in the database. So I want to create a second login form and if the username or password entered by the user is correct then I want to send it to another page.
muzzammil
Any pdf of django book available..
Maxim
Should the default generated settings.py file be pushed to public repo without secret key (i.e. replaced with env variable) or completely added to gitignore?
you'll have to decide for yourself there are pros and cons for all options better to use split settings IMHO
Doragonsureiyā
Any pdf of django book available..
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
fateme
Does anybody know how I should write the django admin onetoone relation inline ?
♈
Django models in we can perform a soft delete action on foreign key field related data?
William
Django models in we can perform a soft delete action on foreign key field related data?
You can have an is_active boolean field for soft deleting the data. Set the default as False for is_active and In query filter by is_active=True
♈
You can have an is_active boolean field for soft deleting the data. Set the default as False for is_active and In query filter by is_active=True
Thanks, so I can take is_delete = True it's remove from my temporary page, but data also show in database as well as
William
Thanks, so I can take is_delete = True it's remove from my temporary page, but data also show in database as well as
Yes. Set the default is_delete value as False. In queryset filter the data by is_delete=False. It will exclude the soft deleted datas
♈
Yes , just by excluding them from the qs via exclude ()
Okk, so we also use some third party packages like soft manager
Mirco
Okk, so we also use some third party packages like soft manager
Nah, you don't need any 3rd party package
Mirco
It's just an attribute inside your models You can just create an abstract one and use it with every model you wanna soft delete
♈
I have one user form, but django Usercreatiinform in one email in unique save But I want user can add one to more then email address save and His also do any email address set primary from his profile And all emails address store uniuqe So, how to do this ?
Patya
How to get data without using nested serializer
old
Hello guys I'm trying to my pipefile using pipenv lock but I keep on get this typeerror: resolve_deps get an unexpected keyword argument 'verbose' How can I fix this?
Jaya
Hello guys can anyone tell me how to send msg id in websocket
Morteza
How to get data without using nested serializer
if you want to get relational data you must use nested serializer, it is easier and efficient
priyanka
This is my code for django music app where I need to tick ✔️ favorite song but there is a bug that when I am adding fav song star marked but when I am selecting it is showing. So where I should use exists() and which api. Please help
Eric
Create one seperate modal for profile and use the user model foreign key inside profile modal it will allow to save multiple emails for one user.
It might be overkill, if you just want to have multiple email addresses linked to the User model, but you could also extend your User model with django-allauth: https://github.com/pennersr/django-allauth
Jaya
how to send msg id in websocket
Vaibhav
When deselecting then also showing star mark*
Where is the code flow for deselecting?
Vaibhav
how to send msg id in websocket
Can you show the code?
priyanka
Where is the code flow for deselecting?
No I have only this code. This is my first app so I don't know how to. I am just writing this by a video but there is no code for deselect Can u please help
priyanka
Yes
Vaibhav
Yes
Then, the first line after else is the issue,
Vaibhav
In either case, you are setting is fav to true, it should be not of current value
Breeze
https://hastebin.com/omuduwayir.lua
Breeze
https://hastebin.com/omuduwayir.lua
pls am getting an attribute error
Breeze