Getting Started

Choose the stack, create a Django project, and confirm the development server runs.

Goal for this part

Lock the stack, create a Django 5 project named westloop, and confirm http://127.0.0.1:8000/ answers. A social network is a long build; a living project on day one keeps every later part honest.

What you should already know

You should be comfortable in a terminal and know what a Python function and import are. You do not need prior Django or PostgreSQL experience. Docker is used from part 4 for a local database; you can install it now.

  • Python 3.12 or newer
  • A code editor and a terminal
  • Optional now: Docker Desktop (required from the data-layer snapshot)

Why Django for a social network

Westloop is write-heavy and relationship-heavy: accounts, sessions, CSRF, ownership checks, and file uploads. Django ships those. Flask or Express would make you assemble the same pile from packages, which is a fine second project and a noisy first one.

We are not using Next.js or a separate API. Server-rendered HTML plus HTMX is enough for likes and follows, and it deploys as one Python process behind Nginx — the VPS story stays one box.

Walkthrough: create the project

Always work inside a virtual environment so Westloop’s packages do not collide with other Python work. The teaching repo keeps a shared requirements.txt at the root.

python3 -m venv .venv
source .venv/bin/activate
pip install "django~=5.1"
django-admin startproject westloop .
python manage.py migrate
python manage.py runserver

You should see this tree. manage.py is the command-line entry. The inner westloop package holds settings, root URLs, and the WSGI/ASGI hooks Gunicorn will use on the VPS.

westloop/
  manage.py
  westloop/
    __init__.py
    settings.py
    urls.py
    wsgi.py
    asgi.py

How to run it and what you should see

Clone the teaching repo, enter 01-Getting-Started, create a venv, install from the parent requirements file, migrate, and start the server. Open http://127.0.0.1:8000/. Django’s default success page means the project boots.

git clone https://github.com/michaeldunga1/fcc-django-social.git
cd fcc-django-social/01-Getting-Started
python3 -m venv .venv
source .venv/bin/activate
pip install -r ../requirements.txt
python manage.py migrate
python manage.py runserver

Common mistakes

If imports fail, the venv is not active. If the browser cannot connect, the terminal is not still running runserver, or you are in the wrong folder — manage.py must be in the current directory.

  • Activate the venv before pip or runserver
  • Install from ../requirements.txt
  • Stop the server with Ctrl+C after major changes

Try this

Open westloop/settings.py and find INSTALLED_APPS, SECRET_KEY, and DEBUG. Do not change them yet. Then restart on port 8001 with python manage.py runserver 8001 so the URL in the browser matches the port you chose.