0

I have been playing arround with django for a couple of days and it seems great, but I find it a pain if I want to change the structure of my database, I then am stuck with a few rather awkward options.

Is there a way to completely bypass djangos database abstraction so if I change the structure of the database I dont have to guess what model would have generated it or use a tool (south or ...) to change things?

I essentially want this: https://docs.djangoproject.com/en/dev/topics/db/sql/ (Raw SQL Queries) but instead of refering to a model, refering to an external database.

Could I just create an empty model and then only perform raw queries on it? (and set up the DB externally)

Thanks

P.S. I dont really mind if I have separate databases for the admin stuff and the app data

3
  • I don't really understand the question - or your motivation. Just because it's a bit difficult to change the db structure (although I don't know why you wouldn't use South), you want to throw out all the help given by the ORM? Plus you wouldn't be able to use the admin, or model forms - again, just because migrations are slightly tricky? Commented Oct 7, 2013 at 9:27
  • Plus, while you're in development, it's easy to just drop the db and recreate it with syncdb whenever you need to. Commented Oct 7, 2013 at 9:29
  • Using the ORM + South make it way easier to change your DB structure than raw SQL. Commented Oct 7, 2013 at 10:19

1 Answer 1

1

It's in your question already, just read the docs article from here: Executing custom SQL directly

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.