Skip to content

Error loggining in [Class '<class 'app.models.User'>' has no field 'username'."] #28

Description

@OneVoltTen

After submitting user login it displays the following error:
screenshot_2017-03-07_17-59-11

Activity

  1. hosek commented on Mar 23, 2017

    @hosek

    I've got same error.
    Add username field to the model:
    models.py:28
    username = db.Column(db.Unicode(50), nullable=False, server_default=u'')
    and fill it in manage_commands.py:49
    user = User(email=email, first_name=first_name, username=first_name,
    (you may need to keep username separated from first name, I just used first name for simplicity)

    then delete app.sqlite from the root and recreate DB with python manage.py init_db
    Now you will be able to login with default Admin/Password1

    Hope that help you a little

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions