Moving from perl/cgi to Django/Python

110 views
Skip to first unread message

consiglieri

unread,
May 8, 2009, 9:55:37 AM5/8/09
to Django users
Hi

I have a running perl/cgi app in conjunction with mysql which works
fine.

For various reasons i want to move to either django or RoR. I've
pretty much decided to go with Django, however i'm wondering about one
thing.

Ideally i would like to use the mysql database that i have, does
Django provide som good method for either converting a database for
use by Django? How have other people done when moving to Django.

As the question shows i'm not exactly a pro at this, but i would
appreciate any and all constructive comments.

Thanks

Karen Tracey

unread,
May 8, 2009, 10:53:20 AM5/8/09
to django...@googlegroups.com
On Fri, May 8, 2009 at 9:55 AM, consiglieri <apel...@gmail.com> wrote:

I have a running perl/cgi app in conjunction with mysql which works
fine.

For various reasons i want to move to either django or RoR. I've
pretty much decided to go with Django, however i'm wondering about one
thing.

Ideally i would like to use the mysql database that i have, does
Django provide som good method for either converting a database for
use by Django? How have other people done when moving to Django.

Yes, Django has an 'inspectdb' command that you can use, see:

http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb

As the doc notes, you'll want to examine the models output by this and possibly adjust some things, but it provides a good easy start for mapping your existing database tables back to Django models.

Karen

George Song

unread,
May 8, 2009, 11:03:40 AM5/8/09
to django...@googlegroups.com

It depends on the complexity of your original application. If there
aren't many tables/models, my advice would be to just rewrite everything
from scratch, including the models, and do a data migration.

There are couple things you'll want to look into:

* inspectdb [1]
* unmanaged models [2]

Good luck, and welcome.

[1] <http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb>
[2] <http://docs.djangoproject.com/en/dev/ref/models/options/#managed>

--
George

consiglieri

unread,
May 8, 2009, 12:22:04 PM5/8/09
to Django users
Thanks, i'll look into it.

On 8 Maj, 16:53, Karen Tracey <kmtra...@gmail.com> wrote:

consiglieri

unread,
May 8, 2009, 12:22:22 PM5/8/09
to Django users
Thanks, appreciate the input
Reply all
Reply to author
Forward
0 new messages