Wednesday, October 31, 2018

Use Email to Login With Django Auth

How could i go about allowing people to also use their email to sign into Django instead of a username? I have done research my self and tried creating my own backend for it. But it doesn't work.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d6046362-5149-4edf-adc8-273547213748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Prepopulate blog in b.entry_set.all()[i].blog ?

It seems to be a bug as reported in https://code.djangoproject.com/ticket/29908. The ForeignKey must use to_field to reproduce the problem.

On Saturday, October 20, 2018 at 4:38:51 AM UTC-4, Carsten Fuchs wrote:
Can anyone help please?

Am 2018-10-11 um 16:58 schrieb Carsten Fuchs:
> Dear Django group,
>
> with Django 1.11.15, using the example models Blog and Entry at
> <https://docs.djangoproject.com/en/2.1/topics/db/queries/#related-objects>
> for reference, I have code like this:
>
>      b = Blog.objects.get(name="...")
>      for e in b.entry_set.all():
>          print(e.blog)
>
> Obviously, e.blog == b, but I found that for each e, the access to
> e.blog causes a subquery to fetch the blog object.
>
> While I understand the concepts of select_related() and
> prefetch_related(), I was surprised that the e.blog attributes are not
> prepopulated with b. Why is that and what is the proper way to fix the
> problem?
>
> Best regards,
> Carsten
>

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8466e1c0-8e47-4e69-ae8b-9861014f9878%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Error in function to return permissions

Thank you!

Sincerely yours,

Joel G Mathew


On Wed, 31 Oct 2018 at 21:36, Stephen J. Butler
<stephen.butler@gmail.com> wrote:
>
> @login_required needs "request" as the first parameter.
>
> On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew <joel@joel.su> wrote:
>>
>> I have a custom function to check if a user is authorized to do
>> certain functions:
>>
>> @login_required
>> def checkpermission(request, permiss):
>> username = request.user.username
>> print(f"username is {username}")
>> print(f"User.objects.filter() is {User.objects.filter()}")
>> userobj = User.objects.get(username=username)
>> print(dir(userobj))
>> print(userobj.user_permissions.all())
>> print(Permission.objects.filter(group__user=userobj))
>> perms = getpermissions(userobj)
>> for perm in perms:
>> p = perm.name.lower().replace(" ", "_")
>> if permiss == p:
>> print("Has permission: %s" % p)
>> return True
>> print("No")
>> return False
>>
>> def getpermissions(userobj):
>> if userobj.is_superuser:
>> return Permission.objects.all()
>> return userobj.user_permissions.all() |
>> Permission.objects.filter(group__user=userobj)
>>
>> The problem arises if I write the previous function with decorator:
>>
>> @login_required
>> def getpermissions(userobj):
>> if userobj.is_superuser:
>> return Permission.objects.all()
>> return userobj.user_permissions.all() |
>> Permission.objects.filter(group__user=userobj)
>>
>> In this case, I get the error:
>>
>> 2018-10-31 21:26:51,239 django.request ERROR Internal Server Error:
>> /clinic/joelent/doctors
>> Traceback (most recent call last):
>> File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/exception.py",
>> line 34, in inner
>> response = get_response(request)
>> File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
>> line 126, in _get_response
>> response = self.process_exception_by_middleware(e, request)
>> File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
>> line 124, in _get_response
>> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>> File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
>> line 21, in _wrapped_view
>> return view_func(request, *args, **kwargs)
>> File "/home/joel/myappointments/clinic/views.py", line 2797, in
>> clinicdoctorlist
>> if checkpermission(request, "can_change_doctor") and
>> HasMembership(request, cliniclabel):
>> File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
>> line 21, in _wrapped_view
>> return view_func(request, *args, **kwargs)
>> File "/home/joel/myappointments/clinic/views.py", line 2970, in
>> checkpermission
>> perms = getpermissions(userobj)
>> File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
>> line 20, in _wrapped_view
>> if test_func(request.user):
>> AttributeError: 'User' object has no attribute 'user'
>>
>> Why would this be happening?
>>
>> Sincerely yours,
>>
>> Joel G Mathew
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA%3Diw_94fELQWM873_y6w%2B0S8vCA2xtO44sG45dqMp4DSC8qeQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD4ANxVoNhmE78-n0SQFn1QFFz1O9-wXBs9p5G8jfsiXa190Kw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA%3Diw_9diL9pWgww7-rsgUDsBXp07jOipi%3DouTqTFZ%2B4M-Cr0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Error in function to return permissions

