D🌷
class Comments(models.Model): blog = models.ForeignKey(BlogDetailsPage, verbose_name="Qaysi post", on_delete=models.CASCADE, related_name='comments') photo = models.ImageField(upload_to='comment/', default='comment/user.webp', verbose_name='Rasmi') name = models.CharField(max_length=50, verbose_name='Ism familiya') email = models.EmailField(max_length=254, verbose_name='Email') comment = models.TextField(verbose_name='Izoh') data = models.DateTimeField(auto_now_add=True, verbose_name='Vaqti') status = models.BooleanField(default=True)
Roman
hi everyone guys. Can you please tell me some video tutorials on how to practice Django writing heavy application design? what to study next if you know django rest framework?
ZeroCool
Hello everyone, does anyone have a manual or tutorial for running views in parallel? For example, I will have a view that calls a function that processes an image, each process takes approximately 1 minute. I would like to know if there is a way for request 1 and 2 or 3 to be executed in parallel and not wait for the process to finish. 1 and then process 2 and process 3 queued
bansh
Write raw query for this
Abhi
Is there any solution for not using full structure of django on hosting because i feel full structure django with frontend makes website slow?
Anonymous
Hello. Do i choose django or nodejs?
Leo
Hello. Do i choose django or nodejs?
Firstly choose a programming language
Ankit Sharma
I want to save files in the user's folder in media but it gives me an error return super().execute(query, params) django.db.utils.OperationalError: no such column: main_profile.user_id
Anonymous
Firstly choose a programming language
I leart JavaScript Python C++
Leo
I leart JavaScript Python C++
you are a genius? pick one language and focus on being perfect
Doragonsureiyā
Hello. Do i choose django or nodejs?
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so move to @PythonOfftopic group and ask there.
Qwerty
you are a genius? pick one language and focus on being perfect
And what's the problem of the nobility of a few programming languages? О_о
Fariba
Hello everyone, I encountered a challenge. I used JWT authentication for user verification. Now, every request that comes to the backend should have both an access token and a refresh token, and I need to refresh the access token each time. Is that correct? This means that the frontend needs to refresh the access token every time a response is received for a request. I feel like this might not be efficient. For example, imagine loading a page requires sending 10 requests to the backend. That would mean refreshing the access token 10 times and replacing it in the frontend 10 times?! What is the correct approach to handle this situation?
Fariba
No, you use the refresh token only when the access token expires.
You say i don't update access token in each request?
Alfredo
You say i don't update access token in each request?
Nope, that is unnecessary. You need to check if the access token is expired, and if it is, then you use the refresh token to get a new access token. In a SPA, for example, you could use an Axios interceptor to check that.
Navi
In django project creation in cmd
Navi
The error : ImportError : cannot import name 'ParamSpec' from 'typing'
D🌷
Upgrade the typing_extensions package: Upgrading the typing_extensions package to a more recent version can help resolve the issue. You can use the command pip install typing-extensions --upgrade to upgrade the package . Reinstall the fastapi package: If you are using the fastapi package and the error persists, try reinstalling it. You can uninstall it using pip uninstall fastapi and then reinstall it using pip install fastapi. Check for circular imports: Circular imports can sometimes cause this error. Make sure that there are no circular imports in your code.
Shiv
Can anyone help me to setup email template in django rest framework
Tsukuyomi
Hello friends, how can I run tests in django with an existing database and without running the migrations? I use python manage.py test --keepdb, but it always executes the migrations, I eliminated the migrations from my apps, but there are still migrations of "django.contrib.admin" "django.contrib.auth", which it executes and gives error because they already exist
Caio
Hi everyone! I have a problem that i need use two INNER JOIN. I Need to use one prefetch to each filter but occurs a error " 'pipelines' lookup was already seen with a different queryset. You may need to adjust the ordering of your lookups". Someone can help me with this? https://gist.github.com/caiozim112/794b40df77a5dc134faa67e39263fd9e
Caio
Certainly i need to filter Playbookspipelinespriority and another is to filter Playbooks_pipelines__user_id
Levitybot
Anyone know of there is a problem naming a django project '_core' so it is always at the top of the folder structure? Is using an underscore going to backfire on me later?
Levitybot
Or anyone have any better solutions?
Charly
Or anyone have any better solutions?
I don't even think the order is a problem, I mean how many apps you have to have an issue because of the order?
Levitybot
Fair enough that it's pretty pedantic, but I just like it to be separate from the other apps because it is not like the other apps
Levitybot
Yes I can, but my concern is that using a symbol might backfire for some unforseen reason. Hence asking the community if anyone else has tried it, would recommend against it, or has a better solution.
Maxim
Yes I can, but my concern is that using a symbol might backfire for some unforseen reason. Hence asking the community if anyone else has tried it, would recommend against it, or has a better solution.
the top of a structure and the top of a list are not the same thing there is hardly anyone else with such strange wishes for artifacts of meaningless sorting
Levitybot
the top of a structure and the top of a list are not the same thing there is hardly anyone else with such strange wishes for artifacts of meaningless sorting
Folder structure seems like a valid enough way to describe it to me. It is not just a list either. I understand you think it is frivolous and the irony of you making such an unnecessary, possibly incorrect, and unhelpful *correction* yourself whilst pointing out how unnecessary you think my question is, is amusing. I also disagree with your main point that people don't want an organised and standardised name for this folder
Levitybot
Can we please try to give helpful answers only
Charly
Can we please try to give helpful answers only
So I can't think on an issue because of the name.
Levitybot
So I can't think on an issue because of the name.
The only thing I can see at the moment is that an _ typically means private by convention. But I think I'm OK with that
Levitybot
I think I will just have to try it and hope the project doesn't explode later down the line
nyctophile
can anyone help me with this problem ` raise SuspiciousFileOperation( django.core.exceptions.SuspiciousFileOperation: The joined path (C:\banner_1\681016.jpg) is located outside of the base path component` i am trying to save image into a folder that named with object id but cannot access object id until it saves in database. So i tried to save it as it is and change the image url and location but getting the error above, here is my code and error https://hastebin.com/share/ahanomobiy.scss,
Benso
I am using django-allauth library to create a signup page using email, password and repeat password fields only. Then I want to have email verification for the user. That is once a user signs up, a confirmation link is sent to the email and once the user clicks the click, He or She is redirected to the login page. Who can help me with this...I willl appreciate.
Levitybot
can anyone help me with this problem ` raise SuspiciousFileOperation( django.core.exceptions.SuspiciousFileOperation: The joined path (C:\banner_1\681016.jpg) is located outside of the base path component` i am trying to save image into a folder that named with object id but cannot access object id until it saves in database. So i tried to save it as it is and change the image url and location but getting the error above, here is my code and error https://hastebin.com/share/ahanomobiy.scss,
I'm just coming back to django after some time away (checking out HTMX with django). I think the error you are getting is actually about the directory you are trying to save the image in. It doesn't like that you are trying to write a file just somewhere in the c:/ . It wants you to be writing to a file inside your django project. Alternatively you could look toward cloud blob/file storage like an S3 bucket on amazon.
Tim
Hi everyone! My Django admin panel looks strange after being transferred to the server. I can't send a photo here. Can anyone tell me how to make it the same as it was on the local computer?
tan (θ)
which one do you for Authentication? 1. Session 2. jwt
Qwerty
For admin panel?
Have you collected the statics to display it correctly on the server?
Qwerty
yes
Show the settings.py file in the part where static settings are specified
Qwerty
which one do you for Authentication? 1. Session 2. jwt
What is used as a frontend? Django or js?
Qwerty
Django
Session
Abdulla
Can anyone send documentation for django
Doragonsureiyā
Can anyone send documentation for django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Estelle
hi,everyone,i have a question. i want use py3Fdfs to connect my fastfds in linux,but when i trying to upload file,it return raise DataError('[-] Error: \'sendfile\' system call only available on linux.') fdfs_client.exceptions.DataError: [-] Error: 'sendfile' system call only available on linux. my Django project is in windows.if you had the same question and kown the solution,please help me
Blue
How fix the error python error 503 in cpanel
insaan
Hey , I downloaded a wep chat app using django , SQL , html , css , and js and deployed it on python anywhere And I am unable to make websocket connection, can someone help please?
Dé
Page not found (404) Request Method: GET Request URL: http://www.teste.br/teste/meu-teste2.py Using the URLconf defined in auto.urls, Django tried these URL patterns, in this order: admin/ The current path, meu-teste2.py, didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
Nana
24 hours, i could not set up django project
Nana
i tried all method, sometimes the command prompt will not even respond🤨
Charly
Charly
If you need help show what you have done and what errors you see
Nana
okay
govind
Please suggest a fast and best way to csv data import in django rest framework
KartiK
guys i just made todo app using django with user authentication(by following yt tutorial), So i have already learned django rest framework, now i want to create an E commerce website backend(only), should i follow some yt tutorial or try to make it from my own by learning from docs or somewhere else pls suggest me
Shahid
Obviously docs and try it yourself
Kamronbek
Hello. I logged in the user. but when I say request.user, it returns AnonymousUser. request is coming from axios in react. I logged in using login(request, user). localstorage has a token, should I use that?