Re: confusing about running some codes in django

2019-08-29 Thread Vahid Asadi
But when I put this code in model.py, when I run the server it returns an error about constraints failed but the user was added in Django admin users. Why this happen?? On Aug 29, 2019 5:54 PM, "Mario R. Osorio" wrote: > That code is meant for you to type it in the python console however, you >

Re: confusing about running some codes in django

2019-08-29 Thread Vahid Asadi
Thanks -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit

Re: confusing about running some codes in django

2019-08-29 Thread 'Amitesh Sahay' via Django users
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 wrote: That code is meant for you to type it in the python console however, you could also include it pretty much anywhere in

Re: confusing about running some codes in django

2019-08-29 Thread Mario R. Osorio
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: > > Hi . > when i read the django docs,it suggested that running some code but it > does not

confusing about running some codes in django

2019-08-28 Thread Vahid Asadi
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 User u = User.objects.get(username='john') u.set_password('new password') u.save() i know that i can run