Yaquier
The best way is,
STATIC_URL ='/static/'
STATICFILES_DIRS = [
BASE_DIR / 'static',
]
Enes
I am kinda beginner I have just 3 years experience and I didn't gain toi much experience in these 3 years
Enes
I even don't know about middleware sessions
Yaquier
Д
Stupid middleware ordering matters
Д
CORS has to be first
Yaquier
Read this:
- https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/
Yaquier
Yaquier
Д
Yaquier
Yaquier
Enes
Yaquier
Yaquier
Enes
thank you
Yaquier
Д
Was Django written in Python
Yaquier
Д
Mostly 😊
Hmm so it seems. I'm wondering how scalable Django is.
Doragonsureiyā
Yaquier
Д
Quite scalable
Do you have some definitive resource on handling DRF auth? I've been struggling with that. Mostly understanding statefulness/statelesness and which parts are handled by which component
Neo
Neo
https://www.django-rest-framework.org/api-guide/authentication/
Yaquier
Yaquier
Yaquier
Д
Yaquier
Godfrey
Hello, great Django Devs, I have a little problem, I am trying to automatically add a user to a group when it is created, this is the view bellow
Godfrey
Oh, I can't send media 😅
Godfrey
But if anyone have an idea, I would really really appreciate if you give me a hand
Fredy
Hello group, I need help in Django REST Framework...
I have a model, whose function is to receive floating data, performs arithmetic operations, the result of each operation depends on others...
a = data_a
b = data_b
c = data_c
d = a+c
e = b * d
The result of the operations are saved in the database...
I've done a lot of research and I only find that they do it in the views.py this is fine???
Д
Д
Because when you do it in the View, it means that you can feed the DB through the View (web) only
Fredy
Fredy
Only then could I achieve the goal...
Д
I guess the instance.save() is how the serializer works. The serializer has that in its Meta though
Д
The Class I mean
Д
Fredy
Д
Perfect, thanks
If the calculations were really hairy with multiple models involved before being shoved into multiple places, then the serialization layer for that particular view would have to be tailormade
Fredy
Д
Rudraksh
I am new to django
I don't understand the date time concept in django. How to use dates ?
What is timezone.
Can i simply use python standard datetime lib?
Please help me with this.
Maxim
Vitalik🐧
Tan
Lucky
How to create authentication token with user details
😒😒
context['iot']=Item.objects.filter(subobj.values('id')[0]['id'])
Trying to pass this into my context variable but I need it to be dynamic
The slicing:
values('id')[0 or 1]['id']
I can't think of any way to go about this
I tried to do this
values('id')[(i for I in range(len(ite))]['id']
and I ran into an error
😒😒
Error: qs indices must be integers or slices, not generator
Doragonsureiyā
How to create authentication token with user details
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
Adam
Hi all, does anyone know a video on creating a Media(News) Site in Django?
Aysuliw
#question
Can I get data from any database without models in django? Just adding it to the DATABASES in settings file. Thanks in advance for your anserws!
Doragonsureiyā
Aysuliw
Sorry for the incomplete question😁 How can I do it?
Doragonsureiyā
Sorry for the incomplete question😁 How can I do it?
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
Vxvek
Can any one help with sending pdf to mail using django
Doragonsureiyā
Can any one help with sending pdf to mail using django
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
Mirco
Anonymous
guys do u have good recourses for build LMS by django
Anonymous
LMS(Learning mangmant system)
Med
how to create an access token and refresh token using simple jwt for every user not only superusers ?
cj
Med
it works fine when I create superuser but when i create a normal user it doesn't and it says
"detail": "No active account found with the given credentials"
why
Med
btw i am using Custom User from AbstractUser model
Morteza
Med
my model
Med
class Myuser(AbstractUser):
username = models.CharField(max_length=100 , unique=True)
name = models.CharField(max_length=100 , blank=True)
email = models.CharField(max_length=100 , unique=True)
password = models.CharField(max_length=100)
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ["username"]