@login_required needs "request" as the first parameter.

On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew <joel@joel.su> wrote:
I have a custom function to check if a user is authorized to do
certain functions:

@login_required
def checkpermission(request, permiss):
    username = request.user.username
    print(f"username is {username}")
    print(f"User.objects.filter() is {User.objects.filter()}")
    userobj = User.objects.get(username=username)
    print(dir(userobj))
    print(userobj.user_permissions.all())
    print(Permission.objects.filter(group__user=userobj))
    perms = getpermissions(userobj)
    for perm in perms:
        p = perm.name.lower().replace(" ", "_")
        if permiss == p:
            print("Has permission: %s" % p)
            return True
    print("No")
    return False

def getpermissions(userobj):
    if userobj.is_superuser:
        return Permission.objects.all()
    return userobj.user_permissions.all() |
Permission.objects.filter(group__user=userobj)

The problem arises if I write the previous function with decorator:

@login_required
def getpermissions(userobj):
    if userobj.is_superuser:
        return Permission.objects.all()
    return userobj.user_permissions.all() |
Permission.objects.filter(group__user=userobj)

In this case, I get the error:

2018-10-31 21:26:51,239 django.request ERROR    Internal Server Error:
/clinic/joelent/doctors
Traceback (most recent call last):
  File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 34, in inner
    response = get_response(request)
  File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/joel/myappointments/clinic/views.py", line 2797, in
clinicdoctorlist
    if checkpermission(request, "can_change_doctor") and
HasMembership(request, cliniclabel):
  File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/joel/myappointments/clinic/views.py", line 2970, in
checkpermission
    perms = getpermissions(userobj)
  File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
line 20, in _wrapped_view
    if test_func(request.user):
AttributeError: 'User' object has no attribute 'user'

Why would this be happening?

Sincerely yours,

Joel G Mathew

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA%3Diw_94fELQWM873_y6w%2B0S8vCA2xtO44sG45dqMp4DSC8qeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD4ANxVoNhmE78-n0SQFn1QFFz1O9-wXBs9p5G8jfsiXa190Kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

Yes you right Tim, i have misunderstood the purpose of height_field and width_field, i'm new in Django :)
Gonna check more in the documentation and try a third-party app to resize images.
Thanks a lot for the help. I appreciate.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6bb08c5c-69da-4372-a3ae-282f4edafc02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Error in function to return permissions

I have a custom function to check if a user is authorized to do
certain functions:

@login_required
def checkpermission(request, permiss):
username = request.user.username
print(f"username is {username}")
print(f"User.objects.filter() is {User.objects.filter()}")
userobj = User.objects.get(username=username)
print(dir(userobj))
print(userobj.user_permissions.all())
print(Permission.objects.filter(group__user=userobj))
perms = getpermissions(userobj)
for perm in perms:
p = perm.name.lower().replace(" ", "_")
if permiss == p:
print("Has permission: %s" % p)
return True
print("No")
return False

def getpermissions(userobj):
if userobj.is_superuser:
return Permission.objects.all()
return userobj.user_permissions.all() |
Permission.objects.filter(group__user=userobj)

The problem arises if I write the previous function with decorator:

@login_required
def getpermissions(userobj):
if userobj.is_superuser:
return Permission.objects.all()
return userobj.user_permissions.all() |
Permission.objects.filter(group__user=userobj)

In this case, I get the error:

2018-10-31 21:26:51,239 django.request ERROR Internal Server Error:
/clinic/joelent/doctors
Traceback (most recent call last):
File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 34, in inner
response = get_response(request)
File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/joel/.local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/joel/myappointments/clinic/views.py", line 2797, in
clinicdoctorlist
if checkpermission(request, "can_change_doctor") and
HasMembership(request, cliniclabel):
File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/joel/myappointments/clinic/views.py", line 2970, in
checkpermission
perms = getpermissions(userobj)
File "/home/joel/.local/lib/python3.6/site-packages/django/contrib/auth/decorators.py",
line 20, in _wrapped_view
if test_func(request.user):
AttributeError: 'User' object has no attribute 'user'

