Recently I had a chance to work on a project, where a PHP app had to be converted to a Django one.
The work seemed trivial, but it brought a few difficult technicalities. It had a Mysql DB, with few tables. Overall, I had to -
The work seemed trivial, but it brought a few difficult technicalities. It had a Mysql DB, with few tables. Overall, I had to -
- Convert them into Django models
- Convert the app into Django
- Setup the app on Heroku using Postgres
- Converting the models to Django is easy. Django provides an inspectdb command. It looks at the current model structures, inspects it and provides django model accordingly.
- This is a nice feature. It gave me a push forward to begin the app development. However, this feature lacked some points that I would like to point out -
- In Mysql, we have a set type . This is basically similar to choices in Django models. I had to manually do that.
- The foreign key constraint is set to id by default. The command could check this and set the field in model declaration using to_field parameter.
- The DB views had to created manually.
- For changing Mysql Data to Heroku, https://devcenter.heroku.com/articles/heroku-mysql is a good resource.
No comments:
Post a Comment