Ngdream
Why without it?
because I wonder if there is another method the only thing I find on the net are methods using ffmpeg
Ngdream
but if you have a way of doing it that uses ffmpeg don't hesitate to show it, it could be different from what I see on stackoverflow
Charly
because I wonder if there is another method the only thing I find on the net are methods using ffmpeg
But why do you hesitate about using ffmpeg even if you have many materials showing how to use it?
ilham
hi may i know how to override delete method in django? for example, if i delete an instance, i want a function to be called
Anonymous
Hello, I had a problem with the Django project structure (folder arrangement). Can someone tell me the correct folder arrangement?
Koen de
how to install rabbitmq 3.9.12 on mac brew please tell me
brew install rabbitmq@3.9.12 I assume you already tried that? What errors popped up? Mind that this not a Django question, you might ask this in a Mac-channel
Doragonsureiyā
OK!
Bong
views.py file must be created in project folder not under any folder in the project
Ohama |
Anyone know how to use cookie test in CreateView?
Charly
Ohama |
What do you mean by cookie test?
This https://docs.djangoproject.com/en/4.2/topics/http/sessions/#setting-test-cookies
Ohama |
And what's the issue of putting it in your view?
Oh nvm I found it to check when in form_invalid. Thanks
Anonymous
Hai, can anyone tell me how do you join 2 tables and parse it to html?
ronny
hello guys i need to fetch an api with many to many fields relationship model using javascript
ronny
how can i go through it..someone help
TonFutures 💎
I want to create login page without authenticate How can i do that?
TonFutures 💎
If i use User.objects.get() is it safe?
TonFutures 💎
I just want to check the username of the user
Anonymous
In USERNAME_FIELD, we can only have one field. How can I use two fields(like email and phone) to authenticate the user? Email and password OR phone and password. I did some search and found out that I have to write a custom authentication backend and put it in the settings.py. I have no idea how to do it. this is the structure of backend for authentication: class EmailAuthBackend(BaseBackend): def authenticate(self, request: HttpRequest, username: str, password: str) -> Optional[AbstractBaseUser]: pass def get_user(self, user_id: Any) -> Optional[AbstractBaseUser]: pass
TonFutures 💎
from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User class PasswordlessAuthBackend(ModelBackend): def authenticate(self, username=None): try: return User.objects.get(username=username) except User.DoesNotExist: return None def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExist: return None
TonFutures 💎
AUTHENTICATION_BACKENDS = ( 'myapp.auth_backend.PasswordlessAuthBackend', )
TonFutures 💎
actually it's custom authenticate
Anonymous
I just want username
the user sends me email or phone how can i get the information that the user sends from the login page?
Anonymous
Email/Phone: Password: ————— this is the form. how can i get that info from the authenticate?
Anonymous
with forms
can you explain? do i really need forms?
TonFutures 💎
You want to get email and phone number from user?
Anonymous
in usual authentication we get that like this request.data['email']
Anonymous
but in authenticate function in the custom backend, is it possible to do something like request.data['email'] or request.data['phone']
TonFutures 💎
MyForm(request.POST)
TonFutures 💎
Do you know how to make form?
Anonymous
but why do i need a form?
Anonymous
is it possible to get access to "request"?
Anonymous
then request.data[]
TonFutures 💎
but why do i need a form?
You can search to understand or from Django's documentation
Anonymous
You can search to understand or from Django's documentation
After reading it I know that i don't need it. unless it helps me get the data.
Anonymous
the documentation is not really precise in custom authenticate backends.
Kha
How to practice validation
Ngdream
how to make video streaming server with django
Doragonsureiyā
how to make video streaming server with django
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
Mohammad Hossein
Hi everyone Can you propose me a structure for this usecase: An order page with order item. Every time enter a product barcode, its number grows up.
Doragonsureiyā
Hi everyone Can you propose me a structure for this usecase: An order page with order item. Every time enter a product barcode, its number grows up.
So, why don't you do it yourself first? When you have an issue with the Python code you wrote (read rule 5️⃣ to show your code), come back here and people will help you. 😉
Koen de
How to practice validation
First hit on Google; https://www.geeksforgeeks.org/python-form-validation-using-django/amp/
Anonymous
Language Persian??
Farzin
Hello everyone, I'm currently facing a problem, I will explain it as an example: Let's consider I have a model like this: ''' from pands import Timedelta Class MyModel(Model): created = model.DateTimeField() resulotion= model.CharField() @property def end: return self. created + Timedelta(self.resolution) ''' Now if I want to use this for filtering a query set like qs.filter(end__lte=some_date) it's not gonna work. How can I implement this part to work?
Maxim
Language Persian??
no only English is allowed here
Koen de
Both posts have alternatives
And otherwise, store an additional field where you store the calculation of your end method. You can extend/overrule the save method of the model or use a signal
Charly
So you can filter, because I don't think you can query like that on properties
Farzin
Charly
I thought maybe there is another solution, many thanks
But why? Why are you trying to do it more complicated?
uquacore
Is there anyone who knows how I can implement social authentication (via Google) in my Django project?
Koen de
Is there anyone who knows how I can implement social authentication (via Google) in my Django project?
Scroll back about twenty questions here. I answered the same question yesterday; https://django-allauth.readthedocs.io/en/latest/
Farzin
But why? Why are you trying to do it more complicated?
Actually, I so in some steps my test failed when I tried to override save() method of the model, then I thought maybe there are better solution, but I think at the end this is the alternative
Georg
can django do features like alchemy automap ?
Georg
I'm interesting in reverse engeneering databases
Ayaz
Any Django dev here?
Doragonsureiyā
Caleb
Any Django dev here?
what do you think??
Ayaz
Need help
Targoon
Any Django dev here?
thousands and more actually
Targoon
i just asked where fo find work as django developer
Targoon
why is it deleted?
Doragonsureiyā
i just asked where fo find work as django developer
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Just god
Hey, I see the following error when importing a model from Pairs application: from pairs.models import ContractModel ModuleNotFoundError: No module named 'pairs' https://forum.djangoproject.com/t/modulenotfounderror-no-module-named-myapp/23248/3