zurfyx
zurfyx

Reputation: 32767

Django default tables

When working with databases with Django, it automatically creates 12 default tables in the database.

enter image description here

I understand that I need dango_session for storing the session and probably django_site. But why do I need the others?

In PHP I used to store users in my own custom tables. Shouldn't I do that anymore?

Upvotes: 9

Views: 8035

Answers (1)

Alasdair
Alasdair

Reputation: 308829

The tables are created because you have django.contrib.auth, django.contrib.sessions, and so on in your INSTALLED_APPS setting. You shouldn't delete the tables if the apps are installed, as Django will expect them to exist.

None of the contrib apps are required to run Django. However, I highly recommend that you use the Django auth and sessions app instead of writing your own. For example, if you use the auth app, you don't need to worry about how to hash passwords, and there are lots of helpful views included to log users in, reset passwords and so on.

Upvotes: 13

Related Questions