can I use django authentication in already created mysql database with user data?

112 views
Skip to first unread message

Kevin Thomas

unread,
Mar 10, 2021, 8:54:26 AM3/10/21
to Django users
I am creating a web app and I need to authenticate the login. The username and password is already stored in mysql database. Can I use django for authentication of existing data? It will be great help if anyone knows the answer.

Kasper Laudrup

unread,
Mar 10, 2021, 9:46:21 AM3/10/21
to django...@googlegroups.com
You can:

https://docs.djangoproject.com/en/3.1/topics/auth/customizing/

The tricky part will most likely the password handling. Hopefully the
passwords are not stored in clear text in the database in which case you
need to figured out how they are hashed and salted.

If the passwords are in clear text, you should export the user database,
reimport them in using standard Django auth and inform all users that
their accounts are potentially compromised and they should change their
password ASAP.

The last part is not only the right thing to do, but to the best of my
knowledge also a legal requirement, at least within the EU (GDPR).

Kind regards,

Kasper Laudrup
Reply all
Reply to author
Forward
0 new messages