Skip to content
gregorylburgess edited this page May 9, 2013 · 10 revisions

To install a local instance of Megawatt:

1. Install VirtualEnv

VirtualEnv allows the setting of environemnt variables without disrupting a user's normal environment. It also gives us access to pip.

2. Create a VirtualEnv wrapper

$ mkvirtualenv megawatt

$ workon megawatt The above commands create a VirtualEnv called 'megawatt'.

3. Install Postgres

4. Create a Postgres DataBase

note: this usually requires a user to run the psql command.

See this article for troubleshooting or this article for first time setup.

5. Set the DATABASE_URL environment variable

$ export DATABASE_URL=postgres://[db_user]:[db_password]@localhost:5432/[db_name]

6. Clone the Megawatt repository

$ git clone https://github.com/gregorylburgess/megawatt.git

7. Install pip requirements

$ cd megawatt

$ pip install -r requirements.txt

8. Set Installation Variable

Open the settings.py file (megawatt/settings.py) Change line #4 to

Heroku = True

9. Sync the DB

$ python manage.py syncdb

An error here indicates a problem from step 4 or 5.

10.Run the Server

$ python manage.py runserver