by jcamargo
Student Management System
import logging
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app
# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class StandaloneApplication(BaseApplication):
def __init__(self, app, options=None):
self.application = app
self.options = options or {}
super().__init__()
def load_config(self):
# Apply configuration to Gunicorn
for key, value in self.options.items():
if key in self.cfg.settings and value is not None:
self.cfg.set(key.lower(), value)
def load(self):
Created: | Last Updated:
Here's a step-by-step guide for using the Student Management System template:
Introduction
This template provides a comprehensive student management system for tracking student information, including a web interface for adding and searching students.
Getting Started
- Click "Start with this Template" to begin using the Student Management System template in Lazy Builder.
Test the Application
- Click the "Test" button to deploy and run the application. This will launch the Lazy CLI and start the server.
Using the Student Management System
-
Once the application is running, you'll see a server link in the Lazy CLI. Click this link to open the Student Management System in your web browser.
-
The main page displays a list of all students in the system, along with a form to add new students and a search function.
-
To add a new student:
- Enter the student's first name and last name in the provided input fields.
-
Click the "Add Student" button to submit the form.
-
To search for students:
- Enter a search term (first name or last name) in the search input field.
-
Click the "Search" button to filter the student list based on your search term.
-
The student list will display each student's ID, first name, and last name in a table format.
Customizing the Application
-
If you want to customize the application further, you can modify the following files in the Lazy Builder interface:
-
students.html
: Adjust the layout and styling of the student management page. routes.py
: Modify or add new routes and functionality to the application.-
models.py
: Update the Student model or add new models as needed. -
After making any changes, use the "Test" button again to redeploy the application with your updates.
By following these steps, you'll have a functional Student Management System up and running, allowing you to add, view, and search for students in your database.