Skip to content

Tag: django

How to create and save that file to Django model?

I want to create a file and save it to Django model within a view without creating any temporary files or anything like that. I plan to write a .txt file that contains information and I want to save the .txt file in the Django model. Does anyone know how to do this? Thank you Answer Yes – ContentFile. Assumin…

Django return, Profile matching query does nor exit

I’m new to Django and I’m working on an Instagram clone project as a beginner. And I didn’t get this error. I imported the user The Profile class is created here, and it is successfully migrated. and this is my views.py someone please answers this where is my mistake? Answer check in your da…

OperationalError at / no such table: users_user

I had a model Profile which was an extension to my User model which was the ForeignKey of my Post model, but I changed it to an AbstractUser and now if I try migrating or running and refreshing the page the server I get an error. models.py settings.py error message after I try migrating Answer I easily solved…

How to send link include id in email user in django?

please i need to help i send this lien http://127.0.0.1:8000/benevole/demande_participer/id:?/ in email user but id is not Read in email Thanks in advance —— this is views.py => —this is email_template.html Answer You need to pass the context to the render to string method, let’s sa…

Django no reverse match at

I have a problem with my code I’m trying to create an edit button to modify the employees subsequently displayed and make the changes but I can’t display with dynamic url in django. views.py url.py employe.html models.py screenShot of the page Answer The problem is here: You don’t have emplo…