Skip to content

new updates #1

Closed
BiancaCodes-c wants to merge 3 commits intoZCW-Spring26:mainfrom
Circus-Circus-data-7-0:main
Closed

new updates #1
BiancaCodes-c wants to merge 3 commits intoZCW-Spring26:mainfrom
Circus-Circus-data-7-0:main

Conversation

@BiancaCodes-c
Copy link
Copy Markdown

new updates made by David

Copilot AI review requested due to automatic review settings April 6, 2026 18:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the project to run the Flask app as a proper package/module (instead of cd’ing into forum) and aligns imports accordingly.

Changes:

  • Update run.sh to set FLASK_APP=forum.app and run Flask on a specified port.
  • Convert forum.* absolute imports to package-relative imports (from .models ...) across key modules.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
run.sh Switches to module-based Flask startup and changes the run port.
forum/routes.py Updates imports to package-relative form.
forum/app.py Updates model import to package-relative form.
forum/init.py Updates blueprint/db imports to package-relative form.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread run.sh
# you can ALSO or RATHER use the following command to run the app
cd ./forum; flask run
export FLASK_APP=forum.app
flask run --port 8000
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

run.sh hard-codes the Flask port to 8000, but the README currently documents that ./run.sh serves on port 5000. Consider either switching back to the default/5000 for local dev, or making the script respect $PORT (with a sensible default) so it works consistently across environments.

Suggested change
flask run --port 8000
flask run --port "${PORT:-5000}"

Copilot uses AI. Check for mistakes.
Comment thread run.sh
Comment on lines 2 to +6
export SECRET_KEY="kristofer"
# honcho start

# you can ALSO or RATHER use the following command to run the app
cd ./forum; flask run
export FLASK_APP=forum.app
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

SECRET_KEY is being exported from run.sh with a fixed value. This is a security risk (secret committed/replicated across environments) and also diverges from the config-based setup in config.py. Prefer reading the secret from the environment (or a local uncommitted .env) and failing fast when it’s missing, rather than setting a constant in the script.

Copilot uses AI. Check for mistakes.
Comment thread forum/routes.py
Comment on lines 5 to +7
from flask import Blueprint, render_template, request, redirect, url_for
from forum.models import User, Post, Comment, Subforum, valid_content, valid_title, db, generateLinkPath, error
from forum.user import username_taken, email_taken, valid_username
from .models import User, Post, Comment, Subforum, valid_content, valid_title, db, generateLinkPath, error
from .user import username_taken, email_taken, valid_username
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

There are two from flask import ... imports at the top of this file (line 1 and line 5), which duplicates render_template/request/redirect/url_for. Consolidating these into a single import keeps the module header easier to maintain and avoids accidental divergence.

Copilot uses AI. Check for mistakes.
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.

3 participants