Why would this be happening?

Sincerely yours,

Joel G Mathew

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA%3Diw_94fELQWM873_y6w%2B0S8vCA2xtO44sG45dqMp4DSC8qeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

You've misunderstood the purpose of height_field and width_field. Please read the documentation: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ImageField.height_field

You need to use a third-party app to do image resizing. Check out https://djangopackages.org/grids/g/thumbnails/.

On Wednesday, October 31, 2018 at 11:44:17 AM UTC-4, Pacôme Avahouin wrote:
My model fields look like this:

class CustomAbstractUser(AbstractBaseUser, PermissionsMixin):
    """
    An abstract base class implementing a fully featured User model with
    admin-compliant permissions.

    Email and password are required. Other fields are optional.
    """
    email = models.EmailField(
        _('email address'),
        unique=True,
        error_messages={
            'unique': _("A user with that email address already exists."),
        },
    )
    first_name = models.CharField(_('first name'), max_length=30, blank=True)
    last_name = models.CharField(_('last name'), max_length=150, blank=True)
    is_staff = models.BooleanField(
        _('staff status'),
        default=False,
        help_text=_('Designates whether the user can log into this admin site.'),
    )
    is_active = models.BooleanField(
        _('active'),
        default=True,
        help_text=_(
            'Designates whether this user should be treated as active. '
            'Unselect this instead of deleting accounts.'
        ),
    )
    date_joined = models.DateTimeField(_('date joined'), default=timezone.now)

    phone_number = models.PositiveSmallIntegerField(null=True, blank=True)
    current_title = models.CharField(max_length=30, blank=True)
    website_url = models.URLField(blank=True)
    avatar = models.ImageField(upload_to='accounts/%Y/%m/%d',
                               height_field='160', width_field='160',
                               max_length=100, null=True, blank=True
                               )

    objects = CustomUserManager()

    EMAIL_FIELD = 'email'
    USERNAME_FIELD = 'email'


And this is the traceback:



Environment:


Request Method: POST

