Django rest-auth allauth registration with email, first and last name, and without username

Make sure you have ACCOUNT_USERNAME_REQUIRED = False in your settings.py file. For first_name and last_name you need to write a custom RegisterSerializer (https://github.com/iMerica/dj-rest-auth/blob/bf168d9830ca2e6fde56f83f46fe48ab0adc8877/dj_rest_auth/registration/serializers.py#L197) here’s a sample code for serializers.py from allauth.account import app_settings as allauth_settings from allauth.utils import email_address_exists from allauth.account.adapter import get_adapter from allauth.account.utils import setup_user_email class RegisterSerializer(serializers.Serializer): first_name = serializers.CharField(required=True, write_only=True) last_name = … Read more

RuntimeError: Model class django.contrib.sites.models.Site doesn’t declare an explicit app_label and isn’t in an application in INSTALLED_APPS

The fix Just add Django’s Sites framework to your apps and set SITE_ID to 1 in your settings. INSTALLED_APPS = [ … ‘django.contrib.sites’, ] SITE_ID = 1 Why does this happen? Django’s Sites Framework is a contributed module bundled with the core library that allows for the use of a single Django application/codebase with different … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)