inchidi
else, since you have fallback for requests.method != 'POST' you can try send the same request to same url but with GET method and make sure you get 'success'=False as specified there, coz if you dont get it then you can sure that you're using wrong url.
inchidi
*coz CsrfViewMiddleware ignore GET method
inchidi
I want to create new form using foregin key How can i save user model object ?
https://docs.djangoproject.com/en/4.2/topics/auth/default/#creating-users
ᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠᅠ
inchidi
here is my files https://codefile.io/f/CR4Amv7Beh
you can try add {% if room.host %} before calling room.host.id (line 25 and the endif at line 33). if nothing shown, then (some of) your room doesnt have host (room.host==None)
Daler
Hi everyone! I have a question.How can I make chat API using drf and Django channels.Can any explain me step by step roadmap
inchidi
Hi everyone! I have a question.How can I make chat API using drf and Django channels.Can any explain me step by step roadmap
https://channels.readthedocs.io/en/latest/tutorial/part_2.html and if you want to use DRF, simply replace things around json.dumps(...) with your serializer.data
inchidi
Thanks
btw most likely instead of websocket, SSE is what you're looking for https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
A
How to slice a string in django template , I want to remove last 5 characters, I am using {{ data | slice: ":-5"}} , it's not working
A
Didn't got bro
T
use the reverse slicing operator [::-1] syntax.
Kaustab Roy_C_24_CSE(AIML)
How can get,post,put,patch,delete data from Django Rest API in Angular(12+) Frontend application. Can anyone suggest any beginner friendly article or video tutorials on this topic?? It will be very helpful. 🙏🙏
Abhinav
Hi everyone, I have a question.  I have developed a flask api endpoint and need to deploy it to a Linux server just for demo. Can I just use Gunicorn as a server without Nginx?
Abhilash
Can anyone help me with a web development project using django?
Doragonsureiyā
Can anyone help me with a web development project using django?
No one can help you until you explain your difficulties.
You
Hello guys. I want to connect to the postgraduate database, but this is the error: conn = _connect(dsn, connection_factory=connection_factory, async=async) django.db.utils.OperationalError: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 8000? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 8000?
Mihir
How can i create model object for foreignkey in django I am unable to save form
You
The error is pretty clear
If possible guide me
Jahongir
Hi guys. I have a model called Order and it has some fields such as currency, shop, paid, etc. shop field related to Shop model with FK. How can I update the model's all objects' currency field to shop model's shop_currency field? I'm currently using for loop. But If I have a lot of orders, loop takes a long time.
Jahongir
my current logic for order in Order.objects.all(): order.currency = order.shop.shop_currency order.save()
Jahongir
could you give me mini-example?
Charly
https://www.sankalpjonna.com/learn-django/running-a-bulk-update-with-django
Rajan
Where we can deploy our django projects
Sea
I am hosting my Django project on AWS which is using AWS RDS for its database but I am getting this error again and again, can anyone help me to resolve the error? django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'database-1.cgw14feyvao3.ap-south-1.rds.amazonaws.com:3306' (110)")
Muflone
Where we can deploy our django projects
Python anywhere, render, vercel
Rajan
Python anywhere, render, vercel
On pythonanywhere I am getting memory error it is exceeding it's free limit
Rajan
Then you have to pay to raise the limits
Also I tried on render and vercel I am getting some weird error
Muflone
Also I tried on render and vercel I am getting some weird error
Then you should explain the real issues, not asking generic questions
Doragonsureiyā
Can you give some examples for this?
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Eduardo
Can you give some examples for this?
Maybe this works: https://stackoverflow.com/questions/64364027/cannot-connect-to-rds-from-ec2 What I told you before is only applicable if you need access to the DB server outside AWS; I know because i was also sometime ago working in a Django project and I couldn't connect to the DB from my machine because of that.
Anonymous
Can anyone give me best template of carpooling with django??
Sourabh
Dear all Am new to python platform I want to learn DJango Someone plz help me by providing recourse links
Sourabh
Thank you so much
Mahdi
Hey guys Hope you all doing great. I have a form that uploads file for me and it has a js that shows a progress bar to user while uploading the file. Everything works fine on my local and a python host (that i deployed my project on it few days ago) I deployed my project on another server using gunicorn and now while uploading the form is getting this error : 502 (Bad Gateway) What is possibly wrong here?
Mahdi
The only way to know what's wrong is to look at the logs
Failed to load resource: the server responded with a status of 502 () This is the only log i got.
Yeganeh
Hi guys I’ve a django/React website I want user login in react side and go to django dashboard authenticated And logout from django dashboard and react can recognize user logout What’s your suggestions? Thanks a lot
nyctophile
Hi guys! I having problem with checking if form variables valid with form.is_valid() function and it returning False but i do not understand why I am getting false here is code ! Can anyone help with that any help appreciated
Noor
IS ANYONE HELP
Noor
I want to create a token in api
Noor
But i don't know how can i do this
Анатолий
Noor
Thnks
vijay
Thnks
Use django-jwt
عبد القيوم
I want to create a token in api
you can refer to django rest framework documentation. There you can find token athentication. Just follow the steps
Sea
I have created a project using Django rest framework and react and now I want to host it on AWS using ec2+s3+RDS, but I am not able to host both together. First do Django standalone and then reactjs . Any best suggestion on what is the best way to host a website and what should I do?
Wizard
Does anyone know how to make https://x.x.x.x/static/1.pdf work?
Muflone
Does anyone know how to make https://x.x.x.x/static/1.pdf work?
Configure your webserver, it's not related to Django
Prince Walgwang
Hello guys, Anyone has done django,celery and redis deployment to aws ec2 instance.I need assistance getting celery setup on aws ec2 instance
Jalil
I need app for invest money so can you help me anyone parson
Jalil
I pay money So can you have anyone parson make App so please contact me...
Karunakar
Hello guys Is there anyway to convert json into base64 without converting it into string?
Karunakar
As both will be having different base64 codes am struggling with it in phonepe pg Integration
bansh
Ok
Charly
Hello guys Is there anyway to convert json into base64 without converting it into string?
No you need to convert it to string I don't see what's the issue there.
Karunakar
Doragonsureiyā
I pay money So can you have anyone parson make App so please contact me...
Rule 🔟: Job posts are SPAM unless they meet the requirements. Read the rules for details.
Doragonsureiyā
Hello guys, Anyone has done django,celery and redis deployment to aws ec2 instance.I need assistance getting celery setup on aws ec2 instance
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Александр
Hi all. I made a website in Django, started making scripts in JS, how can I write to a database from JS? For example, the user clicked “add item to cart”, and so that an entry was made in the database?
Charly
Hi all. I made a website in Django, started making scripts in JS, how can I write to a database from JS? For example, the user clicked “add item to cart”, and so that an entry was made in the database?
You can't it does not work that way. You need to make a view to write to the database and you can call the view from JavaScript using ajax
Александр
can you tell me how to do this?
Александр
I can’t even understand it in my head yet😄
Александр
I made a form for a cart, collected request data in js, but I don’t know how to transfer it
Karunakar
Do u use any post method in form ??