Anonymous
Here backend data is not rendering to frontend end
Anonymous
Please help me resolve these error
Elilooli
Can you explain more
when I want to access the default "you have created your first project in django" page I get a timed out error
Arsenii
but gunicorn is better to use in production gunicorn app.wsgi:application --bind 0.0.0.0:80
Elilooli
python manage.py runserver 0.0.0.0:80
I tried that it gives the same error
Elilooli
but gunicorn is better to use in production gunicorn app.wsgi:application --bind 0.0.0.0:80
I've just done this it still gives the same error I don't think it's about the app itself, it's a problem with localhost in general
2200090087_Shaik imran rasool
how to create easiest payment gateway
2200090087_Shaik imran rasool
How to book slot for user and verify whether slot is booked for admin using django
Karunakar
2200090087_Shaik imran rasool
IGA
Please if someone have a django learning book, can you send me🙏🙏
2200090087_Shaik imran rasool
not getting anything in admin panel
2200090087_Shaik imran rasool
Unable to get apps in admin panel
2200090087_Shaik imran rasool
What to do
Azizbek Xushnazarov
Unable to get apps in admin panel
Make sure that the user has permission to see the models
Shahrukh
Haya
i want to Get date, subject and body len of all emails from INBOX folder i use this code but i have an error [Errno 11001] getaddrinfo failed can help me to solved this error                                                     def fetch_emails(request):     imap_server = 'example.com'     email_address = 'test@example.com'     email_password = ',^-hHs@1('     with imapclient.IMAPClient(imap_server) as client:         client.login(email_address, email_password)         client.starttls()        client.select_folder('INBOX')         messages = client.search(['ALL'])         for msg_id, data in client.fetch(messages, ['BODY[]', 'FLAGS']).items():             msg = data[b'BODY[]']             print(msg)
pranav
What can be your suggestions for someone starting to build a social media app on django?
Arsenii
just copy simple features from facebook or another social media
Anonymous
Hi,i am trying to deploy my full stack project frontend with react and backend with Django it is working fine in local mechine but when i am trying to deploy it in aws i am getting integration error
Anonymous
if do you have any idea in frontend and backend integration please help me
Charly
if do you have any idea in frontend and backend integration please help me
There is no real integration you just use the url of your backend on the fronted
Anonymous
yeah, i am configured my backend url to frontend with the local machine ip and port but when it is moving to aws ec2 it is changing the port no and iP address so frontend and backend connection are not working
pranav
There are just too many methods to achieve anything and that's creating confusion , I'm trying to learn authentication in django and everyone is telling their own way, any suggestions?
Charly
Can you provide the link to django Authorization documentation?
Or you can do a quick Google search (which is the thing I would do as I don't have the links on my mind)
pranav
When to use django vs DRF? like authentication can be done using both so when to choose what?
pranav
Basically when you are creating API you can prefer DRF
Okay thankyou, also have you any idea about how to verify email for registration in django?
T
You can send OTP
T
On mail and get verify it
T
Or you can send an account verification link
pranav
You can send OTP
That was my question , how can I send that OTP?
👑 Dharmzeey
Please I have a question, I have a django app that serves two purpose, I am using the normal django for html template rendering and also I am using DRF for API. The two api and web functionality uses the same model, how can I structure my app well such that they use the same model and for the web app the forms, views and urls is specific and for the api serializers, views and urls are specific. The app is an ecommerce site, it has user and store app
F
For styling amazing forms, which one you prefer? Widget.attr in forms.py or Django-widget-tweaks?
F
https://pypi.org/project/django-widget-tweaks/
Danya
Hi, I have some questions about testing. What testing tool do you use for testing, especially API, PyTest or built-in Django/DRF testing tools? Do I need to test models/serializers/urls in isolation, when there is no custom logic? I think this is unnecessary. Testing only completed endpoint is normal? Is this counts as integration testing or unit, I'm confused about this. I'll be appreciated for any answers or advices
Vaibhav
For styling amazing forms, which one you prefer? Widget.attr in forms.py or Django-widget-tweaks?
Django widgets should work for you, if it's normal requirements, for anything custom which you can't do in it, you will require custom form code or some later of template
F
this is not a survey group
What’s Wong in asking where to start when we have no experience in both?
Maxim
What’s Wong in asking where to start when we have no experience in both?
that it makes sense to choose different things in different situations don't post surveys here and delete that one you can ask it at @pythonofftopic
DeathLikeSilence
Hello, my friend and I created a website, front end is React and Back-end is Django. now we have a huge problem, we do not know how to connect front with back. For backend we use DRF and for React we use Axios. I would be very grateful if anyone could help
Maxim
Hello, my friend and I created a website, front end is React and Back-end is Django. now we have a huge problem, we do not know how to connect front with back. For backend we use DRF and for React we use Axios. I would be very grateful if anyone could help
you're saying the strangest thing it's impossible to create both frontend and backend in such a way that they don't interact if frontend and backend are ready, then there is a ready site where frontend interacts with backend If it doesn't, then frontend or backend or both are not ready
Alfredo
Hello, my friend and I created a website, front end is React and Back-end is Django. now we have a huge problem, we do not know how to connect front with back. For backend we use DRF and for React we use Axios. I would be very grateful if anyone could help
Just make the API calls in your SPA with React. If your endpoints need authentication and authorization, just login and pass the JWT access token in the Authorization header with Axios.
DeathLikeSilence
Just make the API calls in your SPA with React. If your endpoints need authentication and authorization, just login and pass the JWT access token in the Authorization header with Axios.
Thank you so much, the problem here is, Should I change or add something in Setting.py? I mean for connecting to React Also, I use serializers and I did not use authentication or something like this. I test backend with Postman and the back-end works
DeathLikeSilence
You should add allow Cors headers check docs for that
Can you please be more specific? How can I do that?
Karunakar
Like frontend and backend will run on two different servers right? So we should allow the frontend server to access the back-end server for that we need to add allow Cors headers by adding the frontend server link
Alfredo
Thank you so much, the problem here is, Should I change or add something in Setting.py? I mean for connecting to React Also, I use serializers and I did not use authentication or something like this. I test backend with Postman and the back-end works
Well, if you plan to protect some endpoints to logged-in users, you should implement authentication with JWT (for example). Also you need to enable CORS. But you don't need to do anything in the backend to be able to get data from the API. The same way you use Postman or Insomnia to make API calls, you need to to it with Axios.
DeathLikeSilence
Well, if you plan to protect some endpoints to logged-in users, you should implement authentication with JWT (for example). Also you need to enable CORS. But you don't need to do anything in the backend to be able to get data from the API. The same way you use Postman or Insomnia to make API calls, you need to to it with Axios.
For authentication I used authentication_classes and permission_classes I did it. I used CORS_ALLOWED_ORIGIN For instance: CORS_ALLOWED_ORIGIN = [ “”” I added my frontend URL here “”” ] In front-end, when we fill out the form sign up, we get ‘ bad request 400’
DeathLikeSilence
Dev
I have a django project, where i download the template as a pdf using wkhtmltopdf.The pdf is downloaded when i click the download button, However when i open the pdf it says, “Error Failed to load PDF document.” and i cant open the downloaded pdf. Upon looking at the terminal i also see this error: UserWarning: A {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext. Not sure if related to the pdf problem. What is causing this issue and how can it be solved?
Dev
This is the link to the code, I had shared it in a django forum: https://forum.djangoproject.com/t/downloading-a-functioning-pdf-in-django-using-wkhtmltopdf/24242
Anonymous
Hi I wanna ask why my admin panel become light mode after I did migration
Anonymous
Could you please help me how to make it darkmode coz my it tiers my eyes :)
Anonymous
I have same project it is builded with frontend react and backend Django it is working fine on local mechine but I have issue in online deployment I need support for that project. I would be very grateful if anyone could help
Dev
Please Ensure that wkhtmltopdf is correctly installed and configured in your Django project.Check the pdf generating template is correct. html check.
Hello, thank you for your feedback and suggestion 🙏🏻. wkhtmltopdf is correctly installed and referenced. I had to configure it from the views because when I tried referencing it from settings.py it wasn’t working at all. I’m not sure what I’m doing wrong. I’ll provide you the link, for reference: LINK🔗
i
Hello, thank you for your feedback and suggestion 🙏🏻. wkhtmltopdf is correctly installed and referenced. I had to configure it from the views because when I tried referencing it from settings.py it wasn’t working at all. I’m not sure what I’m doing wrong. I’ll provide you the link, for reference: LINK🔗
I saw ur. Pls check and use writing it to browser before converting to. return HttpResponse(html_content) # Temporarily replace your return statement with this for debugging Ensure u require any other configuration of pdfkit.
Alireza
I use ckeditor in the admin panel, but when I color or change a text, it does not show correctly in the template. Can you guide me؟