diff --git a/Makefile b/Makefile index 5a5b9ad..4a76730 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,17 @@ help: ubuntu: sudo apt-get update sudo apt-get -y build-dep python-psycopg2 - sudo apt-get -y install build-essential python-dev exuberant-ctags + sudo apt-get -y install build-essential python-dev exuberant-ctags virtualenv -run: bin/django ; bin/django runserver +postgresql: + sudo apt-get install postgresql + @read -p "Enter postgresql database role name ():" dbrole; \ + sudo -u postgres psql -c "CREATE ROLE $$dbrole"; \ + sudo -u postgres psql -c "ALTER ROLE $$dbrole with superuser"; \ + sudo -u postgres psql -c "ALTER ROLE $$dbrole with login"; \ + createdb pylab + +run: bin/django ; bin/django runserver 0.0.0.0:8000 test: bin/django ; bin/django test --settings=pylab.settings.testing --nologcapture diff --git a/README.rst b/README.rst index 252cc01..5145f87 100644 --- a/README.rst +++ b/README.rst @@ -24,13 +24,8 @@ Development environment You need Ubuntu 14.04 or greater. In Ubuntu terminal execute these commands:: - $ sudo apt-get install python-dev python3-dev - $ sudo apt-get install postgresql - $ sudo -u postgres psql - # create role ; - # alter role with superuser; - # alter role with login; - $ createdb pylab # Creates Postgresql database with name ``pylab`` + $ make ubuntu + $ make postgresql $ make # Downloads and configures python packages $ bin/django migrate # Creates tables in the database $ make testall # Checks if everything works properly