Here are the __init__.py files for the remaining three technology apps:
background_remover/init .py
python Copy code
from flask import Blueprint
background_remover = Blueprint(
'background_remover',
__name__,
template_folder='templates',
static_folder='static',
static_url_path='/background_remover_static' # Explicit custom path
)
# Debug prints for blueprint CREATION
print(f"🔵 Created '{background_remover.name}' blueprint")
print(f" Template folder: {background_remover.template_folder}")
print(f" Static folder: {background_remover.static_folder}")
print(f" Static URL path: {background_remover.static_url_path}")
print(f" Static files will be served at: {background_remover.static_url_path}/<filename>")
print("-" * 50)
from . import routes # Import routes AFTER blueprint creation
base64_form/init .py
python Copy code
from flask import Blueprint
base64_form = Blueprint(
'base64_form',
__name__,
template_folder='templates',
static_folder='static',
static_url_path='/base64_form_static' # Explicit custom path
)
# Debug prints for blueprint CREATION
print(f"🔵 Created '{base64_form.name}' blueprint")
print(f" Template folder: {base64_form.template_folder}")
print(f" Static folder: {base64_form.static_folder}")
print(f" Static URL path: {base64_form.static_url_path}")
print(f" Static files will be served at: {base64_form.static_url_path}/<filename>")
print("-" * 50)
from . import routes # Import routes AFTER blueprint creation
base64_file/init .py
python Copy code
from flask import Blueprint
base64_file = Blueprint(
'base64_file',
__name__,
template_folder='templates',
static_folder='static',
static_url_path='/base64_file_static' # Explicit custom path
)
# Debug prints for blueprint CREATION
print(f"🔵 Created '{base64_file.name}' blueprint")
print(f" Template folder: {base64_file.template_folder}")
print(f" Static folder: {base64_file.static_folder}")
print(f" Static URL path: {base64_file.static_url_path}")
print(f" Static files will be served at: {base64_file.static_url_path}/<filename>")
print("-" * 50)
from . import routes # Import routes AFTER blueprint creation
Update Root __init__.py to Import Blueprint Instances Directly
python Copy code
from .passport_photo import passport_photo
from .background_remover import background_remover
from .base64_form import base64_form
from .base64_file import base64_file
def register_technology_blueprints(app):
app.register_blueprint(passport_photo, url_prefix='/passport')
print(f"✅ Registered 'passport_photo' at: {app.url_map.bind('passport_photo').prefix}")
app.register_blueprint(background_remover, url_prefix='/background')
print(f"✅ Registered 'background_remover' at: {app.url_map.bind('background_remover').prefix}")
app.register_blueprint(base64_form, url_prefix='/base64form')
print(f"✅ Registered 'base64_form' at: {app.url_map.bind('base64_form').prefix}")
app.register_blueprint(base64_file, url_prefix='/base64file')
print(f"✅ Registered 'base64_file' at: {app.url_map.bind('base64_file').prefix}")
Verification
After making these changes, your application should now have explicit static URL paths for all four blueprints:
/passport/passport_photo_static/
/background/background_remover_static/
/base64form/base64_form_static/
/base64file/base64_file_static/