by we
App Title: ASCII Flix
import logging
from flask import Flask, render_template
from gunicorn.app.base import BaseApplication
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
app = Flask(__name__)
@app.route("/")
def home_route():
return render_template("home.html")
@app.route("/movies")
def movie_route():
movies = [
{"title": "Century Movie 1", "content": ".......... @@@@@ @@@@@........\n ......... @ @ @ @........\n ........ @@@ @ @.........\n ....... @@ @ @ ........\n ...... @@@@@@@ @@@@@ th .......\n ..... ----------------------- ......\n .... C E N T U R Y .....\n ... ----------------------- ...\n .. @@@@@ @@@@@ @ @ @@@@@ ..\n == @ @ @ @ @ ==\n __||__ @ @@@@ @ @ __||__\n | | @ @ @ @ @ | |\n _____|______|_____ @ @@@@@ @ @ @ _____|______|_____"},
{"title": "Century Movie 2", "content": " ......... @@@@@ @@@@@ ..........\n ......... @ @ @ @ .........\n ......... @@@ @ @ ........\n ....... @@ @ @ ........\n ...... @@@@@@@ @@@@@ th .......\n ..... ----------------------- ......\n .... C E N T U R Y .....\n .. ----------------------- ...\n .. @@@@@ @@@@@ @ @ @@@@@ ..\n == @ @ @ @ @ ==\n __||__ @ @@@@ @ @ __||__\n | | @ @ @ @ @ | |\n_|______|_____ @ @@@@@ @ @ @ _____|______|_____"},
{"title": "Century Movie 3", "content": " .......... @@@@@ @@@@@ ...........\n ......... @ @ @ @ ..........\n ........ @@@ @ @ ........\n ....... @@ @ @ ........\n ...... @@@@@@@ @@@@@ th .......\n ..... ----------------------- .....\n .... C E N T U R Y ....\n ... ----------------------- ...\n .. @@@@@ @@@@@ @ @ @@@@@ ..\n == @ @ @ @ @ ==\n__||__ @ @@@@ @ @ __||__\n| | @ @ @ @ @ | |\n|______|_____ @ @@@@@ @ @ @ _____|______|_____"}
]
return render_template("movie_list.html", movies=movies)
Created: | Last Updated:
Here's a step-by-step guide for using the ASCII Flix template:
Introduction
The ASCII Flix template allows you to create a web application that displays ASCII art movies. This guide will walk you through setting up and using the template to create your own ASCII movie gallery.
Getting Started
-
Click "Start with this Template" to begin using the ASCII Flix template in the Lazy Builder interface.
-
Once the template is loaded, you'll see the pre-populated code for the main application, HTML templates, and CSS styles.
Test the Application
-
Click the "Test" button to deploy and run the application.
-
The Lazy CLI will start, and you'll see deployment progress in the console.
-
Once deployment is complete, you'll receive a dedicated server link to access your ASCII Flix application.
Using the Application
-
Open the provided server link in your web browser to view the ASCII Flix application.
-
You'll see a welcome page with a link to view the ASCII movies.
-
Click on the "View Movies" link to see the gallery of ASCII art movies.
-
The movie gallery page will display three sample ASCII art movies, each with a title and ASCII content.
Customizing the Application
To customize the ASCII Flix application, you can modify the following parts of the code:
- Update the movie data in the
main.py
file:
python
movies = [
{"title": "Your Movie Title", "content": "Your ASCII art content"},
# Add more movies as needed
]
-
Modify the HTML templates (
home.html
andmovie_list.html
) to change the layout or add new elements. -
Adjust the CSS styles in
style.css
to customize the appearance of the application. -
If you want to add more routes or functionality, you can extend the Flask application in
main.py
.
Remember that any changes you make will be automatically deployed when you click the "Test" button again.
By following these steps, you'll have a functioning ASCII Flix application that displays a gallery of ASCII art movies. You can continue to customize and expand the application as needed for your specific use case.