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

File Structure in Django Project

In a Django project, several key files play critical roles in the configuration and functionality of the application. Here's a summary of the purpose of these files:

1. settings.py:

  • This file contains the project's settings and configuration. It defines database settings, middleware, installed apps, static and media file configurations, and more.
  • Developers use settings.py to customize the behavior of their Django project. It's often one of the first files you modify when starting a new project.
  • Key Configurations: DATABASES, INSTALLED_APPS, MIDDLEWARE, STATIC_URL, MEDIA_URL, SECRET_KEY, DEBUG, and more.

2. urls.py:

  • This file is used to define URL patterns and their associated view functions or classes. It acts as a routing mechanism to map URLs to specific views.
  • Developers use urls.py to create the structure of their application's URLs, making it accessible to users and connecting them to the appropriate views. The urls.py in the project's folder contains routes for the apps created inside the project.
  • Key Elements: urlpatterns, path() , include() and re_path() functions for defining URL patterns.

3. wsgi.py (Web Server Gateway Interface):

  • This file is used for deploying Django applications on traditional web servers like Apache or Nginx. It acts as an entry point for web servers to interact with Django.
  • In production deployments, web servers communicate with the application through wsgi.py.

4. asgi.py (Asynchronous Server Gateway Interface):

  • This file is used for deploying Django applications that utilize asynchronous features and technologies, such as Django Channels. It's an entry point for ASGI servers like Daphne or Uvicorn.
  • When using asynchronous features in Django, web servers interact with the application through asgi.py.