Online Crime Reporting System Project in Django

A Online Crime Reporting System in Django  is an easy project for beginners to learn how to build a web-based python Django project. We will provide you with the complete source code and database for the python project so that you can easily install it on your machine and learn how to program in Python Django. This project online reporting system for the crime related incidents that happened with you.

To start creating a Online Crime Reporting System Project in Python Django, makes sure that you have PyCharm Professional IDE Installed in your computer.

This Online Crime Reporting System in Django Framework, Also includes a Download Source Code for free, just find the downloadable source code below and click download now.

Checkout the linked below for other related articles.

About ProjectProject Details
Project Name Online Crime Reporting System in Django
Python version (Recommended)3.8 Version
Programming Language UsedPython Django Language
Developer Name itsourcecode.com
IDE Tool (Recommended)Sublime, Visual Studio, PyCharm
Project Type Web Application
DatabaseSQLite
Online Crime Reporting System in Django overview

User Features of Online Crime Reporting System in Django

  • Manage User Profile– For the user profile, The user can update his/her information details.
  • Registration– For the registration, The user need to register first to create their own account.
  • Add Complaint– For the complaint, The user can view and add complaint through this website.
  • Login – By default the user need to login first to enable to access the system.

Online Crime Reporting System in Django Steps on How to Create a Project

Time needed: 5 minutes

Here’s the step’s on how to create a Online Crime Reporting System Project in Django

  • Step 1: Open file.

    First , open “pycharm professional” after that click “file” and click “new project“.
    Create new Project for Online Crime Reporting System Project in Django with Source Code

  • Step 2: Choose Django.

    Next, after click “new project“, choose “Django” and click.
    choose django for Online Crime Reporting System Project in Django with Source Code

  • Step 3: Select file location.

    Then, select a file location wherever you want.
    Create Location Name for Online Crime Management System Project in Django with Source Code

  • Step 4: Create application name.

    After that, name your application.

  • Step 5: Click create.

    Lastly, finish creating project by clicking “create” button.
    Finish Creating Project Name for Online Crime Management System Project in Django with Source Code

  • Step 6: Start Coding.

    Finally, we will now start adding functionality to our Django Framework by adding some functional codes.

Functionality and Codes of the Online Crime Reporting System in Django

  • Create template for the login in form in Online Crime Reporting System Django.

In this section, we will learn on how create a templates for the student form. To begin with, add the following code in your login.html under the folder of templates/accounts/.

{% extends 'base.html' %}

{% block header %}
    <title>User Login</title>
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/register.css' %}">
{% endblock %}

{% block content %}
    {% load widget_tweaks %}
    {% if error_message %}
        <p>{{ error_message }}</p>
    {% endif %}

   <div class="w-50 mx-auto my-3">
   <h4 class="text-center mx-auto my-3">User Login</h4>
        <form method="post" action="{% url 'accounts:login' %}">
              {% csrf_token %}

              <div class="form-group">
                  <label for="username">Username:</label>
                  <input class="form-control" type="text" name="username" placeholder="Username">
              </div>

              <div class="form-group">
                  <label for="password">Password</label>
                  <input class="form-control" type="password" name="password" placeholder="Your Password">
              </div>

              <div class="container text-center">
                  <input type="submit" class="btn btn-danger col-md-4" name="" value="Login">
                  <button class="btn btn-success col-md-4"><a href="{% url 'accounts:register' %}" class="text-white">Register</a></button>
              </div>

        </form>
    </div>

{% endblock %}

  • Create template for the user registration

In this section, we will learn on how create a templates for the user registration. To start with, add the following code in your register.html under the folder of templates/account.

{% extends 'base.html' %}
{% load static %}

{% block header %} <title>User Registration</title>
<link rel="stylesheet" href="{% static 'css/register.css' %}">
{% endblock %}



