Develop movie websites using the TheMovieDB.org API: http://api.themoviedb.org/2.1

django-tmdb provides useful commands making it easy to sync TMDB with your django project's db.

Read the terms of use of the api before developing.


$ hg clone http://bitbucket.org/zalew/django-tmdb
$ ./setup.py install

or simply put the package directory /tmdb/ anywhere accessible.

Add 'tmdb' to your INSTALLED_APPS.

Set your TMDB_API_KEY in settings.py

Using commands

Add results from query

$ ./manage.py tmdb_sync --query="order_by=rating&order=desc&countries=dz,tn,ly&order_by=id&order=desc"
$ ./manage.py tmdb_sync --query="order_by=rating&order=desc&genres=18&min_votes=5&page=1&per_page=10"

See http://api.themoviedb.org/2.1/methods/Movie.browse for building queries.

Update a movie

$ ./manage.py tmdb_sync --update=TMDB_ID_OF_MOVIE

It will check if there's a newer version in the api. If yes, the movie will be updated.

If you want to force update regardless of new version (f.ex. you messed up with the record in the db), use --force-update.

Update all movies in db

$ ./manage.py tmdb_sync --update-all

Works as above.

I'm working on more methods for the commands.

Test purposes

If you don't want results to be written to db, use --test.

Preview results

(r'^tmdb/', include('tmdb.urls')),  

Call tmdb_preview_results url (/tmdb/test/) and pass qury arguments to the url. Additionally, pass a method arg with one of the currently supported values: Movie.browse, Movie.getInfo, Person.getInfo.

Example urls would be:

and the results are formatted JSON straight from the API.

Asynchronous tasks (Celery)

Currently I'm integrating it with celery, should commit soon.

Issues? Want to contribute?

Report any issues here. If you have any ideas, you can submit a proposal but better yet feel free to fork it, do it yourself and if it's ok I'll merge it.


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.