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

Manage.py file in Django

The manage.py file is a crucial component of a Django project, and it serves as a command-line utility that allows developers to perform various tasks related to managing and interacting with their Django applications. Here's an overview of the manage.py file's purpose and functionalities:

Purpose: The primary purpose of the manage.py file is to provide a convenient interface for executing administrative and development tasks for a Django project. It is automatically created when you create a new Django project using the django-admin startproject command.

Key Functionalities:

  1. Running the Development Server:
    • The runserver command starts a lightweight development server, allowing you to test your Django application locally.
    • Example: python manage.py runserver
  2. Creating Django Apps:
    • You can create new Django apps within your project using the startapp command.
    • Example: python manage.py startapp myapp
  3. Database Migrations:
    • Django uses the makemigrations and migrate commands to manage database schema changes and apply migrations to the database.
    • Example:
      • python manage.py makemigrations
      • python manage.py migrate
  4. Creating Superusers:
    • The createsuperuser command allows you to create administrative users for the Django admin interface.
    • Example: python manage.py createsuperuser
  5. Interacting with the Django Shell:
    • You can access the Django shell, an interactive Python environment with access to your project's models and database, using the shell command.
    • Example: python manage.py shell
  6. Running Tests:
    • The test command runs tests defined in your Django project, helping you ensure the correctness of your application.
    • Example: python manage.py test
  7. Collecting Static Files:
    • When you have static files (e.g., CSS, JavaScript) in your project, you use the collectstatic command to gather and organize them for deployment.
    • Example: python manage.py collectstatic
  8. Custom Management Commands:
    • You can create custom management commands specific to your project. These commands can automate various tasks.
    • Example: python manage.py my_custom_command
  9. Listing Available Commands:
    • To see a list of all available manage.py commands, simply run the help command.
    • Example: python manage.py help

The manage.py file essentially provides a unified interface for managing your Django project, and it plays a crucial role in the development, testing, and deployment of Django applications. It simplifies many common tasks and allows you to focus on building and maintaining your web application.

You will see about all the commands in detail with suitable examples further in the course.