New Postgres database and user for use in Django
Another one I always forget - how to create a new Postgres database and user for a new Django app. This is possible in one step as long as your Postgres configuration allows you to connect as the ‘postgres’ user:
Mine does not so I first switch to the ‘postgres’ user and run the following:
Then use the ‘createdb’ and ‘createuser’ commands:
Then start psql and grant privileges to the user: