I am a new comer to Django (and databases generally), and I am unsure how you can structure the next. The causes of data I'll have for my website are:
- your blog
- for any couple of different games:
- a higher score list
- user-produced levels
Basically were storing the information in regular files, I'd simply have one apply for each one of the above. In Django, ideally (I believe) I'd possess a separate database for all these, but apparently multiple database support is not there for Django yet. I am worried (unnecessarily?) about keeping my way through one database for 2 reasons:
Basically screw something up within the sections, I'd rather not screw up the relaxation from the data.
When I am focusing on one of these simple sections, I would like the liberty to simply alter the model around. Since I have found that
syncdbdoes not, actually, sync the database, I have made the decision the simplest factor to complete when playing around having a model would be to simply wipe the database and begin again. Again, I am concerned about playing in the other sections. I checked out south, also it appears like more trouble than it's worth throughout the look stages of the application (but I'll reconsider later when there's really valuable data).
A part of however , I am not necessarily comfortable keeping my data inside a binary format. I am accustomed to text, in order to easily diff it, modify it within an editor, etc., without dealing with some magical database interface (I am using postgresql, incidentally).
Are my fears unproven? How does someone normally handle this issue?
I generally just totally reset the module
>>> python manage.py reset blog
this can totally reset all tables in
I am unsure if the solutions your question but it is much lest destructive than wiping the DB.
In a nutshell, your fears are unproven. You need to "organize" your database by project to make use of the Django term. Each model in every application may have it's own table, but everyone will maintain exactly the same database. Putting these questions separate database is not advisable for lots of reasons, the greatest is you cannot query across databases.
While To be sure that south is most likely a little heavy for the initial design/dev stages it ought to be considered seriously for anything even resembling a beta version and essential being produced.
If you are likely to be playing together with your models a lot throughout development the very best factor to complete is use fittings to load data in rapidly after running sync. Or, if you are planning to become altering a lot of needed fields, then write some quick Python to produce dummy data for you personally.
For not having faith in your computer data to binary, an easy "pg_dump " will enable you to get a textual version of the data. It may sound in my experience like you are focusing on your application against live production data, the industry mistake. Your ultimate goal ought to be to get the application built, working, and examined on fake data or at best a duplicate of the production data after which when you are sure things are golden migrate it into production. This is when such things as south prove useful as possible automate this deployment and it'll assist you to handle any database table/column changes you have to make.
I am sure all this seems like a discomfort, but it is totally capable of being automated and believe me it can make your existence in the future so much simpler.