This allows you to install all the Python dependencies in a "box" so they are not globally installed and clashing with other projects.
- Install virtualenv:
pip install virtualenv
- Install virtualenvwrapper:
pip install virtualenvwrapper
*You can skip this and use virtualenv installed in a step before directly, virtualenvwrapper allows for nice interfacing with virtualenv - Source the
virtualenvwrapper
:source /usr/local/bin/virtualenvwrapper.sh
NOTE: To help do this automatically on every new shell you open add the line above to your.bash_profile
or.bashrc
- Create a new env for the project:
mkvirtualenv pimp
- Get the code:
git clone [email protected]:womenhackfornonprofits/pimp-my-cause-django.git
- Go inside the
pimp-my-cause-django
directory:cd pimp-my-cause-django
- Activate the virtual enviroment:
workon pimp
This will now ensure anything you install is within this environment. - Install the requirements:
pip install -r requirements.txt
This will get all the Python dependencies.
- You will need to have Postgres installed and up and running. You can install it via:
- Homebrew
brew install postgresql
- OR download the Postgres App
- Homebrew
- Make sure the Postgres Server is up and running:
- If using the App simply start the server from there
- If using command line:
brew services start postgresql
- Create a database locally for the project to run:
createdb pimpmycause
This is used to allow us to store Spatial data about user locations and calculate distance between users.
12. Install all the Geo Django dependencies using Homebrew Bundle
brew bundle
If you can't use Homebew, you can install the dependencies mentioned in the Brewfile manually. Django GIS Intstructions
2. Install front-end dependencies:
`cd pimpmycause`
`npm install`
- Go inside the django app directory:
cd pimpmycause
- Run django server:
python manage.py runserver
- Go to 127.0.0.1:8000
- You may see a message that you have unapplied migrations. When you see this simply run the command below which will create any tables and fields in the database:
python manage.py migrate
- Make css and javascript changes in the
src
folder - Make any HTML changes in the Django templates located in
pimpmycause/templates
- Use
npm run watch
to run webpack and watch for changes. - You will have to reload the 127.0.0.1:8000 link after adding changes
- Create a Heroku Account
- Get added to the app in the Heroku Dashboard (ask a team member)
- In the terminal
heroku login
- Within your project directory
heroku git:remote -a staging-pimpmycause
- Once you are ready to deploy, from master branch you can run
git push heroku staging
make sure you have committed all the changes before running this and thegit status
is clean. - Go to https://staging-pimpmycause.herokuapp.com to view the live site.