https://github.com/marcoscalitas/cs50w-wiki
An online encyclopedia project similar to Wikipedia, developed with Django and Markdown. Allows for viewing, creating, editing, and searching entries, operating locally without the need for a server. Created as part of Harvard University's CS50's Web Programming with Python and JavaScript course.
https://github.com/marcoscalitas/cs50w-wiki
bootstrap css django html javascript markdown python
Last synced: about 1 year ago
JSON representation
An online encyclopedia project similar to Wikipedia, developed with Django and Markdown. Allows for viewing, creating, editing, and searching entries, operating locally without the need for a server. Created as part of Harvard University's CS50's Web Programming with Python and JavaScript course.
- Host: GitHub
- URL: https://github.com/marcoscalitas/cs50w-wiki
- Owner: marcoscalitas
- License: mit
- Created: 2024-08-26T11:24:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-08T15:52:59.000Z (over 1 year ago)
- Last Synced: 2025-01-06T16:14:22.831Z (over 1 year ago)
- Topics: bootstrap, css, django, html, javascript, markdown, python
- Language: JavaScript
- Homepage: https://cs50w-wiki-ruddy.vercel.app
- Size: 619 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CS50's Web Project 1 - Wiki
- [CS50's Web Project 1 - Wiki](#cs50s-web-project-1---wiki)
- [Overview](#overview)
- [Features](#features)
- [404 Error Page Setup](#404-error-page-setup)
- [Demo](#demo)
- [Technologies](#technologies)
- [Requirements](#requirements)
- [Installation](#installation)
- [Project Structure](#project-structure)
## Overview
This is the **"Wiki"** project, developed as part of the CS50's Web Programming with Python and JavaScript course. This project is an online encyclopedia similar to Wikipedia, where users can view, create, edit, and search entries using Markdown.
## Demo
https://cs50w-wiki.onrender.com/
## Features
- **Home Page:** Lists all encyclopedia entries and allows navigation to any of them.

- **Entry Page:** Displays the content of a specific encyclopedia entry.

- **Search:** Facilitates searching for entries, returning relevant results.

- **New Page:** Allows the creation of new entries, provided that the title of the new entry does not already exist.

- **Edit Page:** Provides the option to edit the content of any existing entry.

- **Random Page:** Redirects the user to a random entry in the encyclopedia.
- **Markdown to HTML Conversion:** Entries are converted from Markdown to HTML when displayed.
### 404 Error Page Setup
The project includes two approaches for rendering the 404 error page:
- **Custom Middleware:** A custom middleware displays a 404 error page when the debug mode is enabled.
- **Production Setup:** When the project is deployed to a production server and the debug mode is disabled, Django uses its default configuration to display a 404 error page.

## Technologies
- **Front-end:**
- HTML
- CSS
- Bootstrap
- JavaScript
- **Back-end:**
- Python
- Django
## Requirements
- Python 3.12.5
- pip 24.2
- Django 5.1
- markdown 2 2.5.0
## Installation
1. Clone the repository to your local environment:
```bash
git clone
2. Create and activate a virtual environment:
```bash
python -m venv .venv
source .venv/bin/activate # For Unix or MacOS systems
.\.venv\Scripts\activate # For Windows PowerShell
```
3. Install the required dependencies with the command:
```bash
pip install or pip install -r requirements.txt
```
4. Start the Django development server:
```bash
python manage.py runserver
```
5. Access the application in your browser at `http://127.0.0.1:8000/`.
## Project Structure
- `encyclopedia/` - Main Django application containing all the encyclopedia functionalities.
- `middleware/` - Directory containing the custom middleware for displaying the 404 error page.
- `static/` - Directory for static files such as CSS, JavaScript, and images.
- `templates/` - Contains the HTML templates used to render the encyclopedia pages.
- `forms.py` - Contains the forms used to create and edit entries.
- `urls.py` - Defines the application's routes and maps URLs to corresponding views.
- `util.py` - Utility file with helper functions.
- `views.py` - Contains the views responsible for processing requests and rendering the appropriate pages.
- `apps.py` - Django application configuration.
- `entries/` - Directory storing all encyclopedia entries in Markdown files.
---