A single-page web application showing a list of movies with infos and trailers. The page is dynamically generated by Python code on the back end.
The page will be generated by a Python code. To run the code, to following must be installed.
- Python 2.7
- Git
Clone a copy of the main Movie Index git repo by running:
git clone https://github.com/elbernante/movieindex.git
In the command line, go to the directory of movieindex/
and run the command:
python index.py
A new file index.html will be created (if it doesn't already exists, otherwise it will be overwritten) in the movieindex/
directory. This file will then be automatically launched on the default browser.
The following browsers are supported. Other browsers might work, but are not tested.
- Google Chrome on Mac (Version 43)
- Safari on Mac(Version 8)
Movie Index is following MVC pattern. It's directory includes 3 main folders soul/
, outfit/
, and brain/
to represent the model, view, and controller respectively for the design pattern.
movieindex/
├── soul/
│ ├── movie.py
│ └── movie_list.json
├── outfit/
│ ├── templates.py
│ ├── template_index.py
│ ├── template_index.html
│ ├── template_tile.py
│ ├── template_tile.html
│ ├── tempalte_nav_bar.py
│ ├── template_nav_bar.html
│ ├── template_banner.py
│ ├── template_banner.html
│ ├── template_footer.py
│ ├── template_footer.html
│ ├── css/
│ │ └── main.css
│ ├── js/
│ │ └── main.js
│ └── lib/
│ └── ... (external javascript libraries)
├── brain/
│ └── control_room.py
└── index.py
The soul/
represents the model part of the MVC pattern. It holds classes definitions. movie_list.json
holds a list of records of movies which is used to generate instances of Movie()
class.
The outfit/
represents the view part of the MVC pattern. It holds the files related to front-end. templates.py
contains an abstract class for html template classes. Each *.html
file has corresponding *.py
file to represent its Python class.
The brain/
represents the controller part of the MVC pattern. It contains the ControlRoom()
class which is responsible for coordinating between data and view.
A special file index.py
is the entry point of the application. It generates the index.html
file and launches it in the default browsing through ControlRoom()
class.