Removing ignored files

This commit is contained in:
myvault 2018-09-27 15:55:01 +03:00
parent d7a65c143e
commit e7689b852d
2 changed files with 28 additions and 0 deletions

View File

@ -2,6 +2,7 @@
"project_name": "My Awesome Project",
"project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_') }}",
"venv_name": "{{cookiecutter.project_slug}}_venv",
"database_user_password":"pass",
"description": "Behold My Awesome Project!",
"author_name": "Mohand Ahmad",
"domain_name": "example.com",

View File

@ -0,0 +1,27 @@
echo 'Creating Database {{cookiecutter.project_slug}}:'
sudo -u postgres psql --command 'CREATE DATABASE {{cookiecutter.project_slug}};'
echo
echo 'Creating DB user {{cookiecutter.project_slug}}_user with password {{cookiecutter.database_user_password}}'
sudo -u postgres psql --command 'CREATE USER {{cookiecutter.project_slug}}_user WITH PASSWORD '\'{{cookiecutter.database_user_password}}\';
echo
echo 'Altering role to utf8'
sudo -u postgres psql --command 'ALTER ROLE {{cookiecutter.project_slug}}_user SET client_encoding TO '\'utf8\';
echo
echo 'setting default_transaction_isolation TO read committed'
sudo -u postgres psql --command 'ALTER ROLE {{cookiecutter.project_slug}}_user SET default_transaction_isolation TO '\'read\ committed\';
echo
echo 'setting timezone to {{cookiecutter.timezone}}'
sudo -u postgres psql --command 'ALTER ROLE {{cookiecutter.project_slug}}_user SET timezone TO '\'{{cookiecutter.timezone}}\';
echo
echo 'Granting all privileges on Database {{cookiecutter.project_slug}} to {{cookiecutter.project_slug}}_user;'
sudo -u postgres psql --command 'GRANT ALL PRIVILEGES ON DATABASE {{cookiecutter.project_slug}} TO {{cookiecutter.project_slug}}_user;'