Rose
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://hastebin.com - https://nekobin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
refleks1a
Hi, I am setting the session in «GoogleLoginRedirectApi» and then trying to access it in «GoogleLoginApi», but it is blank. Any ideas? https://nekobin.com/gebayivuri
cv
from djoser.serializers import UserCreateSerializer as BaseUserCreateSerializer, UserSerializer as BaseUserSerializer ModuleNotFoundError: No module named 'djoser' why this error , i have installed the djoser and also set it in settings file
Anonymous
So how do I send a photo?😩
Anonymous
Ok . I had a question A virtual environment that we want to create Then we want to activate it I had trouble activating it Then I don't understand what should I do now?
Maxim
So how do I send a photo?😩
don't send any photos read the rules how to share code and errors
Rose
User Karan has 1/3 warnings; be careful! Reason: unrelated reply to random message
854281
Hi guys, do you have experiance how to handle media files django ini production server? When the debug is True, the files image is appear but when debug is False, the images is disappear
M. Hossein
I have TextMessage model that has sender, receiver and body, modified_at fields. I want to get lasr messages that either sender=user or receiver=user. Besides I want to consider (sender: user1, receiver: user2) to be the same as (sender: user2, receiver: user1) What should I do?
liulinxs
does there have some good dkango celery document? i want to do some schudle tasks
iam
does there have some good dkango celery document? i want to do some schudle tasks
https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html
AKSHARA REDDY
Guys I have a basic HTML file that has audio player I have audio in the file folder I have hosted the server What changes should I do to play the audio?
Udhay
Hi guys , I have tried to automate email in our website . it is working fine on localhost . but when it hosted on GoDaddy , error raised "network not reachable " like this . is there any SSL problem or any other problem . please let me know if you anything about it .I attached my code below . thank you ! def send_emaill(a): mail_content = f''' Name :{a["name"]} E-Mail :{a["email"]} Feedback :{a["feedback"]} ''' #The mail addresses and password sender_address = "mymail" sender_pass = "mypass" receiver_address = "receivermail" #Setup the MIME message = MIMEMultipart() message['From'] = sender_address message['To'] = receiver_address message['Subject'] = 'Feedback from User !' message.attach(MIMEText(mail_content)) #Create SMTP session for sending the mail session = smtplib.SMTP('smtp.gmail.com', 587) #use gmail with port session.starttls() #enable security session.login(sender_address, sender_pass) #login with mail_id and password text = message.as_string() session.sendmail(sender_address, receiver_address, text) session.quit() print('Mail Sent')
Rose
User ㅤ has 1/3 warnings; be careful! Reason: OFFTOPIC
Kesav
How to fix access blocked: the app's request is invalid in django Google authentication
Kesav
Can anyone solve this issue
Rose
User Tidke has 1/3 warnings; be careful! Reason: totally offtopic
Vaibhav
Guys I have a basic HTML file that has audio player I have audio in the file folder I have hosted the server What changes should I do to play the audio?
is it public over the internet, if so, then just render it using basic bootstrap, it would render and play easily
Rafael
Hi guys , I have tried to automate email in our website . it is working fine on localhost . but when it hosted on GoDaddy , error raised "network not reachable " like this . is there any SSL problem or any other problem . please let me know if you anything about it .I attached my code below . thank you ! def send_emaill(a): mail_content = f''' Name :{a["name"]} E-Mail :{a["email"]} Feedback :{a["feedback"]} ''' #The mail addresses and password sender_address = "mymail" sender_pass = "mypass" receiver_address = "receivermail" #Setup the MIME message = MIMEMultipart() message['From'] = sender_address message['To'] = receiver_address message['Subject'] = 'Feedback from User !' message.attach(MIMEText(mail_content)) #Create SMTP session for sending the mail session = smtplib.SMTP('smtp.gmail.com', 587) #use gmail with port session.starttls() #enable security session.login(sender_address, sender_pass) #login with mail_id and password text = message.as_string() session.sendmail(sender_address, receiver_address, text) session.quit() print('Mail Sent')
It seems like you're using Gmail SMTP to send emails. When hosting on a server, make sure the server allows outgoing connections on port 587. Also, ensure that the server has internet access. Additionally, since you're experiencing a "network not reachable" error, check if the server allows outgoing connections to the Gmail SMTP server. Sometimes, hosting providers impose restrictions on outgoing connections for security reasons. Lastly, consider using the GoDaddy email server settings for sending emails. They might have specific requirements or restrictions. If the issue persists, checking server logs for more detailed error messages could provide insights into the problem.
Dany
Ciao
X_ShaygaN_D
Help a little more and Give a example please A sample code Thanks 🙏
https://docs.djangoproject.com/en/5.0/intro/tutorial07/
Artem
Sup, guys! Do u know a way get changed data from inline object on save? For example: I save object in django-admin(change_view) with tabs: tab_1, tab_2, tab_3. In tab_3 I added some related_object(ex. user) and wanna get this object(user) before save. Also, I've tried get it from formsets but it didn't work. Mb it's was not clear for me. Guess it's might look like that: def save_related(self, request, form, formsets, change): instance = form.instance for form_set in formsets: user = form_set.changed_data.get('user') if user: ... super().save_related(request, form, formsets, change) Sure i can't take data like that from changed_data() Thank ya for yours replies!
Shan
Hello anyone know using swagger get method missing parameter
Shan
Class hostViewFilter(FilterSet): class Meta: model = host fields = "_all_" Class hostView (viewsets.ModelViewSet): queryset = host.object.all() serializer_class = hostSerializer filter_class = hostViewFilter http_method_names = ["get"]
Mirco
Hello anyone know using swagger get method missing parameter
Which lib are you using for rendering and generating Swagger ?
Mirco
drf_yasg
Ok so you have to specify the query strings via manual_parameters and using swagger_auto_schema decorator You can find info inside doc
Shan
i add swagger to my django application in local it work well but in server i get error Failed to fetch. Possible Reasons: CORS Network Failure URL scheme must be "http" or "https" for CORS request.
Shan
Any idea on this?
Mirco
Could you share the document regarding on this?
https://drf-yasg.readthedocs.io/en/stable/custom_spec.html
Mob
from my_test_app.models import Web my_test_app throws in an error
Mob
How do i fix it
Mob
Trying to import my models from my_test_app models.py but it doesn’t recognize my_test_app saying no module named my_test_app….how do i fix this please
Rose
How do i fix it
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
Anonymous
From my_test_app.models import Web
Mob
From my_test_app.models import Web
I did this it didn’t work
Maxim
Anonymous
I did this it didn’t work
From .models import Web We need more details about te code
Mob
From .models import Web We need more details about te code
Tried this now it says ModuleNotFound error: no module named “__main__.models”; “__main__” is not a package
Mob
From .models import Web We need more details about te code
I’m just learning django and trying to create models for my app
Mob
You need to pass this app in installed_apps in settings
That has already been done before I attempted to create models
Maxim
That has already been done before I attempted to create models
you (and we) will save a lot of time if you read it: http://catb.org/~esr/faqs/smart-questions.html#intro
liulinxs
i learn some knowledge about celery,but i cant find how to restart celery when i change the code ,like django if i change code then restart runserve,what can do
~𝙰𝚋𝚍𝚞𝚛𝚊𝚡𝚖𝚘𝚗
i learn some knowledge about celery,but i cant find how to restart celery when i change the code ,like django if i change code then restart runserve,what can do
In server you can use supervisor and if you restart supervisor it restart your project itself like "runserver".
san
I did this it didn’t work
Make sure you do manage.py makemigrations and migrate
Mob
It was an error on my side….I forgot to pass in models.Models in one of my models parameters
Rose
User Mark has 1/3 warnings; be careful! Reason: rule #5 violations
عبدالواسع
Asalam alykum When I installed flutter with it's extinctions , the snippets of django disbarred I removed them and removed django's extinction too but it didn't work
ali
Where can I learn about microservices, celery, and message brokers for work asynchronously with django?
Anonymous
Hello, when I use delete operation and deleted 3 datas and made my data list on the page empty, now I need to go 3 time backwards. Like the empty data is showing everytime when I click backwards
@j@y
Hello,I want a help in my django project I am creating a eCommerce website like https://decorspectrum.com/ Where I get a problem to how I can add to cart a product.here some problem to add to cart a product.becuse product have some parts before add to cart first select this parts which full fill the product required here some limit to select the part and all products have different limits to how much parts select to enable add to cart button Please visit this website and help me for my django project
Tejas
can any one tell me why get this error
Tejas
https://dpaste.org/f7jDV
Muslim Ali
#question Django DRF How can I configure media urls to come in https protocol?
Jimmies San
#question Django DRF How can I configure media urls to come in https protocol?
usually is the webserver the component that manages static and media files, so you should do it tuning your webserver configuration
NK TRIPLLE
#question Django DRF How can I configure media urls to come in https protocol?
You need to set up the gunicorn+ web server(nginx/caddy)
Jimmies San
How do I set it up?
did you google it? you will find lot of articles and help about how to configure nginx [r whatever you are using] for your django project, and how handle static/media files thru it, with https support. come back asking only after you tried and you have something in place ;)
Firdavs
#question DjangoRestFramework Good morning, have you ever had a situation where the PATCH and DELETE API do not appear But if you insert this code into another project, it appears on swagger, but for some reason it does not appear in this project, and the problem is only in this API, everything works correctly in the rest http_method_names = ["post", "get", "patch", "delete"] Where else could there be a problem?