Mirco
Hello guys , I'm trying to display/render PDF which is Stored in a media folder using iframe. But it's not rendering the PDF Can anybody help me with this ?
Show the link into the page, the user will be redirected to a new tab where browser can render PDF automatically
Mirco
and i should use only RequestFactory for this ?
Not mandatory, you can just use the test client Use request factory when you need to manipulate request meta, etc For other cases, test client is enough
Smile
Not mandatory, you can just use the test client Use request factory when you need to manipulate request meta, etc For other cases, test client is enough
that is, the essence of the test is to check the response from the server and that's it? фтв check which template is returned?
Mirco
that is, the essence of the test is to check the response from the server and that's it? фтв check which template is returned?
You can also check which template is returned, but it's more important to check the response content
Mirco
Doragonsureiyā
Ok thx
You're welcome! 😊
Smile
!yw
can i have one more question? should I test the context that is returned in the template? or i need to check only the status codes and the other is not so important ?
Smile
no also context
My test looks like this. More like testing urls than views or i am wrong?) class TestView(TestCase): def test_project_home(self): response = self.client.get(reverse('projects')).status_code self.assertEqual(response, 200)
Mirco
ok
You can have 200 and return nothing that you expect So it's a false positive
Vishal kumar
Hi please anyone suggest where should I learn django stepwise
Doragonsureiyā
Hi please anyone suggest where should I learn django stepwise
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Harshit
Hi please anyone suggest where should I learn django stepwise
Try to make its own Poll App and keep learning step wise
Vishal kumar
Ok
Ali
I want to share my web site on cpanel. I did everythink but I still get error 505
Ali
How can i fix this error
Ali
I did nothing changed
Ali
I get this error my error.log ImportError: win32 only and RuntimeError: populate() isnt reentrant
GOJO
For production what is the syntax of staticfiles and media root
Mirco
For production what is the syntax of staticfiles and media root
Path to your folders if you use your own VPS
Mirco
No ,I use cloud
Which one ?
Unknown
Can anyone tell me how to deployment python script
Unknown
Is there any software
Maxim
Can anyone tell me how to deployment python script
this is not a Python group, this is the Django group
Noddy
Can anyone tell me how to deployment python script
What kind of deployment you want?? Nginx gunicorn? Apache modwsgi?? Or just runserver on localhost??
Sharma
I am using Django-storages for uploading file on s3 Everything work fine on local as well as on server when using Django run server on server But exception arise when using nginx gunicorn with domain Exception is InMemoreyUplodedFile is not supported
Jay
ImportError: cannot import name 'Group' from 'channels
Jay
Getting this error
Neeraj
Neeraj: How can I create a real time notification when new record come in an database in django rest I am currently using django with react
Charly
Neeraj: How can I create a real time notification when new record come in an database in django rest I am currently using django with react
With django rest is not possible Maybe you can do something with Django-channels or any other websocket option
Neeraj
Okay
Charly
We can build micro service and use rabbitmq for sending notification
No, that doesnt work to send notifications to the frontend
zmod
anyone have ah complete guide a deployment of django projects to pythonanywhere
Doragonsureiyā
anyone have ah complete guide a deployment of django projects to pythonanywhere
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
Михаил
Hello. I have application with Django and channels. I want to use docker and nginx. I have a problems. Who can help me please?
Doragonsureiyā
Hello. I have application with Django and channels. I want to use docker and nginx. I have a problems. Who can help me please?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
highnes
Sharing my model here, im trying to add a new product and Product detail with rest api, can someone please help how to set my serializers. https://codeshare.io/LwVWg7
Caesar
is somebody tried to integrate paypal in django rest? I have faced with some issue through integration: I successfully created order and paid with bank card without login into my paypal account but i didn't get any notifications to my client-side or transfered moneys. Order status is APPROVED after paying. Is this the correct way or am i doing something wrong?
Shashidhar
TypeError at /delete/1 delete_data() got an unexpected keyword argument 'pk' Request Method: POST Request URL: http://127.0.0.1:8000/delete/1 Django Version: 4.1.5 Exception Type: TypeError Exception Value: delete_data() got an unexpected keyword argument 'pk'
Shashidhar
def delete_data(request): if request.method == 'POST': pi=user.objects.get(pk=id) pi.delete() return HttpResponseRedirect('/')
Shashidhar
pi=user.objects.get(id=id) i gave this also im getting same error
Nityananda
def delete_data(request,Id) that's it
Nityananda
Check your url page
Mohammad
Hello guys I wanted to implement Stripe for my website but i don't know how should i do it Actually i checked the documentation as well but i couldn't find any resource for django
cj
Hello guys I wanted to implement Stripe for my website but i don't know how should i do it Actually i checked the documentation as well but i couldn't find any resource for django
read the docs about using the web API of Stripe and implement it in your Django project, it's easy just like any other web API out there
Mohammad
Ok thanks
Mihail
on QueryDict('', mutable=True) method .update is working not the same as dict. I would like to overwrite all values by key and not only add them to a list. Are any ways to do it without .copy()?
Jose
can you help me pls in a task in django
Doragonsureiyā
can you help me pls in a task in django
We're not here to do your job for you. This group is to help you on specific issues you have in YOUR code, so you have to show the code you wrote by yourself and explain where and why you are stuck... as simple as that. 🤷🏻‍♂️
V
I got issue pythonanywhere doesn't work css files
Doragonsureiyā
I got issue pythonanywhere doesn't work css files
What have you tried to do, to solve that issue? Show your code (read rule 5⃣ first) and explain where, and why, you're stuck.
Jose
What have you tried to do, to solve that issue? Show your code (read rule 5⃣ first) and explain where, and why, you're stuck.
In my case i am stuck be django throws me FileNotFoundError error, but the path is in the code
sᴀɪᴅᴋᴏᴍɪʟ
Is there any way to store callable object or link to it in database?
sᴀɪᴅᴋᴏᴍɪʟ
http://xyproblem.info/
Ok, I have Services and several types of services. There's exactly one way to generate output from inputs for each type (several services could have the same type). The main thing I want to ask about is storing types of Services in the database to make possible CRUD these types without restarting the server
Ali
Hi I use signals but i can't fix it Error : 'RelatedManager' object has no attribute 'specialties'
Darasimi
Hello I am new to change and I want to know how to set the password of a registration page to the first name without the user filling in there password
Vinay
Hii Needed help with Django ASGI/channel connectivity. Unable to switch for Django development server to ASGI/channels Did everything correctly
NN
Did someone implement rangefilter on Django + Jet?
Lena
Greetings, How can I disable a Token created with SimpleJWT when logout?
Lena
And is the isAuthenticated statement in DRF's Permissions module dependent on Django Session?
Alex Random
hello guys /usr/local/lib/python3.10/dist-packages/django/core/management/commands/makemigrations.py:143: RuntimeWarning: Got an error checking a consistent migration history performed for database connection 'default': connection to server at "localhost" (127.0.0.1), port 5432 failed: fe_sendauth: no password supplied how could i solve this problem
Kola
I had one like this. It's a bug in the code. letter is not correct. harpography