**Go here for a video walkthrough of the steps below: http://youtu.be/QgHu_O3SgxQ **
**Go here to learn more about the Django bits of the project: http://youtu.be/qUpiWWjOfRw **
MyMedia is a simple REST API implemented with Django REST Framework - http://django-rest-framework.org/.
The following end points are available from this API:
/
/users
/media
To get started with this basic Django app, please follow along.
-
Clone the repository to your local machine.
git clone https://github.com/aalittle/mymedia.git
-
Change directories into the cloned repository.
cd mymedia
-
The first thing you will need to do is install pip. If you have setuptools installed, which you most likely will with most modern platforms, you can install pip through easy_install:
easy_install pip
-
Next, you'll need to install virtualenv with pip. To learn more about pip and virtualenv, I'd recommend: http://dabapps.com/blog/introduction-to-pip-and-virtualenv-python/
pip install virtualenv
-
Before we do anything else we'll create a new virtual environment, using virtualenv. This will make sure our package configuration is kept nicely isolated from any other projects we're working on.
mkdir /env virtualenv /env/mymedia source /env/mymedia/bin/activate
-
And finally, you can use the requirements.txt file so that your environment is completely and easily replicable:
$ pip install -r requirements.txt
-
Now run the syncdb command which will initialize part of the local database file. Also, take the time to create a super user for the database, since you'll be prompted to do so.
python mymedia/manage.py syncdb
-
Now run the migrate command which will complete the database setup by running the migration scripts.
python mymedia/manage.py migrate
-
Now run the python server
python mymedia/manage.py runserver 8080
-
Now start a browser and navigate to localhost:8080/