tags:

views:

38

answers:

2

I am writing a website using Django. I need to push the web site out as soon as possible. I don't need a lot of amazing things right now.

I am concern about the future development. If I enable registration, which means I allow more contents to be writable. If I don't, then only the admins can publish the content. The website isn't exactly a CMS.

This is a big problem, as I will continue to add new features and rewriting codes (either by adapting third-party apps, or rewrites the app itself). So how would either path affects my database contents?

So the bottom line is, how do I ensure as the development continues, I can ensure the safety of my data?

I hope someone can offer a little insights on this matter.

Thank you very much. It's hard to describe my concern, really.

+1  A: 

Whatever functionalities you will add after, if you add new fields, etc ... you can still migrate your data to the "new" database.

It becomes more complicated with relationships, because you might have integrity problems. Say you have a Comment model, and say you don't enable registration, so all users can comment on certain posts. If after, you decide to enable registration, and you decide that ALL the comments have to be associated with a user, then you will have problems migrating your data, because you'll have lots of comments for which you'll have to make up a user, or that you'll just have to drop. Of course, in that case there would be work-arounds, but it is just to illustrate some of the problems you might encounter later.

Personally, I try to have a good data-model, with only the minimum necessary fields (more fields will come after, with new functionalities). I especially try to avoid having to add new foreign keys in already existing models. For example, it is fine to add a new model later, with a foreign key to existing model, but the opposite is more complicated.

Finally, I am not sure about why you hesitate to enable registration. It is actually very very simple to do (you can for example use django-registration, and you would just have to write some urlconf, and some templates, and that's all ...)

Hope this helps !

sebpiq
Thank you for your input, sebpiq. I am hesitate to enable registration is because I am going to adapt the openID, and in the future I am going to use that authentication for new functions. For example, creating groups (a model class that I am working on) - think of a group like FB's group, but a bit more different. That's why I am afraid to enable it. Thanks. I will use a demo site to test them out first :)
JohnWong
A: 

if you are afraid of data migration, just use south...

jmoritz
Thank you jmoritz, I read about south, seems like a good tool :) everyone is recommending it.
JohnWong