pink
DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage' Make sure this is not commented out, and appears below any conditionals or if DEBUG: blocks.
pink
and restart server to your setting update new value
~~~
Okay
.bit
Celery can be more of a bottleneck in a distributed system than this scheduler design.
Also I prefer aws lambda with eventbridge scheduler if performance got to be issue
Pablo
Hi all I am having issue with cloudinary image uploading. I configured everything as per the documentation...but still image is saving into local folder. The api keys are working and the custom cloudinary field is also working.But with default Imagefield it is not working Does anyone know the issue?
So funny I faced the same issues today. I had configured it all properly but was still getting that error. I realised it was some kind of incompatibility problem between Django and cloudinary when I switched my Django and cloudinary versions to: Django==5.0.6 cloudinary==1.40.0 django-cloudinary-storage==0.3.0 After switching to the above versions, it worked perfectly. Note that you need to set default file storage to: DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage' And you can set your file or image field: models.FileField(upload_to='Eurotrip/advertisements/')
Amirhosein
Hello friends. Does anyone know the best method for implementing validation in Django, considering optimization principles like not repeating code (DRY) and avoiding redundant validation checks? For example, when a ModelSerializer is validated, should we call the full_clean() method on the model instance? If we do, will the model's validation run again, leading to these kinds of issues? If anyone knows the best approach, I'd be grateful if you could share it. I've been struggling with this for three days.
𝚆𝚘𝚛𝚕𝚍𝚕𝚎𝚜𝚜
Has anyone used scrapy and Django together before? I'm struggling to actually cache data inside Django's localmem cache while the server is running , but it won't just work when i try doing it in the pipelines Perhaps it's not possible and i need redis?
𝚆𝚘𝚛𝚕𝚍𝚕𝚎𝚜𝚜
Show what you have done and the errors you are getting because is hard to see what's wrong
I don't have access to my code right now but I searched the whole internet , i just need to find a way to add the scrapped data to django cache (localmem) because I don't know anything about redis yet. Most people save data in database , but i want to overstep this method a little and add caching to it
Charly
Django Ninja, but learning other library won't necessarily make it easier, do youhave good bases on django alone?
-.................................-
Django Ninja, but learning other library won't necessarily make it easier, do youhave good bases on django alone?
yes, I can handle Django well, but I need to separate the backend and frontend and work with the API. I read a little about DRF and want to learn about alternative options.
-.................................-
-.................................-
you can just use Django without DRF as well
and will this make the work easier or more difficult?
Maxim
and will this make the work easier or more difficult?
it's impossible to say in general depends on which DRF features you are using
-.................................-
ok, thanks for the information
-.................................-
"Having completed a Django course and gained a solid grasp of models, views, dynamic routing, and the overall framework architecture, what advanced concepts or best practices should I focus on next to become a proficient Django developer?"
minory
can you tell me what is the best way to delete records from the database if their number can range from 100 thousand to a million? django (drf), postgresql not soft delete raw sql?
minory
queryset.delete() it is already a bulk delete should be fine to use it
Yes, but there are a lot of records and it's a problem because it's a long time, I did it through batch size, I think it's normal that I deleted 150 million in 15-20 minutes, and there's nothing to do about it
Charly
I mean, you can optimize it with some techniques, but why you need to delete that ammount of records faster?
Charly
sounds like an one shot task
minory
I think you're right, and there's nothing to do but wait, since the task will run, say, once a week, thank you.
Charly
I think you're right, and there's nothing to do but wait, since the task will run, say, once a week, thank you.
And what's the criteria of deleted? Maybe you can add an index to get the rows to delete. Also use multiple connection
minory
And what's the criteria of deleted? Maybe you can add an index to get the rows to delete. Also use multiple connection
Criteria for deletion, entities older than n-month. Literally one field in the table.
Charly
Criteria for deletion, entities older than n-month. Literally one field in the table.
You can index that field and even run it daily to have less row to delete them
.
hello ! need to reset a form, and delete all erros messages from django form, when i refresh the web page. How can i do it inside my django view ?
Shiva
Hello guys, i am fetching large amount of data at a tym so it is taking too much of time to fetch all and to display, so is there any other ways to fetch fast and display fast
Shiva
Using django backend i am fetching the data from multiple tables ,as there is more amount of data it is taking too much of time to fetch all data. In frontend i need to display all data. I need to diplay all data fastly without taking that much of time to diplay all data
B®istol
use debug toolbar to optimize queries; use caching to make queries faster, i think that would be enough
I can suggest you use the pagination tool if loading all data at once is not required
Shiva
Thnq for all u r suggestions
S
Anyone can suggest a management system?
Maxim
Anyone can suggest a management system?
what does this have to do with Django?
S
what does this have to do with Django?
Because we use django to make webpage
854281
Hi all, I want to create an django app its can install and uninstall module. Example, I have a landing page contains module list, when I install on of a module the url will created and can accessed based on the module. But when the module uninstalled, the url will be removed. Any suggestion topic or documentation in django about that case?
.
Hello, I've got a question, How can i include additional field information like first_name in the jwt token
.
Yes
Yes??
hamid
Hello, I've got a question, How can i include additional field information like first_name in the jwt token
You can access them in api views by request.user.first_name and for serializers self.context["request"].user.first_name But remember the user should be authorized To check that you can and permission classes to your view If you don't want this you can also change the structure of jwt
854281
Hi guys, The idea is, I want setup once for the urlroot based on Installed application which is registered in the settings.py.. so when I create a new app, I just register the new app in settings and then manage the url app.. do you have any idea, documentation or project something like this guys?
Claudia
hello friends maybe someone can help me :'v, I'm trying to implement two-factor with the django-two-factor-auth library and I did the settings in urls.py and settings.py but it gave me an error which I attach in the image, I relied on chatgpt to correct it and the solution he gave me was to modify the library files in the urls.py and replaced urlpatterns = (core + profile + plugin_urlpatterns, 'two_factor') by urlpatterns = core + profile + plugin_urlpatterns my question is if it is possible to correct this error in another way.
Asterix
hi guys anyone dealt with Google Sheets in django rest framework
Charly
hi guys anyone dealt with Google Sheets in django rest framework
Better to ask your question than expecting someone to have done what you need to do
Asterix
i need to fetch my data from db and update on google sheets
Asterix
it must work synchronously
Charly
it must work synchronously
So you know how to fetch data from the database right?
Asterix
yeah
Charly
yeah
Then it is just searching how to upload data to Google sheets using python, e.g https://erikrood.com/Posts/py_gsheets.html
Neon
Hello, how can I implement rate limiting for my Djoser-based Django login/registration using Django Ratelimit with PostgreSQL
Swetty
Hi, maybe somebody help me: I run my django project using docker and nginx, but i have troubles with django-admin static files (css, js) - it isn't load meanwhile statics from my own apps works correctly, also static correct loads if i run django server without nginx (docker or native). I thought i have problems with my nginx config (cause without nginx it works), but don't understand where is it: server { listen 80; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /static/ { alias /app/staticfiles/; } } P.S. I didn't separate style to css files from my html writing my own apps
DD
good afternoon colleagues! i have a question regarding DRF: i have a viewset. viewset has a lot of default and custom actions. i want pagination to be used only inside one action(for example list), but if i try pagination_class it affects all actions. how to use pagination only for one 1 action?
Kanhaiya Lal
In django template I'm facing one problem like our data not reflecting countinusly we need to do reload the page. How can I get Dom like react? Can anyone help me?
Georg
hi. Is there a migration operation like RemoveField but with condition? I need something like RemoveFieldIfExists...
Taha
Hello guys I have a question about swagger What is the best package for implement a swagger document in Django
Pablo
Not necessarily
Not necessarily but it’s a good option and efficient way to serve static files
cj
Not necessarily but it’s a good option and efficient way to serve static files
it's much more efficient to serve them directly using nginx as OP wants to do