Django Version: 2.1.2
Python Version: 3.7.0
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap4',
 'accounts',
 'posts']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "D:\ISMAEL\APPS\EMX\emlaxpress\accounts\views.py" in dispatch
  36.         return super().dispatch(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  194.         return super().post(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  141.         if form.is_valid():

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in is_valid
  185.         return self.is_bound and not self.errors

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in errors
  180.             self.full_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in full_clean
  383.         self._post_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in _post_clean
  398.             self.instance = construct_instance(self, self.instance, opts.fields, opts.exclude)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in construct_instance
  63.         f.save_form_data(instance, cleaned_data[f.name])

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in save_form_data
  317.             setattr(instance, self.name, data or '')

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\functional.py" in __setattr__
  244.             setattr(self._wrapped, name, value)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in __set__
  346.             self.field.update_dimension_fields(instance, force=True)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in update_dimension_fields
  434.             (self.width_field and not getattr(instance, self.width_field)) or

Exception Type: AttributeError at /user/edit-profile/
Exception Value: 'CustomUser' object has no attribute '160' 


Really Appreciate the help

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0dff909f-51ac-4b24-922e-eea3d995cdea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

My model fields look like this:

class CustomAbstractUser(AbstractBaseUser, PermissionsMixin):
    """
    An abstract base class implementing a fully featured User model with
    admin-compliant permissions.

    Email and password are required. Other fields are optional.
    """
    email = models.EmailField(
        _('email address'),
        unique=True,
        error_messages={
            'unique': _("A user with that email address already exists."),
        },
    )
    first_name = models.CharField(_('first name'), max_length=30, blank=True)
    last_name = models.CharField(_('last name'), max_length=150, blank=True)
    is_staff = models.BooleanField(
        _('staff status'),
        default=False,
        help_text=_('Designates whether the user can log into this admin site.'),
    )
    is_active = models.BooleanField(
        _('active'),
        default=True,
        help_text=_(
            'Designates whether this user should be treated as active. '
            'Unselect this instead of deleting accounts.'
        ),
    )
    date_joined = models.DateTimeField(_('date joined'), default=timezone.now)

    phone_number = models.PositiveSmallIntegerField(null=True, blank=True)
    current_title = models.CharField(max_length=30, blank=True)
    website_url = models.URLField(blank=True)
    avatar = models.ImageField(upload_to='accounts/%Y/%m/%d',
                               height_field='160', width_field='160',
                               max_length=100, null=True, blank=True
                               )

    objects = CustomUserManager()

    EMAIL_FIELD = 'email'
    USERNAME_FIELD = 'email'


And this is the traceback:



Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/user/edit-profile/

Django Version: 2.1.2
Python Version: 3.7.0
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap4',
 'accounts',
 'posts']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "D:\ISMAEL\APPS\EMX\emlaxpress\accounts\views.py" in dispatch
  36.         return super().dispatch(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  194.         return super().post(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  141.         if form.is_valid():

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in is_valid
  185.         return self.is_bound and not self.errors

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in errors
  180.             self.full_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in full_clean
  383.         self._post_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in _post_clean
  398.             self.instance = construct_instance(self, self.instance, opts.fields, opts.exclude)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in construct_instance
  63.         f.save_form_data(instance, cleaned_data[f.name])

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in save_form_data
  317.             setattr(instance, self.name, data or '')

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\functional.py" in __setattr__
  244.             setattr(self._wrapped, name, value)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in __set__
  346.             self.field.update_dimension_fields(instance, force=True)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in update_dimension_fields
  434.             (self.width_field and not getattr(instance, self.width_field)) or

Exception Type: AttributeError at /user/edit-profile/
Exception Value: 'CustomUser' object has no attribute '160' 


Really Appreciate the help

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/06cb844b-6dd2-473f-9efe-b299feee406d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

height_field and width_field should be strings. What's the error and what does your model fields look like?

On Wednesday, October 31, 2018 at 10:53:53 AM UTC-4, Pacôme Avahouin wrote:
Tim you just saved me right now:) I have spent the all night trying to figure it out.
Thanks a lot.
Now when i removed the width_field it works fine. But how to define height_field and width_field directly from the model?
Cause when i put their values in quotes i got another error.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8a125129-305b-4bcb-b6c3-74c728d47ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

Tim you just saved me right now:) I have spent the all night trying to figure it out.
Thanks a lot.
Now when i removed the width_field it works fine. But how to define height_field and width_field directly from the model?
Cause when i put their values in quotes i got another error.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a1feee26-1264-4a55-bef0-9de357283cd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

It looks like the width_field option on the model field isn't a string.

On Wednesday, October 31, 2018 at 10:28:42 AM UTC-4, Pacôme Avahouin wrote:
Hello Tim,

Thanks for answering.

Here is the complete traceback.
By the way when i commented out the 'upload_file' function still i'm getting the same error. 
I believe the origin might be somewhere else.



Environment:


Request Method: POST

Django Version: 2.1.2
Python Version: 3.7.0
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap4',
 'accounts',
 'posts']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "D:\ISMAEL\APPS\EMX\emlaxpress\accounts\views.py" in dispatch
  36.         return super().dispatch(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  194.         return super().post(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  141.         if form.is_valid():

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in is_valid
  185.         return self.is_bound and not self.errors

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in errors
  180.             self.full_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in full_clean
  383.         self._post_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in _post_clean
  398.             self.instance = construct_instance(self, self.instance, opts.fields, opts.exclude)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in construct_instance
  63.         f.save_form_data(instance, cleaned_data[f.name])

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in save_form_data
  317.             setattr(instance, self.name, data or '')

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\functional.py" in __setattr__
  244.             setattr(self._wrapped, name, value)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in __set__
  346.             self.field.update_dimension_fields(instance, force=True)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in update_dimension_fields
  434.             (self.width_field and not getattr(instance, self.width_field)) or

Exception Type: TypeError at /user/edit-profile/
Exception Value: getattr(): attribute name must be string
 

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/01a9fa18-7c86-4ddc-bea7-0886da8f87ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

Hello Tim,

Thanks for answering.

Here is the complete traceback.
By the way when i commented out the 'upload_file' function still i'm getting the same error. 
I believe the origin might be somewhere else.



Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/user/edit-profile/

Django Version: 2.1.2
Python Version: 3.7.0
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap4',
 'accounts',
 'posts']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "D:\ISMAEL\APPS\EMX\emlaxpress\accounts\views.py" in dispatch
  36.         return super().dispatch(*args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  194.         return super().post(request, *args, **kwargs)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\views\generic\edit.py" in post
  141.         if form.is_valid():

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in is_valid
  185.         return self.is_bound and not self.errors

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in errors
  180.             self.full_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\forms.py" in full_clean
  383.         self._post_clean()

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in _post_clean
  398.             self.instance = construct_instance(self, self.instance, opts.fields, opts.exclude)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\forms\models.py" in construct_instance
  63.         f.save_form_data(instance, cleaned_data[f.name])

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in save_form_data
  317.             setattr(instance, self.name, data or '')

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\utils\functional.py" in __setattr__
  244.             setattr(self._wrapped, name, value)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in __set__
  346.             self.field.update_dimension_fields(instance, force=True)

File "C:\Users\ATM\Anaconda3\envs\EmXp\lib\site-packages\django\db\models\fields\files.py" in update_dimension_fields
  434.             (self.width_field and not getattr(instance, self.width_field)) or

Exception Type: TypeError at /user/edit-profile/
Exception Value: getattr(): attribute name must be string
 

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e2645a61-c537-42f9-ac2c-66d352544cf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to edit model.py and serializer so I can recieve contact":{"name":"asdf","email":"ma...@email.com","phone":"1111111111"}}

So Do you mean i change the angular?
Of my models file? If the last apply how?
Sincere,
Tim

On Wednesday, October 31, 2018 at 12:10:51 PM UTC+1, Krishnasagar Subhedarpage wrote:
Hi Tim,

IMHO, you can change angular's request body as per model defined in app so that, serializer can validate and save into table.  

Regards,
Krishna



On Wed, 31 Oct 2018 at 15:11, Tim Vogt <timt...@gmail.com> wrote:
Hi group ;-)

I have a little challenge.

We have a frontend angular api. Wich sinds data to my django backend from an input form.

And Contact in the frontend How to just my serializer / models file right so the contact data is in my database?


contact?: {
name: string;
email: string;
phone: string;
}

What gets forwarded to my backend?
{"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0","contact":{"name":"asdf","email":"ma...@email.com","phone":"1111111111"}}

this part is sending the data and arrives in the database.√

{"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0",


This part is my challenge and I made this ajustment in my models.py file and serialisers.py


"contact":{"name":"asdf","email":"ma...@email.com","phone":"1111111111"}}


What are the files?

the angular file:

export interface IWorkPlace {
id: string;
name: string;
address: string;
description: string;
totalSpots: number;
spotsTaken: number;
location: [number, number];
contact?: {
name: string;
email: string;
phone: string;
}
}

my models.py


name = models.CharField(max_length=250)
address = models.CharField(max_length=250)
description = models.CharField(max_length=250)
totalSpots = models.CharField(max_length=250)
spotsTaken =models.CharField(max_length=250, blank=True)

image = models.ImageField(upload_to='workplace_image', blank =True)
location = models.CharField(max_length=250)
name = models.CharField(max_length=150)
email = models.EmailField(max_length=100, default='ma...@example.com',blank=False)
phone = models.CharField(max_length=14 ,default='1111111111"', blank=False)



my serializer 
class Workspace_bookingSerializer(serializers.ModelSerializer):
class Meta:
model = Workspace_booking
fields = ( 'id','name','address','description','totalSpots','spotsTaken','location','name','email','phone')




Sincere!

Tim

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7ed5caaf-7140-4b1f-a490-916a7c67d45d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f43fa087-8f02-4a12-a271-a1b7a24017f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Can't Upload Image Field With Django 2.1

It would be helpful to see the complete traceback. What you provided doesn't show where the exception originates.

On Tuesday, October 30, 2018 at 10:38:38 PM UTC-4, Pacôme Avahouin wrote:
Hello guys, 

I'm trying to upload user avatar (ImageField type) with my own custom user model following the documentation like this:

class MyUsersProfileView(UpdateView):

# First try
def upload_file(request):
    if request.method == 'POST':
        form = MyModelFormWithFileField(request.POST, request.FILES)
        if form.is_valid():
            # file is saved
            form.save()
            return HttpResponseRedirect('/success/url/')
    else:
        form = MyModelFormWithFileField()
    return render(request, '/my-model-form-with-the-upload-field.html', {'form': form})

# Second try
def upload_file(request):
    if request.method == 'POST':
        form = MyUploadFileForm(request.POST, request.FILES)
        if form.is_valid():
            instance = MyModelFormWithFileField(file_field=request.FILES['file'])
            instance.save()
            return HttpResponseRedirect('/success/url/')
    else:
        form = MyUploadFileForm()
    return render(request, 'my-model-form-with-the-upload-field.html', {'form': form})


but i'm always getting the same error:

TypeError at /user/edit-profile/  getattr(): attribute name must be string  Request Method:	POST  Request URL:	http://127.0.0.1:8000/user/edit-profile/

All other fields got updated but not the profile picture.
I have tried everything but couldn't figure it out.
Any help would be appreciate.
Thanks in advance.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/17436ab7-ed23-4420-98df-c04705c9074b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django unit test - response context is None

Hi Jason,

Thanks for your prompt response. 

I was using Django TestCase but it wasn't working then. Hence, I resorted to unittest as shown in Django 1.11 documentation. Also, the attribute was working fine in django shell. 

Please refer to the documentation here:
https://docs.djangoproject.com/en/1.11/topics/testing/tools/#overriding-settings

I will check the link you have provided for the solution.

Thanks.

On Wednesday, October 31, 2018 at 6:19:40 PM UTC+5:30, Jason wrote:
Two things I can see:

you should be inheriting from TestCase in django.test, not unittest.  
Second, you should find your answer at https://stackoverflow.com/questions/27136048/django-unit-test-response-context-is-none . I believe the attribute you're trying to access was deprecated in django 1.8 and was probably removed in 1.11

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9dfbf9e5-c4e3-480b-bb47-201949005190%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django unit test - response context is None

Two things I can see:

you should be inheriting from TestCase in django.test, not unittest.  
Second, you should find your answer at https://stackoverflow.com/questions/27136048/django-unit-test-response-context-is-none . I believe the attribute you're trying to access was deprecated in django 1.8 and was probably removed in 1.11

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/36a1e72e-59d8-49d5-9764-2fdf5ec4e986%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Django unit test - response context is None

Hi,

We are using django 1.11 for our ecommerce site.

We are developing unit tests for our views using django testing framework. We are facing issue with a simple implementation:

import unittest


from django.urls import reverse

from django.test import Client


class ViewTests(unittest.TestCase):

    def setUp(self):

        self.client = Client()


    def test_View(self):

        url = '/some-url/'

        

        response = self.client.get(url)

        products = response.context['products']


In the above test case, response.context is coming out to be None and hence, response.context['products'] is throwing exception. Whereas when I run the same on django admin shell, response.context has context object dict. 


I am quite confused why this is happening. I couldn't find any reason in the django documents.


Would really appreciate if someone could help me with the above.  


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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8e487599-2179-4de6-9a4a-32e108778991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: foreign key is not working

Use:
on_delete = models.CASCADE
In Foreign Key

On Wed 31 Oct, 2018, 5:15 PM amit pant, <amitpant945@gmail.com> wrote:
i used foreign key for make relationship between two model class but it does not work properly, i used this for make subscription and on first model their is choices for subscription.
help me why it is not working

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ccb94b40-2c2d-4202-bfb9-37459770b99a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK-hKekN4hsqHexxoWww2Y%3DzsJukwx2PfH02D%2B%3DAF_qqfYQYyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.