This repository contains (primarily) Python code written on top of Django
and other Python modules. We bundle a copy of all of the essential
dependencies for oh-mainline to run so that you can get started immediately
(there is no need to download and configure additional software from other
sources).

It should take you about 15 minutes to get the OpenHatch site running locally
on your computer.

After running your own instance of the OpenHatch website, you can play
with the code from an interactive shell on your computer.

If you want to work on core backend features, like the bug importer,
or let your local site rescale images, please see Advanced Installation
documentation to learn about optional dependencies and automated testing.

Understanding how to open a command prompt for your operating
system is an important prerequisite to master before continuing
with the remaining installation instructions.

For the rest of these instructions, you have to open a command prompt:

On a Linux or similar system, find a program with "terminal" or
"konsole" in the name. Run it.

On a Mac, click the search icon in the top-right of the screen and
search for Terminal. This should find the Terminal program, stored in
/Applications/Utilities. Run it.

On a Windows computer, you'll need to use Git Bash. To do so, download and
install the .exe at this link.
(It will ask you a bunch of questions. You can accept the defaults.)
Once that is installed, launch Git Bash by going to:
Start -> All Programs -> Git -> Git Bash

If you already have an oh-mainline directory on your computer, then
you already have the source code. You may skip to the next step,
Set up the database.

If you're reading this installation instruction file on the web,
then you will need to clone the repository from GitHub to your local
computer.

Step 1: Open a command prompt on your computer

Step 2: Create a new directory on your computer:

mkdirlocalhatch

Step 3: Change to the new directory:

cdlocalhatch

Step 4: On your personal Github account, fork the OpenHatch repository at
https://github.com/openhatch by clicking on the "Fork" button on the right-hand side.
Github now takes you to your forked repository of the OpenHatch upstream repository.

Step 5: On the command prompt, clone the repository from your fork of the GitHub OpenHatch code to your local computer:

gitclonehttps://github.com/<YOUR_GITHUB_USERNAME>/oh-mainline.git

If your commands are executed successfully, you may continue to the next
step.

Note

For most Django projects, you would need to install the dependencies
at this point (using pip install -r requirements.txt), but for
the OpenHatch project, these packages have been bundled for your
convenience in the vendor directory, so they don't need to be
installed separately.

Before you run the commands in the this section, make sure you have
changed your present working directory to the oh-mainline directory.:

cdoh-mainline

Your local OpenHatch site will store data in a SQLite database.

Run this command to create the database and add tables for our dependencies:

pythonmanage.pysyncdb--migrate--noinput

Note

We have to pass --noinput to request that Django not ask you
questions. This is due to a bad interaction between Django's superuser
creation system and our custom profiles. --migrate creates an empty
database, with zero users and zero projects, ready for you to fill with data
as you use your local version of the site. If you want your site to have a database filled
with data like what is on the main OpenHatch.org site, you can import
a data snapshot. See Importing data snapshots for more info about
that.)

This will print out lots of text. Once all of the text is printed, you
should see something like the output listed in Output Samples below.
Afterwards, your database tables should be ready. You're ready to run the
site.

If you are using Windows and do not have Python installed, you may get the
error "Python: command not found." Follow these instructions
to install Python.

Your local version of OpenHatch does not contain any user data in
its SQLite database. You may add users manually through the user
interface. If your development needs require a large amount of
prepopulated data, you can find information about Importing data
snapshots in the Advanced Installation documentation.