Skip to content

Latest commit

 

History

History
172 lines (105 loc) · 3.84 KB

SETUP.md

File metadata and controls

172 lines (105 loc) · 3.84 KB

Setup

How to get this project running on your machine.

1. Requirements

  1. Install Git.

    Check that it's installed:

    which git

    That should return a path (e.g., /usr/local/bin/git).

  2. Install Python 3. You have a few options:

    • Using a downloadable installer for any operating system: https://www.python.org/downloads/

    • With Homebrew for macOS:

      brew install python3
    • With Scoop for Windows:

      scoop install python3
    • Once installed, check that it's installed:

      which python3

      That should return a path (e.g., /usr/local/bin/python3).

  3. Install PostgreSQL.

    • With Postgres.app for macOS.

    • With BigSQL for Windows.

    • Other options are available.

    • Once that's downloaded and installed, check that it's installed:

      which postgres

      That should return a path (e.g., /usr/local/bin/postgres).

  4. Install Node.js.

2. Download the project.

  1. Fork this repository.

  2. Clone git repository and move into that.

    git clone [email protected]:YOUR_GITHUB_USERNAME/sisters-of-the-road-admin.git
  3. Move into that repository.

    cd sisters-of-the-road-admin

3. Set up development environment:

  1. Set up a Python virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  2. Install Node.js dependencies.

    npm install
  3. Setup PostgreSQL database.

    • Create a user:

      psql

      You will be asked for your password. If you used the password 'admin' for the default postgres user when installing PostgreSQL, then enter 'admin' here.

    • That will open up the PostgreSQL prompt. Create the database:

      CREATE USER sisters;
      CREATE DATABASE barter OWNER sisters;
    • Exit the psql prompt:

      \q
    • Verify that you can connect to the database:

      psql barter sisters
      

      That should enter you into the PostgreSQL prompt again.

      Exit the prompt by entering \q and hitting Enter.

    • Run database migrations.

      python3 manage.py migrate
      python3 manage.py createsuperuser --username [YOUR USERNAME]
      

      Replace [YOUR USERNAME] with your desired username (e.g., kjohnson).

      You'll be prompted to create a user with your email address and password. Do so, and save the information. You'll need to remember it to log in.

4. Run the app.

  1. Run:

    python manage.py runserver

    The app will now be running in your browser at [http://localhost:8000/].

    The admin dashboard is available at [http://localhost:8000/admin].

5. Run the tests.

  1. First, stop the running app with Ctrl+c.

  2. Run tests:

    python manage.py behave

    That should output a lot of NotImplementedError messages.

6. Develop the app.

This project uses Webpack to compile source files.

Run Webpack every time changes are made to the Javascript files:

```sh
webpack --config webpack.config.js
```

If you have trouble with any of these steps, please open a new issue describing what went wrong.