twoscoops / two-scoops-of-django-1.8

Tracking thoughts and feature requests for Two Scoops of Django 1.8 in the issue tracker. And the book's code examples are here.
400 stars 81 forks source link

Suggestion: information about setting up database, especially PostgreSQL users/permissions #84

Closed HiGregSmith closed 9 years ago

HiGregSmith commented 9 years ago

As a new user, I'm using the book to learn Django (as well as from the official Django documentation). I want to set up a multi-site Django project and am trying to figure out how to do so. That is, when setting up multiple sites served from a set of Django projects, some will share databases, and some will not. Advice in the book on setting up users/group roles/login roles for (in my case) PostgreSQL would be a welcome addition. And, further, how to set up the DATABASES setting accordingly.

As a reference, this short web page seems the most appropriate that I've found: http://killtheyak.com/use-postgresql-with-django-flask/

Excellent book at the perfect, and very usable, level!!

pydanny commented 9 years ago

Unfortunately, this won't make it into the book. Here's why:

  1. Database setup for PostgreSQL (or MySQL, Oracle, etc) is arguably outside the scope of Two Scoops of Django. In the 1.8 edition we actually removed content that existed in previous editions, as we were trying to narrow the scope further (yet we're still over 500 pages).
  2. Considering the low cost of virtual machines and the easier deployment systems of modern day configuration management, we feel it doesn't make much sense to serve multiple sites from a single Django project. While there are edge cases, those are unique and often don't even need the django.contrib.sites framework.
  3. Multiple databases for a single project might prove to be something we include in the next edition of Two Scoops of Django.

In any case, we really appreciate your through provoking submission. :smile: