Fall 2026
  • Discord
  • Gradescope
  • Syllabus

On this page

  • Set Up Render
  • Data and Restarts

Deploy Your Final Project

Use this guide to put your final project on Render’s Free plan.

Set Up Render

Keep your code on GitHub. Render runs a copy of your Python server and gives the site a public URL you can share for live grading. Follow these steps from Render’s FastAPI guide, using your existing final-project repository:

  1. Commit and push the app, requirements.txt, templates, static files, db_create.py, and schema.sql. Include uvicorn, jinja2, python-multipart, and any other packages your app imports in requirements.txt. Keep .env and your local database out of git.

  2. Add a file named .python-version containing 3.12 to the repository root, then commit and push it. This selects the course’s Python version on Render; see Render’s Python-version instructions.

  3. Sign up for Render, choose New → Web Service, and connect your GitHub repository. Select your final-project branch, usually main.

  4. Select Python 3 and the Free instance type. Set the build command to python -m pip install -r requirements.txt.

  5. Set the start command to:

    python -m uvicorn app:app --host 0.0.0.0 --port $PORT

    Replace app:app if your module or FastAPI variable has a different name. Enter $PORT literally in Render’s start-command field; Render supplies its value. The command assumes your app and dependency file are in the repository root. If they are in a subfolder, set Render’s Root Directory to that folder.

  6. If your app needs API keys or a session secret, add those values in Render’s Environment settings. Keep them out of GitHub.

  7. Deploy, wait for the service to become live, and open its https://…onrender.com URL. If deployment fails, read the build or runtime logs to find the missing package, file, or setting.

Before the final, stop your local server and have a classmate open the hosted URL on another computer, create an account, log in, and post a message. Check that the page’s CSS and images load too. After changing your code, push it and confirm that Render has successfully deployed the commit you will demonstrate.

Data and Restarts

Render’s free services sleep after 15 minutes without traffic and can take about a minute to wake up. Their local SQLite data is lost when the service sleeps, restarts, or redeploys. These resets do not lose project points. Your local database must still preserve data across local server restarts.

The starter’s create_app calls initialize_database at startup. If the database is missing, the app creates it from schema.sql. Put any sample accounts or posts for your demo in that setup so they’ll be there again after a reset. If the file already exists, the app should keep its accounts and posts.

Open your hosted URL a few minutes before your appointment, allow it to wake up, and check the demo data. Submit the Render URL, not a localhost address or a temporary tunnel link. The Free plan meets the requirement; paid storage and a custom domain are not required.