Skip to content

Enhance Student API: Fix Security Issues, Add Input Validation & Error Handling #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

2903Aishwarya
Copy link

Key Features of This Template:

  1. Structured Format - Clear sections with emoji visual cues
  2. Comparison-Ready - Table format for error handling scenarios
  3. Actionable Details - Includes setup instructions for reviewers
  4. Visual Aids - Placeholder for test screenshots
  5. Forward-Looking - Includes roadmap for next steps

When to Use:

  • When merging significant backend improvements
  • For infrastructure/security-related changes
  • When changes require environment modifications

@pratik-mahalle
Copy link

Hey @2903Aishwarya, Thank you for raising the pr. Our team will review the changes soon

id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
client = MongoClient(MONGO_URI)
db = client[DB_NAME]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have used name and main instead of name and main in:

app = Flask(_name_)
if _name_ == '_main_':

This will cause the app not to run as intended. Please fix to name and main.

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
# Config from environment variables

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new code uses MONGO_URI and DB_NAME env variables. Please update the README to document these and provide a sample .env file.

Copy link

@pratik-mahalle pratik-mahalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR replaces the original Flask + SQLAlchemy + PostgreSQL stack with Flask + PyMongo + MongoDB. This is a significant architectural change! Please clarify if the intention is to migrate the entire sample from PostgreSQL to MongoDB or to create a new example. Consider documenting this decision in the README and migration guides if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants