𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
What's the difference between "adding a second list method" and "create a new one"?
Will there be a server overload if there are many requests to one If I will use that than separate ?
clouded
Will there be a server overload if there are many requests to one If I will use that than separate ?
Maybe I'm missing something, but if one request takes 10 seconds and two take 5 seconds each, where's the performance improvement?
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
clouded
in terms time same how I got you. how about clean code or optimize ?
Usually code follows a logic. Many things depend on how they are being used. Performance optimization mostly is about finding bottlenecks and fixing those. You should always be worried about writing clean code. I'm not sure this topic should be discussed in this group, I don't see how any of this is related to Django.
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
To be more RESTful /api/v1/logs/?some_field=9001909
can I have example of implement it ?
奈姆
I use django-rest-framework to implement REST API in django. You can check out the official docs.
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
Allexiusw
To be more RESTful /api/v1/logs/?some_field=9001909
I’ll go for the RESTful solution unless nested filter gives you some advantage in terms of performance or whatever, if not this is just one extra field available to be filtered as a query param?
ash
Does anybody know how to get 100% test results for manage.py using coverage
ash
by cover all code paths in your tests
Is there any libraries for creating tests automatically based on the app
Charly
Is there any libraries for creating tests automatically based on the app
if that was the case what would be the purpose of writting tests?
Charly
generate general tests
pointless if you already have every code path
ash
pointless if you already have every code path
Why drive a car when you can walk
Charly
Why drive a car when you can walk
ok dude, go generate your tests
ash
ok dude, go generate your tests
If I knew already, why would I ask you in the first place
ash
and I answered
Was so helpful bro, thanks 🙏
奈姆
generate general tests
What is considered general tests? Based on what criteria?
ash
What is considered general tests? Based on what criteria?
Modelviewset in drf exposes curd endpoints, so like some general testcases for that
Ha 💙
How can I add sensitive environmental variables such as password and email to the server?
Ha 💙
yes
奈姆
import os # Modify or set the environment variable. os.environ["NAME"] = "VALUE"
Ha 💙
And on the server??? So that the server works for everyone
奈姆
Ha 💙
I work on a real server I use environmental variables using os.environ.get('PASSWORD') How will I add this variable(PASWORD) to the server? So that the server works for everyone
奈姆
Linux server?
Ha 💙
docker,docker-compose
Ha 💙
yes
奈姆
docker,docker-compose
You may want to continue the conversation here @pythonofftopic as this is not really related to Django. But in general, you need to consult the docker docs on how to properly manage secrets. https://docs.docker.com/compose/how-tos/use-secrets/
V
Good day, can someone help me how I can upload an image to Django Python please.
MH
Good day, can someone help me how I can upload an image to Django Python please.
Look for detailed video on YouTube. It's easy in local environment you just need to define media URLs path. And for production you can use services like aws s3 to store your media files.
Hrithik
Hello, I was working on a registration form using Django and added a "Forgot Password" feature where an OTP is sent to the respective email address of the user. However, I noticed that Django was only able to send OTPs when I generated an app-specific password for the email account. This approach makes the process less secure, as it doesn't work with 2-step verification enabled. Is there any secure and professional way to handle this, or is this the only available method?
Mukhil
Hi friends It's mukhil My Django project running on my PC that's accessible through a domain name using a cloud service. I want to know how to switch from HTTP to HTTPS to make my site more secure. Is that right? @mukhil64
Hellomonster
Hrithik
Hellomonster
I've also experienced in Django. could please share more details?
Denys
Hello, tried to add AWS s3 to my django project for handling static files. Did everything from the guide, but when I run collectstatic, I get that error: django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path. Settings - https://paste.ofcode.org/7RucBn5ARnasBE5TBc4mLR
٩ʕ•͡וʔ۶
I’m facing a performance issue with check_password from django.contrib.auth.hashers. It takes about 400ms on my ARM machine and 700ms on an older Intel machine. Both machines use the same hashing algorithm and environment. Has anyone experienced similar issues or have suggestions ? Thanks!
Damir
Hello, tried to add AWS s3 to my django project for handling static files. Did everything from the guide, but when I run collectstatic, I get that error: django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path. Settings - https://paste.ofcode.org/7RucBn5ARnasBE5TBc4mLR
Try to use STORAGES = { 'default': { 'BACKEND': 'config.storage_backends.PublicMediaStorage', }, 'staticfiles': { 'BACKEND': 'storages.backends.s3boto3.S3Boto3Storage', }, } instead STATICFILES_STORAGE and replace values from your settings, for default use your media file storage
A
I am using Django Model Translate. When I write different texts in the fields name and name_ru through the admin panel and save, the text from the name_ru field gets saved in the name field. Has anyone encountered this issue?
Damir
I will try that, thank you
Make sure that values correct, i just copied this code from my projects., used AWS for save media files
Damir
I will try that, thank you
If you want i can send full code
Urvi
Hi everyone, I’m encountering a critical issue related to atomicity in a seat booking platform I’m working on. When multiple users attempt to book the same seat simultaneously (within the exact same second), it occasionally leads to duplication of bookings. Additionally, in some cases, users receive a notification stating their ticket is booked, but no actual ticket is generated because the seat was already purchased by another user. I’d like to know the best strategies or approaches to address these problems effectively: 1. How can I ensure atomic operations to prevent duplicate bookings in a high-concurrency scenario? 2. What is the best way to handle and synchronize real-time updates to avoid sending incorrect notifications to users? Your insights or references to similar solutions would be greatly appreciated!
Himanshi
Hi everyone, I'm seeking for the guidance for my 1st college project I'm final year student of bca..... and never ever made any kind of project previously so please let me know that how to begin coding after analys part..... the plateform we are going to use is django framework of python and mongo db for database.
Himanshi
As part of my BCA final year project, I’m working on creating a web application called Rental-Find.com – a platform designed to help people search for rental properties easily and efficiently. We're currently in the requirements and analysis phase, and we need your valuable input to make sure our platform meets the needs of different users. Feel free to also share any suggestions or ideas you think could improve the platform. Your input will play a big part in helping us create a better user experience
mohsen.k
Hello Friends, does anyone know the solution to the following error in GitHub Action? Invalid interpolation format for "environment" option in service "backend": "SECRET_KEY=!8t3pm*2g4hcvdd%!e$8#k&cvps0arryj&z0)^-&4ug6!h52j*" We searched everywhere and used artificial intelligence, but we couldn't find anything.
mohsen.k
Remove this quote mark
I am using the environs library in the project settings, do I need to use another library? Changing "" causes an error when running Docker Compose locally. What is your suggestion for this?
شهرزاد محمد
I am using the environs library in the project settings, do I need to use another library? Changing "" causes an error when running Docker Compose locally. What is your suggestion for this?
You put code: "SECRET_KEY=!8t3pm*2g4hcvdd%!e$8#k&cvps0arryj&z0)^-&4ug6!h52j*" but the correct: SECRET_KEY=!8t3pm*2g4hcvdd%!e$8#k&cvps0arryj&z0)^-&4ug6!h52j*
N
I need help in django
N
Anyone help me?
Himanshi
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
Which database could be used with django framework of python??? And in which platform to develop entire project?
Himanshi
Which database could be used with django framework of python??? And in which platform to develop entire project?
As part of my BCA final year project, I’m working on creating a web application called Rental-Find.com – a platform designed to help people search for rental properties easily and efficiently.
Naziru
hi am trying to integrate social_django in my app am stack at load_extra_data() missing 1 required positional argument: 'uid' please who will help me solve this
Naziru
and my model auto-generated primary key
Naziru
and am using custom django model AbstractBaseUser
Doragonsureiyā
Anyone help me?
No one can help you until you explain your difficulties.
Akshay
raise NotSupportedError( django.db.utils.NotSupportedError: MariaDB 10.5 or later is required (found 10.4.32). does any one know how to solve this error
Akshay
when i try to connect with mysql this happens
奈姆
raise NotSupportedError( django.db.utils.NotSupportedError: MariaDB 10.5 or later is required (found 10.4.32). does any one know how to solve this error
Didn't the error is pretty self explanatory? 🤔 Or find a Django version that support your db version...