How to reset authentication?

126 views
Skip to first unread message

Austin Taylor

unread,
Feb 6, 2014, 7:38:26 AM2/6/14
to web...@googlegroups.com
I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error.

Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login.

I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up.

I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up.

Any help would be greatly appreciated!!

Austin Taylor

unread,
Feb 6, 2014, 9:25:07 AM2/6/14
to web...@googlegroups.com
Or would it be possible for my authentication to be handled by another database?? I'm open for ideas/best practices.

Massimo Di Pierro

unread,
Feb 7, 2014, 1:50:54 PM2/7/14
to web...@googlegroups.com
Hard to help you without seeing the cod or the error tickets. There should be no difference between auth in sqlite or mysql. You should not save auth info a different database else you lose the ability to join the auth_user table with other tables and that is often an important requirement.

Austin Taylor

unread,
Feb 7, 2014, 4:07:15 PM2/7/14
to web...@googlegroups.com
Thanks, Massimo. Whenever I click register I get some new unknown column 'modified_by' in the field list (error 1054).

I have tried manually adding each field whenever I get new errors, but I'm tired of it and just want to start over.

I restored the views and controller to the default, but still get errors. When I create a new app and just use SQLite instead of mysql the register function works great. It also works well when I use it with another database in MYSql, but if I use it with my main database I run into issues.

Austin Taylor

unread,
Feb 7, 2014, 4:50:01 PM2/7/14
to web...@googlegroups.com
Now I just tried to reset password and I get 1054, "Unknown column 'auth_membership.is_active' in 'field list'

LightDot

unread,
Feb 7, 2014, 9:46:26 PM2/7/14
to web...@googlegroups.com
Looks like web2py thinks that your main database structure is different than it really is. With other words, database migrations are broken for your app. That's why auth works if you start with a fresh database and doesn't if you use the existing one.

Since you've been replacing one database with another (to test auth, etc.), how did you handle database migrations in web2py? Migrations are described here:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Migrations

What I would do:

1) if there was important data in the main database: check the differences between the database definitions and your current main database structure, sort that out using fake migrations (refer to Fixing broken migrations chapter in the book)

2) if there was no need to keep the old data from the main database:
a) drop all tables from the main database
b) delete all files from the applications/yourapp/databases folder (assuming there are no sqlite databases in there that you still need)

Regards

Austin Taylor

unread,
Feb 11, 2014, 6:13:54 AM2/11/14
to web...@googlegroups.com
I used extract_mysql_models.py to create the models since I couldn't
see them when I typed db.tables. After putting the defined models in
db.py I could then see the models.

I've tried troubleshooting with enable_migrate_all and migrate=True,
but the register screen just stays blank for me.

I'm also not sure how it is suppose to help me troubleshoot. I would
like for the database to be able to overwrite any fields I have in
there now and fix itself if possible. I thought that is what the
migrate=True setting would do, but I must be wrong.
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/BfmiTOOM0o4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Austin Taylor

unread,
Feb 11, 2014, 6:29:35 AM2/11/14
to web...@googlegroups.com
Finally fixed!! Thank you so much! I had to delete all of the files in
the app/databases folder. I didn't realize that checking those logs
would help me see if the files could be written, but that helped a
lot.

Thank you!
Reply all
Reply to author
Forward
0 new messages