Django

College Event Registration Website

CampusConnect Introduction and Setup Configuring settings file for template, static and media files Setting up Tailwind Creating Custom User Model Creating Super User for CampusConnect Registering Custom User Model Search and Filter for User Model Serving Media Files During Development Categorizing Departments Linking Department with HOD Creating Abstract Model for Event Creating Model for Workshop Customizing Admin Page for Workshop Update in Model AbstractEvent Adding Instructor for Workshop Instructor Model Admin Page Adding Poster Field in Abstract Event Providing Access to HOD Access Update for HOD Restricting HOD Access to Particular Department AbstractEvent On Spot Registration Field Creating Workshop Object Creating and Linking Home Page Displaying Workshop on Home Page Styling Home Page Adding Workshop Detail Page Link Workshop Detail Page Workshop Detail Page Styling Workshop Instructor Details Workshop Detail Contact Contact Admin Page Many to Many Field for Contact Displaying Contact on Workshop Detail Page Adding Title for Workshop Detail Page Adding Gallery for Workshop Workshop Gallery Admin Page Displaying Gallery Images on Website Through Context Displaying Gallery Images on Website through template tags Authentication for users User Registration User Registration Submission Logout Functionality For User Login Functionality for User Model For Workshop Registration Workshop Registration Admin Page Register Workshop Function Register Button in Workshop Page Validations Before Workshop Registration Workshop Registration Closed Validaiton User Already Registered for Workshop Validation Workshop Registration Report From Admin Page Export using Library in Django Admin Extending Abstract Event for Hackathons

Adding Workshop Detail Page Link

Inside the cards that are displaying the basic workshop details, we can also add a button stating click me to know more, and redirect him to a new page where he can see more details about a particular event, and also register for that event. The functionality would be as such that it will redirect to a new page, irrespective of wether the user clicks on the button or the card.

So the button would be added inside the bottom of the card as follows :

<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
        {% for workshop in workshops %}
            <div class="bg-gray-700 p-6 mb-6 rounded-lg">
                <h3 class="text-xl font-semibold mb-1">{{ workshop.name }}</h3>
                <p class="text-gray-200">{{ workshop.description }}</p>
                <p class="text-gray-200"><b>Title:</b> {{ workshop.workshop_title }}</p>
                <p class="text-gray-200"><b>Date:</b> {{ workshop.start_date }} - {{ workshop.end_date }}</p>
                <p class="text-gray-200"><b>Venue:</b> {{ workshop.venue }}</p>
                <button class="bg-blue-500 text-white px-4 py-2 rounded-md mt-3">Click me to Know More</button>
            </div>

            {% empty %}
                <p class="text-gray-200 mx-2">No upcoming workshops at the moment.</p>
        {% endfor %}
    </div>

Here the button is added, and now the web page would look as follows : alt text The button can be moved to the center even for more nice look.

<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
        {% for workshop in workshops %}
            <div class="bg-gray-700 p-6 mb-6 rounded-lg">
                <h3 class="text-xl font-semibold mb-1">{{ workshop.name }}</h3>
                <p class="text-gray-200">{{ workshop.description }}</p>
                <p class="text-gray-200"><b>Title:</b> {{ workshop.workshop_title }}</p>
                <p class="text-gray-200"><b>Date:</b> {{ workshop.start_date }} - {{ workshop.end_date }}</p>
                <p class="text-gray-200"><b>Venue:</b> {{ workshop.venue }}</p>
                <div class="text-center">
                    <button class="bg-blue-500 text-white px-4 py-2 rounded-md mt-3">Click me to Know More</button>
                </div>
            </div>

            {% empty %}
                <p class="text-gray-200 mx-2">No upcoming workshops at the moment.</p>
        {% endfor %}
    </div>

After this, the web page would look like this, alt text Now as this has been done, a link to the card can be added to workshop_detail page along with its slug. This can be done as follows :

<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
        {% for workshop in workshops %}
            <a href="{% url 'workshop.detail' workshop.slug%}">
                <div class="bg-gray-700 p-6 mb-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-1">{{ workshop.name }}</h3>
                    <p class="text-gray-200">{{ workshop.description }}</p>
                    <p class="text-gray-200"><b>Title:</b> {{ workshop.workshop_title }}</p>
                    <p class="text-gray-200"><b>Date:</b> {{ workshop.start_date }} - {{ workshop.end_date }}</p>
                    <p class="text-gray-200"><b>Venue:</b> {{ workshop.venue }}</p>
                    <div class="text-center">
                        <button class="bg-blue-500 text-white px-4 py-2 rounded-md mt-3">Click me to Know More</button>
                    </div>
                </div>
            </a>

            {% empty %}
                <p class="text-gray-200 mx-2">No upcoming workshops at the moment.</p>
        {% endfor %}
    </div>

After doing this, the link would be added to workshop.detail page with slug as the argument. For now, it would show an error as there is no url named workshop.detail. alt text