{% block content %}
    <div class="container w-50 mx-auto my-3">
        <h4 class="text-center">REGISTRATION FORM</h4>
        <form enctype="multipart/form-data" method="post">{% csrf_token %}
        {% load widget_tweaks %}

        {% if messages %}
            {% for message in messages %}
                <div class="alert-danger">{{ message }}</div>
            {% endfor %}
        {% endif %}

        <div class="form-group">
            <label for="{{ form.username_for_label }}">Choose Your Username:</label>
            {{ form.username|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.first_name_for_label }}">Your First Name:</label>
            {{ form.first_name|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.last_name_for_label }}">Your Last Name:</label>
            {{ form.last_name|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.email_for_label }}">Your Email:</label>
            {{ form.email|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.password1_for_label }}">Your Password:</label>
            {{ form.password1|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.password2_for_label }}">Confirm Your Password:</label>
            {{ form.password2|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.bio_for_label }}">Your Biography in Short:</label>
            {{ form.bio|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.profile_image_for_label }}">Upload Your Profile Picture:</label>
            {{ form.profile_image|add_class:"form-file-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.phone_no_for_label }}">Your Phone Number:</label>
            {{ form.phone_no|add_class:"form-control" }}
        </div>

        <div class="container text-center w-50">
            <input type="submit" class="btn-lg btn-success" value="REGISTER">
        </div>

    </form>
</div>
{% endblock %}

  • Create template for the new complaint form.

In this section, we will learn on how create a templates for the new complaint form. To start with, add the following code in your new_complaint.html under the folder of templates/complaints.

{% extends 'base.html' %}
{% load static %}

{% block header %} <title>Register a New Complaint</title>
<link rel="stylesheet" href="{% static 'css/register.css' %}">
{% endblock %}

{% block content %}
    <div class="container w-50 mx-auto my-3">
        <h4 class="text-center">COMPLAINTS FORM</h4>
        <form enctype="multipart/form-data" method="post">{% csrf_token %}
        {% load widget_tweaks %}

        {% if messages %}
            {% for message in messages %}
                <div class="alert-danger">{{ message }}</div>
            {% endfor %}
        {% endif %}

        <div class="form-group">
            <label for="{{ form.title_for_label }}">Complaint Title</label>
            {{ form.title|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.category_for_label }}">Category of Incident</label>
            {{ form.category|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.description_for_label }}">Please Describe What Happened With You?</label>
            {{ form.description|add_class:"form-control" }}
        </div>

        <div class="form-group">
            <label for="{{ form.location_for_label }}">Where did this happen?:</label>
            {{ form.location|add_class:"form-control" }}
        </div>

        <div class="container text-center w-50">
            <input type="submit" class="btn-lg btn-success" value="POST COMPLAIN">
        </div>

    </form>
</div>

    <script>
    $(document).ready(function() {
        let form_container = $('.container');
        form_container.hide();

        form_container.fadeIn(1000);
    });
    </script>
{% endblock %}

  • Create template for the complaint table form

In this section, we will learn on how create a templates for the complaint table. To start with, add the following code in your all_complaints.html under the folder of templates/complaints.

<style>
    .complain-container {
        font-family: "Nunito", sans-serif;
        padding: 1rem;
        margin: 1rem;
    }
</style>

{% extends 'base.html' %}
{% load static %}

{% block header %} <title>All Registered Complaints</title>

{% endblock %}

{% block content %}
    <div class="container complain-container">
        <table class="table">
    <thead>
      <tr class="my-3">
        <th>Complain Title</th>
        <th>Submitted By</th>
        <th>View Details</th>
      </tr>
    </thead>
    <tbody>
    {% for each_object in object_list %}
        <tr>
            <td>{{ each_object.title }}</td>
            <td>{{ each_object.created_by }}</td>
            <td><a href="{% url 'complaints:detail_complain' pk=each_object.pk %}">View Details</a></td>
        </tr>
    {% endfor %}

    </tbody>
  </table>
    </div>
{% endblock %}

Downloadable Source Code Below.

Anyway, if you want to level up your programming knowledge, especially python, try this new article I’ve made for you Best Python Projects with source code for Beginners. But If you’re going to focus on web development using Django, you can download here from our list of Best Django Projects with source code based on real-world projects.

How To Run The Online Crime Reporting System in Django?

  • Step 1: Extract/unzip the file
  • Step 2: Go inside the project folder, open cmd and type the following commands to install Django Framework and run the webserver:
  • python manage.py migrate
  • python manage.py runserver
  • Step 3: Finally, open the browser and go to http://127.0.0.1:8000/

Summary

In summary, this 2022 Online Crime Reporting System in Django with Source Code can be useful to students or professional who wants to learn python programming language. This project can also be modified to fit your personal requirements. Hope this project will help you to improve your skills. Happy Coding!

Inquiries

If you have any questions or suggestions about Online Crime Reporting System Project in Django with Source Code, please feel free to leave a comment below.

2 thoughts on “Online Crime Reporting System Project in Django”

Leave a Comment