When you do a CRUD operation , you can use Django ORMs in view.py.
Regards,
Amitesh Sahay On Thursday, 29 August, 2019, 06:54:35 pm IST, Mario R. Osorio <nimbiotics@gmail.com> wrote:
That code is meant for you to type it in the python console however, you could also include it pretty much anywhere in your code.
On Wednesday, August 28, 2019 at 9:15:20 AM UTC-4, Vahid Asadi wrote:
On Wednesday, August 28, 2019 at 9:15:20 AM UTC-4, Vahid Asadi wrote:
Hi .
when i read the django docs,it suggested that running some code but it does not note that where to write this piece of code . the code is :from django.contrib.auth.models import Useru = User.objects.get(username=' john')u.set_password('new password')u.save()
i know that i can run it in django shell (manage.py shell)
but i want to write these in a file(its some confusing that every code in views.py should return a http response but this type of commands does not return any respone)
where should i put this code ??thanks for your attention.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b6b3b24e-b34e-42e6-b637-3e6a30ca2823%40googlegroups.comYou received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
.
No comments:
Post a Comment