The Online Judge project is a web-based platform designed to facilitate coding competitions, practice problems, and algorithm challenges. This project allows users to submit their code, receive instant feedback on their submissions, and engage in competitive programming.
- Backend: Django for handling the web application logic and database interactions
- Frontend: HTML, CSS, Bootstrap, and Python inbuilt templates (like Jinja)
- Database: SQLite3 from Python Inbuilt libraries
- Containerization: Docker for easy deployment and environment consistency
Online Judge is a comprehensive web application designed to offer a platform for coding enthusiasts to solve and submit programming problems. Built using Django, this platform enables users to practice their coding skills and engage with a community of developers.
- Problem Repository: Browse a wide range of problems categorized by difficulty, topic, and programming language.
- Code Submission: Submit code solutions in multiple programming languages and receive instant feedback on performance and correctness.
- Real-time Judging: Solutions are automatically judged against predefined test cases, providing immediate results.
- User Accounts: Register and log in to track your progress, save submissions, and view your submission history.
- Custom Testing: Run your code with custom input to test and debug before final submission.
- User Profiles: Manage your account, view your solved problems, and track your performance statistics.
The home app is the heart of the Online Judge project. It includes the following key components:
- Models (models.py): Define the database schema, including models for Users, Problems, Submissions, and more.
- Views (views.py): Handle the request-response logic for the application, including rendering templates and processing form data.
- Forms (forms.py): Define the forms used in the application, such as user registration, problem creation, and code submission.
- Templates (templates/): Contains HTML templates for rendering the web pages, including pages for problem listings, submission details, user profiles, and more.
- Media (media/): Contains images used across the application.
- URLs (urls.py): Route incoming requests to the appropriate views.
The online_judge project directory contains global settings and configurations for the Django project.
- Settings (settings.py): Configuration settings for the Django project, including database settings, installed apps, middleware, and more.
- URLs (urls.py): Define the URL patterns for the project, linking to the URLs defined in the home app.
- WSGI (wsgi.py): Entry point for WSGI-compatible web servers to serve the Django project.
- Clone the Repository
- Setup Virtual Environment
- Install Dependencies (use requirements.txt)
- Database Setup (if you are not using Python's default SQLite3)
- Apply Migrations (
py manage.py makemigrationsandpy manage.py migrate) - Create superuser (
py manage.py createsuperuser) - Run the Server (
py manage.py runserver) - Access the application (Open your web browser and go to http://127.0.0.1:8000)
- Build Image (using Dockerfile)
- Run Docker Container (by mapping Docker container to your local port)
- Access the Application (Open your web browser and go to http://127.0.0.1:8000)
- Home: Overview of the platform and latest updates.
- Problems: Browse and select problems to solve.
- Submissions: View your past submissions and their results.
- Custom Test: Run custom tests on your code.
- Profile: Manage your account, view stats, and update profile picture.
- Navigate to the "Problems" section.
- Select a problem to view its details.
- Write your solution in the provided code editor.
- Submit your code to see the results.
- Navigate to the "Custom Test" section.
- Select your programming language.
- Write or paste your code and input data.
- Run the code to see the output.
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Push your changes to your fork.
- Submit a pull request.
Devansh Srivastava
GitHub: Devansh30032004
Website: https://online-judge.me/