🚚 move out comics data
This commit is contained in:
29
app.py
29
app.py
@@ -1,38 +1,11 @@
|
|||||||
from flask import Flask, render_template, abort
|
from flask import Flask, render_template, abort
|
||||||
|
from comics_data import COMICS
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
app.config['SECRET_KEY'] = 'your-secret-key-here' # Change this in production
|
app.config['SECRET_KEY'] = 'your-secret-key-here' # Change this in production
|
||||||
|
|
||||||
# Sample comic data (in production, this would come from a database)
|
|
||||||
COMICS = [
|
|
||||||
{
|
|
||||||
'number': 1,
|
|
||||||
'title': 'First Comic',
|
|
||||||
'filename': 'comic-001.png',
|
|
||||||
'date': '2025-01-01',
|
|
||||||
'alt_text': 'The very first comic',
|
|
||||||
'transcript': 'This is where your comic journey begins!'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'number': 2,
|
|
||||||
'title': 'Second Comic',
|
|
||||||
'filename': 'comic-002.png',
|
|
||||||
'date': '2025-01-08',
|
|
||||||
'alt_text': 'The second comic',
|
|
||||||
'transcript': 'The adventure continues...'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'number': 3,
|
|
||||||
'title': 'Third Comic',
|
|
||||||
'filename': 'comic-003.png',
|
|
||||||
'date': '2025-01-15',
|
|
||||||
'alt_text': 'The third comic',
|
|
||||||
'transcript': 'Things are getting interesting!'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def get_comic_by_number(number):
|
def get_comic_by_number(number):
|
||||||
"""Get a comic by its number"""
|
"""Get a comic by its number"""
|
||||||
|
|||||||
29
comics_data.py
Normal file
29
comics_data.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Comic data
|
||||||
|
# Edit this file to add, remove, or modify comics
|
||||||
|
|
||||||
|
COMICS = [
|
||||||
|
{
|
||||||
|
'number': 1,
|
||||||
|
'title': 'First Comic',
|
||||||
|
'filename': 'comic-001.png',
|
||||||
|
'date': '2025-01-01',
|
||||||
|
'alt_text': 'The very first comic',
|
||||||
|
'transcript': 'This is where your comic journey begins!'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'number': 2,
|
||||||
|
'title': 'Second Comic',
|
||||||
|
'filename': 'comic-002.png',
|
||||||
|
'date': '2025-01-08',
|
||||||
|
'alt_text': 'The second comic',
|
||||||
|
'transcript': 'The adventure continues...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'number': 3,
|
||||||
|
'title': 'Third Comic',
|
||||||
|
'filename': 'comic-003.png',
|
||||||
|
'date': '2025-01-15',
|
||||||
|
'alt_text': 'The third comic',
|
||||||
|
'transcript': 'Things are getting interesting!'
|
||||||
|
},
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user