Ask HN: Transitioning From PHP to Django
If I’ve written a web application in PHP as a learning project, but at some point I may want to re-write using the Django framework, what would be the difficulties?
I feel like my primary concern would be getting the new Django app to play nice with the existing mysql database.
Has anyone had any experience doing this? Thanks.
8 comments
[ 51.9 ms ] story [ 679 ms ] threadBut to answer your question, there probably wouldn't be any need to rewrite my application. PHP is very adaptable and scalable and will probably continue to suit my needs.
As long as your database design is somewhat decent you'll likely be ok. if not... well you might want to build a new model and migrate your data :)
e.g, how is:
(from http://www.djangoproject.com/documentation/db-api/)easier than:
my 2 cents: write your own DB access layer, fight the obscure black magic.(nothing but quibbles with the templating engine, though)
for example, i can say:
to get all of the Grants to an Organization, and then to filter out grants that only pertain to a certain user."grants" isnt evaluated (queried) until its iterated over or otherwise called (print, for example), so i can keep building what i want as i go without having several sql calls or managing building a query via string concatenation. personally, i've always found django's orm to feel natural.