A simple social network application built with Django during the Harvard CS50w course.
- Signed-in users can write and submit a new post via a text area and a submit button.
- This can be implemented either:
- At the top of the All Posts page (as in the provided screenshot), or
- On a separate New Post page.
- The “All Posts” page (linked in the navigation bar) shows all user posts.
- Posts should be:
- Ordered most recent first.
- Include:
- Poster’s username
- Content
- Date/time posted
- Number of likes (initially 0)
- Clicking a username leads to their profile page.
- This page displays:
- Number of followers
- Number of people the user follows
- The user’s posts in reverse chronological order
- If the visitor is signed in and viewing another user’s profile:
- Display a “Follow” or “Unfollow” button.
⚠️ A user should not be able to follow themselves.
- The “Following” page (in the nav bar) shows posts made by users that the current user follows.
- Page should:
- Work like All Posts, but filtered to followed users.
- Be available only to signed-in users.
- Pages showing posts must display 10 posts per page.
- If more than 10:
- Show a “Next” button to view older posts.
- If not on the first page, show a “Previous” button.
- Users can click an “Edit” button/link on their own posts.
- Upon clicking:
- Post content turns into a textarea.
- User can edit and save changes.
- Use JavaScript to update the content asynchronously (without full page reload).
- 🔐 Ensure that only the original poster can edit their post.
- Users can toggle a “Like” or “Unlike” button on any post.
- On click:
- Use JavaScript fetch to update the like count asynchronously.
- Post’s displayed like count should update without reloading the page.
Follow these steps to set up and run the Django project locally:
git clone <https://github.com/guiklose/simple-network.git>
cd <simple-network>🔵 On macOS/Linux:
python3 -m venv venv
source venv/bin/activate🟢 On Windows (CMD):
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverOpen your browser and go to: http://127.0.0.1:8000/