GithubHelp home page GithubHelp logo

sutro.fm

Shared listening rooms powered by Rdio.

Sutro Tower Image by Christian Arballo

Develop

Create a .env file with the following defined:

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
DJANGO_DEBUG=true
DJANGO_SECRET_KEY=
RDIO_OAUTH2_KEY=
RDIO_OAUTH2_SECRET=
SENTRY_DSN=
TEST_DB=

Setup and run locally:

$ pip install -r requirements.txt
$ mkdir webassets
$ foreman run python manage.py collectstatic
$ foreman run python manage.py syncdb
$ foreman run python manage.py runserver

Deploy

Before first deploy:

$ heroku apps:create <app_name>
$ heroku addons:add heroku-postgresql:dev
$ heroku addons:add sentry:developer
$ heroku config:set <contents of .env>

First deploy:

$ foreman run python manage.py collectstatic
$ git push heroku master
$ heroku run python manage.py syncdb
$ heroku ps:scale web=1

For each deployment thereafter:

$ foreman run python manage.py collectstatic
$ git push heroku master

First-time users

Have no idea what all this means? Don't worry. I'm going to run you through the process I used to get this set up for the first time on OS X.

You will be getting Python, Django, Postgres, and some Heroku tools set up during this process.

Before you get started, you will need to set up some additional services.

Rdio js API

This is different from the web services API. You will need to request access. Once you've been granted access, go create an app at http://www.rdio.com/developers/ and add RDIO_OAUTH2_KEY and RDIO_OAUTH2_SECRET to your .env file.

Redis

Set up redis.

Django Secret

Go create your django secret key here: http://www.miniwebtool.com/django-secret-key-generator/ and add it to DJANGO_SECRET_KEY in the .env file.

Python

Let's get pip set up first. This is your package manager for python

$ sudo easy_install pip

Postgres

Install Postgres. I downloaded the PostGres app from http://postgresapp.com/

Don't forget to add the correct postgres path to $PATH. For example:

$ PATH=$PATH:/Applications/Postgres.app/Contents/Versions/[version number]/bin/

For TEST_DB you will need to get access to a postgres database set up. Open Postgres.app.

$ CREATE DATABASE rdio_party;
$ CREATE USER rp_user;
$ ALTER USER rp_user WITH PASSWORD '1234';
-- Check to make sure you user exists
$ \du
-- Quit
$ \q

Add the following to TEST_DB: 'postgres://rp_user:1234@localhost/rdio_party' in your .env file.

Requirements

Now you're ready to pick up the requirements install

$ sudo pip install -r requirements.txt

Go download and install the Heroku toolkit. https://devcenter.heroku.com/articles/getting-started-with-python#set-up This will give you access to Foreman for the next couple steps.

A few modifications to settings.py are required to get things set up locally.

  • Add 127.0.0.1 to ALLOWED_HOSTS.

The Environment

Now you're ready to start where this tutorial began!

$ mkdir webassets
$ sudo foreman run python manage.py collectstatic
$ sudo foreman run python manage.py syncdb
$ sudo foreman run python manage.py runserver

All done. Access your server from http://127.0.0.1:8000/

Coding Style

  1. Common sense
  2. 2 spaces

sutrofm's Projects

sutrofm icon sutrofm

Shared listening rooms powered by Rdio

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.