python - django auth system 'created' -


enter image description here

i'm working django 1.7.11. have preexisting project , i've decided try use built in admin panel (i have not created superuser). when opened auth page saw :

enter image description here

thinking there may problem tables decided delete sqlite database , rerun everything:

$ python manage.py makemigrations app1 migrations 'app1':   0001_initial.py:     - create model seller  $ python manage.py migrate operations perform:   synchronize unmigrated apps: crispy_forms   apply migrations: admin, contenttypes, auth, app1, sessions synchronizing apps without migrations:   creating tables...   installing custom sql...   installing indexes... running migrations:   applying app1.0001_initial... faked  $ python manage.py syncdb operations perform:   synchronize unmigrated apps: crispy_forms   apply migrations: admin, contenttypes, auth, app1, sessions synchronizing apps without migrations:   creating tables...   installing custom sql...   installing indexes... running migrations:   no migrations apply.  have installed django's auth system, , don't have superusers defined. create 1 now? (yes/no): yes created: error: '' value has invalid format. must in yyyy-mm-dd hh:mm[:ss[.uuuuuu]][tz] format. created: 

how can fix this?

edit:

app1/models.py:

from django.db import models     # django.contrib.auth.models import abstractuser        class seller(models.model):          # address         contact_name = models.charfield(max_length=50)         contact_address = models.charfield(max_length=50)         contact_email = models.charfield(max_length=50)         contact_phone = models.charfield(max_length=50)         ............         created = models.datetimefield(auto_now_add=true,unique=true)          required_fields = ('contact_name','contact_email','contact_address','contact_phone')         username_field = 'created' 

your username field set created. change contact_name use "name" log in.

however!... should extend abstractuser model , not change username_field unless have to. way doing require write custom login views etc..

edit:

to use default user model delete line auth_user_model settings.py re-run createsupseruser management command. go admin login page , login username , password.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -