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
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
Ali
Anonymous
Hello, I had a problem with the Django project structure (folder arrangement). Can someone tell me the correct folder arrangement?
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
Charly
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 💎
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
TonFutures 💎
Anonymous
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?
TonFutures 💎
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[]
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.
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?
Koen de
Farzin
Koen de
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
Charly
So you can filter, because I don't think you can query like that on properties
Farzin
Farzin
uquacore
Is there anyone who knows how I can implement social authentication (via Google) in my Django project?
Charly
uquacore
Koen de
Farzin
Georg
can django do features like alchemy automap ?
Georg
I'm interesting in reverse engeneering databases
Ayaz
Any Django dev here?
Doragonsureiyā
Ayaz
Need help
Targoon
i just asked where fo find work as django developer
Targoon
why is it deleted?
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
Just god