Giter Site home page Giter Site logo

akhilrs / rapidsms.org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rapidsms/rapidsms.org

0.0 2.0 0.0 2.44 MB

Website for the RapidSMS project.

Home Page: http://rapidsms.org

Shell 13.17% SaltStack 1.21% Nginx 0.51% Scheme 0.86% Elixir 0.05% Python 46.77% HTML 9.92% JavaScript 25.60% CSS 1.91%

rapidsms.org's Introduction

Rapidsms.org Website

Build Status

Below you will find basic setup and deployment instructions for the Rapidsms.org website project. To begin you should have the following applications installed on your local development system:

The deployment uses SSH with agent forwarding so you'll need to enable agent forwarding if it is not already by adding ForwardAgent yes to your SSH config.

Getting Started

If you are cloning the repo, you will also need to initialize submodules from the root project directory:

git clone git://github.com/rapidsms/rapidsms.org.git website/
cd website/
git submodule init
git submodule update

Whenever you pull down from the repository, make sure to run git submodule update.

To setup your local environment you should create a virtualenv and install the necessary requirements:

mkvirtualenv --distribute website
$VIRTUAL_ENV/bin/pip install -r $PWD/requirements/dev.txt

Then create a local settings file and set your DJANGO_SETTINGS_MODULE to use it:

cp website/settings/local.example.py website/settings/local.py
echo "export DJANGO_SETTINGS_MODULE=website.settings.local" >> $VIRTUAL_ENV/bin/postactivate
echo "unset DJANGO_SETTINGS_MODULE" >> $VIRTUAL_ENV/bin/postdeactivate

You will also need to set a >=50 length secret key, as the settings files pulls the SECRET_KEY from the local environment:

echo "export SECRET_KEY=somethinglongerthan50chars" >> $VIRTUAL_ENV/bin/postactivate
echo "unset SECRET_KEY" >> $VIRTUAL_ENV/bin/postdeactivate

Exit the virtualenv and reactivate it to activate the settings just changed:

deactivate
workon website

Create the Postgres database and run the initial syncdb/migrate:

createdb -E UTF-8 rapidsms_website
python manage.py syncdb
python manage.py migrate

Configure your application on Github. Visit the "Applications" section of your Github account settings, and create a new application.

  • Name: You can use any name for the application.
  • URL: The URL of your site. For local testing, use http://localhost:8000.
  • Callback URL: Add the absolute path to "/users/login/github/callback/" as the callback URL.

Add the Github-generated Client ID (GITHUB_KEY) and Client Secret (GITHUB_SECRET) to your local.py file, and run:

python manage.py setup_github

You should now be able to run the development server:

python manage.py runserver

Solr Install & Configuration

Rapidsms.org utilizes Solr for the search backend. In order to utilize search locally, you will need to install and configure Solr:

./scripts/solr-install.sh

This will install Solr in the root of the repository. To run Solr:

./scripts/solr-run.sh

If you make changes to the Haystack indices, you will need to rebuild the Solr schema. Due to an existing Haystack issue, there is a helper script to do this as well:

./scripts/solr-rebuild-schema.sh

After running the script, you will need to restart Solr.

Lastly, you will need to build the initial search index:

python manage.py rebuild_index

Deployment

You can deploy changes to a particular environment with the deploy command. This takes an optional branch name to deploy. If the branch is not given, it will use the default branch defined for this environment in env.branch:

fab staging deploy
fab staging deploy:new-feature

New requirements or South migrations are detected by parsing the VCS changes and will be installed/run automatically.

Running the tests

You can run the tests via:

python manage.py test packages projects users

To check the test coverage you should have coverage installed and run:

# Install coverage
pip install coverage
# Run tests with coverage
coverage run --source=website manage.py test packages projects users aggregator
# Show the coverage report with missing lines
coverage report -m --omit="*/tests/*,*/migrations/*,*/settings/*,"

rapidsms.org's People

Contributors

vrocha avatar daaray avatar copelco avatar calebsmith avatar vkurup avatar tobiasmcnulty avatar ewheeler avatar

Watchers

James Cloos avatar Akhil R S avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.