django - Syncdb error when creating CustomUser -


the issue create custom user:

class customuser(abstractuser):     mobile = models.charfield(max_length=16)     address = models.charfield(max_length=100) 

and in settings.py write this:auth_user_model = 'login.customuser' , when run manage.py syncdb first time(when db doesn't contains tables), throws error: django.db.utils.programmingerror: relation "auth_group" not exist when run manage.py syncdb when db tables exist, it's okay, create additional tables. what's wrong run when db doesn't contain tables?

try this

  1. create migration directory in directory of app containing custom user model.
  2. create empty __init__.py file inside migration directory.
  3. execute ./manage.py makemigrations.
  4. execute ./manage.py migrate.

i think when use custom user model, need create migrations. besides, syncdb deprecated , removed in django 1.9 it's better start using ./manage.py migrate command.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -