I've been using social_django for OAuth in my Outreachy Round-15 project WikiCV , and in GSoC project as well, as explained in My first Django OAuth Tool. Things were fine as long as I was using SQLite. But then I decided to move from SQLite to MySQL. If you're planning to do the same, it's not going to be easy. Why? Here's the answer.
Firstly during installation you'll be able to install mysqlclient but since libmysqlclient-dev is not installed in Toolforge when using Kubernetes, it won't work. For workaround for that refer to - this phabricator ticket and stackoverflow link.
Secondly, while migrating if you come across an error like this:
django.db.utils.InternalError: (1709, 'Index column size too large. The maximum column size is 767 bytes.')
Then this is because Toolforge is using 10.0.34 version of MySQL in which limitations are imposed on index columns. I encountered this error because I was using social_django app which had index columns with length > 767 bytes.
Solution for the this is:
- Go through this documentation which says that you need to tweak the lengths of some columns in order to make it work with databases like MySQL InnoDB. Set all the 4 variables mentioned here to 767/<<LENGTH_OF_DATA_TYPE_OF_INDEXED_COLUMN>> in the settings of your project (in settings.py file).
- Your .cnf file should look something like this file
- As I had already migrated with SQLite, changes done to the variables in social_django weren't getting reflected even on migration. So I had to delete the migrations folder in social_django and then migrate it again.
All of this took a lot of google-searching and help from my mentor.
I feel that if it was there in the documentation, it could have saved a lot of effort. I'm penning this down so that someone else's efforts could be saved.
Hope it would help.
Thanks,
Megha