Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Merge 71ac303 into 0f80c4e
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasofficial1617 committed May 19, 2018
2 parents 0f80c4e + 71ac303 commit 39d887d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 30 deletions.
53 changes: 53 additions & 0 deletions PSQL_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# How to Install PSQL
## linux

open the terminal and type in
```bash
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
```

## windows
Download the installer from
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
and follow the installation process, if asked fill `5432` in port configuration

# How to Configure the Database
## linux
Create `systersdb` database, where `systersdb` might be any suitable name.

```bash
sudo -i -u postgres
createuser <anyname e.g. alice> --pwprompt
psql
CREATE DATABASE systersdb;
\c systersdb;
GRANT ALL PRIVILEGES ON DATABASE systersdb to <the name>;
```

Fill in the database details in `systers_portal/settings/dev.py`.

## windows
Create `systersdb` database, where `systersdb` might be any suitable name.
Open the SQL Shell for postgresql from the windows start menu or wherever accessible

```
Server [localhost]: Just press enter, leave this empty
Database [postgres]: Just press enter, leave this empty
Port [5432]: This is the default port just press enter, leave this empty
Username [postgres]: This is the default username just press enter, leave this empty
Password for user postgres: Input password you created during installation and press enter
CREATE USER <anyname you want e.g systers> WITH PASSWORD <any password>;
CREATE DATABASE systersdb;
\c systersdb;
GRANT ALL PRIVILEGES ON systersdb TO <username created above>;
```

Fill in the database details in `systers_portal/settings/dev.py`.


Reference
[Django Girls'](http://djangogirls.org) ebook,
[Tutorials Extension](http://djangogirls.org/resources/), is a reference.
The info is also on [Django Girls GitHub repository](https://github.com/DjangoGirls/tutorial-extensions/blob/master/en/optional_postgresql_installation/README.md).

32 changes: 2 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ Setup for developers (Unix)
environment variables.
1. Make sure you have python3-dev installed on your operating system. For Debian, you would additionally require libpq-dev.
Install by using `sudo apt-get install libpq-dev python3-dev`
1. Make sure you have PostgreSQL installed. For a tutorial on installing
Postgres, [Django Girls'](http://djangogirls.org) ebook,
[Tutorials Extension](http://djangogirls.org/resources/), is a reference.
The info is also on [Django Girls GitHub repository](https://github.com/DjangoGirls/tutorial-extensions/blob/master/en/optional_postgresql_installation/README.md).
1. Clone the repo - `git clone git@github.com:systers/portal.git` and cd into
the `portal` directory. If working behind a proxy, follow the instructions [here](https://cms-sw.github.io/tutorial-proxy.html).
1. Create a virtual environment with Python 3 and install dependencies:
Expand All @@ -33,16 +29,7 @@ Setup for developers (Unix)
$ source venv/bin/activate
$ pip install -r requirements/dev.txt
```
1. Create `systersdb` database, where `systersdb` might be any suitable name.
```
$ sudo -i -u postgres
$ createuser <any name e.g. alice> --pwprompt
$ psql
$ CREATE DATABASE systersdb;
$ \c systersdb;
$ GRANT ALL PRIVILEGES ON DATABASE systersdb to <the name>;
```
1. Fill in the database details in `systers_portal/settings/dev.py`.
1. Create the database. Instruction can be found at `PSQL_README.md`.
1. Run `export SECRET_KEY=foobarbaz` in your terminal, ideally the secret key
should be 40 characters long, unique and unpredictable. Optionally to set the
shell variable every time you activate the virtualenv, edit `venv/bin/activate`
Expand Down Expand Up @@ -75,7 +62,6 @@ Setup for developers (Windows)
- Precomplie standard libary
- Select install location and hit install
1. Run `pip install virtualenv` using windows command line
1. You would have to install PostgreSQL. Download from [official location](https://www.postgresql.org/download/windows/) or alternative location, you could lookup some PostgreSQL tutorials online if you are completely blank on this.
1. Clone the repo - `git clone git@github.com:systers/portal.git` and cd into the `portal` directory. Use git CMD or git Bash(unix-like terminal) to do so.
1. Create a virtual environment with Python 3 and install dependencies, using CMD :

Expand All @@ -84,21 +70,7 @@ Setup for developers (Windows)
$ ./venv/Scripts/activate
$ pip install -r requirements/dev.txt
```
1. Create `systersdb` database, where `systersdb` might be any suitable name.
- Open the SQL Shell for postgresql from the windows start menu or wherever accessible

```
$ Server [localhost]: Just press enter, leave this empty
$ Database [postgres]: Just press enter, leave this empty
$ Port [5432]: This is the default port just press enter, leave this empty
$ Username [postgres]: This is the default username just press enter, leave this empty
$ Password for user postgres: Input password you created during installation and press enter
$ CREATE USER <anyname you want e.g systers> WITH PASSWORD 'your password';
$ CREATE DATABASE systersdb;
$ \c systersdb;
$ GRANT ALL PRIVILEGES ON systersdb TO <username created above>;
```
1. Fill in the database details in `systers_portal/settings/dev.py`.
1. Create the database. Instruction can be found at `PSQL_README.md`.
1. Run `set SECRET_KEY=foobarbaz` in your terminal, ideally the secret key
should be 40 characters long, unique and unpredictable.
1. Run `python systers_portal/manage.py migrate`.
Expand Down

0 comments on commit 39d887d

Please sign in to comment.