#Movies Trailer Website
##Overview
Basic movie trailer website created with Python, in partial fulfilment of the Udacity Full Stack Web Developer Nanodegree.
The generate_html.py
module is an edit of the fresh_tomatoes.py
file provided in the courseware. All other code by Eli Weir, [email protected].
##Installation
Requires Python 2.7.10, which can be downloaded from the Python website. Instructions for installation of Python are on the website.
Once Python is installed, fork this repository or download a .zip archive and unzip.
##Usage
To use, simply run open and run the movie_trailers_website.py
module using IDLE (see Installation above). This will generate an index.html
file which will then be displayed. If the index.html
file already exists it will be overwritten. The index.html
file can also be viewed directly.
If you wish, the list of movies can be edited (e.g. movies added, removed, and properties such as description changed) in the movie_trailers_website.py
module.
Modules
- movie_trailers_website.py - the core module, that imports others as needed. Creates a list of movies then passes the list to an HTML generator module to output static content.
- media.py - used by
movie_trailers_website.py
to instantiate movies. - generate_html.py - used by
movie_trailers_website.py
to generate static HTML page from a list of movies.
Movie properties
Movies have the following properties, which are all strings:
title
The movie titleyear
Year the movie was releaseddirector
The movie directorstoryline
Brief summary of the plotcast
Main actorsimage_url
URL of a poster imagetrailer_url
URL of a YouTube videorating
Number of stars out of 5
Example
Here is an example of creating an instance for Toy Story, which can then be added to the list of movies to be displayed:
toy_story = media.Movie("Toy Story",
"1995",
"John Lasseter",
"A cowboy doll is profoundly threatened and jealous when a new spaceman figure supplants him as top toy in a boy's room.",
"Tom Hanks, Tim Allen, Don Rickles",
"https://upload.wikimedia.org/wikipedia/en/1/13/Toy_Story.jpg",
"https://www.youtube.com/watch?v=KYz2wyBy3kc",
"4.5")
movie_list = [movie1, movie2, toy_story]