Dani
Hi guys, any course that you recommend on any platform? I have an intermediate base in Python, I want to learn Django, especially Backend, I want to learn how to create Apis
Best tutorial on using Django: https://docs.djangoproject.com/en/4.0/intro/tutorial01/ Otherwise, just search it, there are tons of free courses on Django
ZeroCool
They recommend using the Django ORM or it is preferable to use an already created database
ZeroCool
?
Dani
They recommend using the Django ORM or it is preferable to use an already created database
Django orm isn't a database, it's more of a tool. It's one of the best features of Django, you use to interact with Django. The database choice is yours to be made. The tutorial uses sqlite as a default db, you can plug in any other database (postgre, mysql, etc..)
Hamza
Hello Anyone try to host the project on pythonanywhere and can help me about something?
Dani
Yes, what I mean is that it is recommended to use the Django ORM to create a database
Yes, using Django's ORM makes 99% of the tasks easier. There are a few cases where developers choose not to use it, but that rarely happens, and mostly in large projects with a lot of individual demands for working with SQL. So basically, yes, always go with the ORM
ZeroCool
I work with mysql so i will definitely go with the ORM, thanks for the info
IZUKU
503 Service Unavailable The server is temporarily busy, try again later All am getting is this error no matter whatever i do
IZUKU
You need to check the logs
157.42.230.113 - - [28/Jul/2022:16:57:50 +0200] "GET / HTTP/1.1" 503 719 "-" "Mozilla/5.0 (Linux; Android 10; POCO F1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36"
IZUKU
This is in log file
Charly
This is in log file
That looks like a webserver log instead of the application log
Anonymous
hi Is there anyone who knows Django well? I need a mentor
Doragonsureiyā
hi Is there anyone who knows Django well? I need a mentor
This is neither a job board nor a bulletin board.
Phansivang
some_field = forms.ModelChoiceField(choice=modeltable.objects.all())
Good but how can I use with filters i want to specific user
Shinzo
Hello I have problem to work git In the remote server we have 4 branch But when i clone in my local system just i have master branch Anyway i use Git checkout For get another branch but not working
Doragonsureiyā
Hello I have problem to work git In the remote server we have 4 branch But when i clone in my local system just i have master branch Anyway i use Git checkout For get another branch but not working
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.
Baljinder
Hello everyone i had made a contact page and i added a image in css file that image is not showing up rest of web page is working fine (I'm making a django project so i loaded html and static file everything is working but image from css file is not showing on web page
Baljinder
Any suggestions ?
Baljinder
Hello Check image path
I had added /static/images/imagename on the background url tag in cas
Григорий
Hello guys. I have a question. How i can delete media files from filesystem after deleting the model instance. There's my models https://dpaste.org/upbmD
Григорий
I searched for a long time, but I didn't find the answer
Cheshtaaaaaaa
I am learning django Today's is the first day tho But i made my first project and i got some errors Can someone please help me fix it?
Dani
Hello guys. I have a question. How i can delete media files from filesystem after deleting the model instance. There's my models https://dpaste.org/upbmD
Django doesn't delete media files upon the deletion of model instances, you're supposed to handle that yourself. You can use celery or some from of task scheduler to periodically delete files. You can also use signals, this is an example: https://stackoverflow.com/questions/16041232/django-delete-filefield
Baljinder
Use inspect in browser and see finally path
It's solved thanks wait for the next error 😬
Wanna_Phonila
Hi! What the best practices for data migration in django, if classic RunPython failing due to memory? I have simple .filter(...).update(...) and replacing many2many by .remove() and adds one new relation. But migation killed by os.
Ulug'bek | Python Developer
How to auto insert the current user when creating an object in django admin - Django
Tajammul
Hello guys I have 3 models in my project all have one same field and I want to show these 3 models data in one table is it possible please help me
Sunil
Somebody can help me that generating dynamic PDF of HTM CSS3
Sunil
Somebody can help me that generating dynamic PDF of HTM CSS3
It must render css because I have to generate dynamic admit Card in pdf
Doragonsureiyā
Somebody can help me that generating dynamic PDF of HTM CSS3
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.
Maxim
Its Django related questions I have to generate dynamic pdf in my Django project
Django-related project does not mean Django-related question
Sunil
google django generate pdf
I have tried on Google but I couldn't find solutions where I could render css in pdf
Sunil
Use whkhtmltopdf
It render css?
Dani
It render css?
It would take you exactly 10 seconds to find out the answer to that on your own. It's in the description https://django-wkhtmltopdf.readthedocs.io/en/latest/
Bekzat
Guys, question about idempotency key. Lets say that I have failed request and in db I save it status as failed. Then say we have another request with the failed idempotency key. Which status I should return ? 200 with object status: "failed" ? Or 400, or 500 ?
Mirco
never return 500, 5xx is server unexpected errors
IZUKU
I want help , i have a hosting of cpanel but i can able to run my project there Kindly help i can give cpanel id n pass all u need to host one normal site i ll update it then
░R░E░B░E░L░ ░I░S░ ░H░E░R░E░
Anyone can edit the django code i need some changes in code
Maxim
Anyone can edit the django code i need some changes in code
we only edit our own code if you want to hire someone, you have the wrong group
Hamza
Good evening I want to do schedule task in pythonanywhere anyone can help me about something 🙄
Максим
Good afternoon. I'm new to django, just learning. I faced such problem: I need to make a user data change page. In the form there is also a field "password" and "confirm_password" for change password. However, when I save the form, the password changes to an empty string. I tried to override the save method, but it does not work as expected - the contents of the password field are deleted in the database. For the second day I have been doing a search in Google and turned to Stackoverflow. But unfortunately I couldn't solve the problem. Sorry for bad English, if anything, I'm not a native speaker =)
Максим
We need to see your form. You shouldn't be changing the password, when the user edits his information. Changing the password should be done on its own
Unfortunately Stack OverFlow has down at this time. Can I send the code to the chat? or is there another way?
Dani
Unfortunately Stack OverFlow has down at this time. Can I send the code to the chat? or is there another way?
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Максим
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Thanks! This is form.py https://dpaste.org/jphCr This is views.py https://dpaste.org/Xi5Af
Dani
Thanks! This is form.py https://dpaste.org/jphCr This is views.py https://dpaste.org/Xi5Af
Why do you want to change the password? The password shouldn't be changed, you should just validate it
Dani
And I'd use user.check_password(password), it's cleaner and more secure
Максим
Why do you want to change the password? The password shouldn't be changed, you should just validate it
I need to be able to change the password on this page if required. Or change any other field without touching the password. And all this should be on one page. Is it possible?
Dani
I need to be able to change the password on this page if required. Or change any other field without touching the password. And all this should be on one page. Is it possible?
I mean, it's possible, but don't you need to check if the user's password matches his current password? Or is this some sort of admin function?
Максим
I mean, it's possible, but don't you need to check if the user's password matches his current password? Or is this some sort of admin function?
I need to check the password and its match only if the user changes it. If he makes a change to any other field, then he is not required to enter a password.
Dani
Try printing out self.cleaned_data["password"] And see is it's working fine
Hamza
YouTube has dozens of videos about that!
I watch more But the proplem still I want to delete the data from table daily but the schedule code doesn't run
Yazan
i need help with django fcm push notification what do i have to configure to make it possible to work?
Salim
What are the best jobs platform for django developers?
Максим
Try printing out self.cleaned_data["password"] And see is it's working fine
Do you mean delete self.cleaned_data["password"]? In 1 case when I type some data in the field, for example, "name", it changes password in database. In 2 case - it saves in database empty field. I watched it in pgadmin4 link to cases - https://dpaste.org/vxDkJ
Dani
I meant put in a print (self.cleaned_data["password"], file=stderr), so you can see if the password is being sent over successfully. Why do you use user.set_password() without an input? It'll set the user as having an unusable password
Максим
I meant put in a print (self.cleaned_data["password"], file=stderr), so you can see if the password is being sent over successfully. Why do you use user.set_password() without an input? It'll set the user as having an unusable password
Because I have a task to place on one page a form for changing user data and changing the password. Maybe there is a sense to just making 2 forms on one page? To change user data and change password. I read that it is possible to make multiple forms and use one button to submit
Anonymous
I'm uploading my app to heroku. i get the error t=error code=H10 desc="App crashed" method=GET path="/" status="503" how can ı solved?