Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Mar 16, 2019 14:43
and says that "password: ["This field cannot be null."],"
Mar 16, 2019 14:42
I have a modelform here pastebin.com/77UY5Ri1
I use it in view
            a = User.objects.get(id=request.user.id)
            f = UpdatePassword(request.POST, instance=a)
            # check whether it's valid:
            if f.is_valid():
                f.save()
Mar 16, 2019 14:36
I get error password: ["This field cannot be null."], and it is not, but why?
Mar 16, 2019 14:29
thanks a lot with that self.
Mar 16, 2019 14:27
all the code looks like this pastebin.com/77UY5Ri1
Mar 16, 2019 14:22
which can be the problem?
Mar 16, 2019 14:21
I have this:

    def clean_password(self):
        user = super(UpdatePassword, self)
        valid = self.user.check_password(self.cleaned_data['password'])
        if not valid:
            raise forms.ValidationError("Password Incorrect")
And I get this error

  File "/mnt/d/adnewbies/website/forms.py", line 58, in clean_password
    valid = self.user.check_password(self.cleaned_data['password'])
AttributeError: 'UpdatePassword' object has no attribute 'user'
Mar 16, 2019 14:19
Hello
Mar 13, 2019 16:24
Thanks
Mar 13, 2019 16:13
If I use {{ data.0 }}, returns {'avatar': u'media/Capture.PNG', 'email': u'[email protected]', ...}
Mar 13, 2019 16:11
I have a queryset in django and return in template with {{data}} result is <QuerySet [{'avatar': u'media/Capture.PNG', 'email': u'[email protected]', ...}]>.Is there is a possibility to extract only one column? like {{ data.email }}
Mar 13, 2019 16:05
I need some help with django can someone help me?
Mar 13, 2019 16:04
hello
Dec 6, 2018 10:21
hello
Dec 5, 2018 20:43
I understand you, and I appreciate it
Dec 5, 2018 20:38
but static folder works with css js
Dec 5, 2018 20:37
I also use virtualenv
Dec 5, 2018 20:36
is in /djangoproject/media
Dec 5, 2018 20:33
yes, but even if I access image directly in the browser 127.0.0.1:8000/media/image.png , not working
Dec 5, 2018 20:28
after run results <img src="media/image.png">
Dec 5, 2018 20:27
Dec 5, 2018 20:26
you know how to fix it?
Dec 5, 2018 20:25
but I only get The current path, /media/image.png, didn't match any of these.
Dec 5, 2018 20:23
<img src="{{ MEDIA_URL }}image.png">
Dec 5, 2018 20:23
I've been trying for a few hours to get a image from media folder on django
Dec 5, 2018 20:21
hello