/django-starter-project

A Django starter project featuring a simple Poll app, designed to help beginners learn the basics of Django by following the official tutorial.

Primary LanguagePython

Django Starter Project - Poll App

This repository contains a Django starter project aimed at helping beginners get familiar with Django's basic concepts. The primary focus of this project is the Poll app, which is built by following the official Django documentation.

Table of Contents

Project Overview

This project is a simple poll application where users can view polls, vote on them, and see the results. It serves as an introductory guide to Django, covering key concepts such as:

  • Models
  • Views
  • Templates
  • URL routing
  • Forms
  • Admin interface

The project follows the Django tutorial closely, making it easy for newcomers to grasp fundamental concepts.

Features

  • Poll Management: Create and manage polls through the Django admin interface.
  • Voting System: Users can vote on polls and see real-time results.
  • Admin Interface: Fully functional admin panel for managing polls and votes.

Installation

To get started with this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/django-starter-project.git
    cd django-starter-project
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Apply migrations:

    python manage.py migrate
  5. Create a superuser for the admin interface:

    python manage.py createsuperuser
  6. Run the development server:

    python manage.py runserver

    The project will be available at http://127.0.0.1:8000/.

Usage

Once the server is running, you can:

  • Access the Poll app: Navigate to http://127.0.0.1:8000/polls/ to view and vote on polls.
  • Admin Interface: Go to http://127.0.0.1:8000/admin/ to manage polls and votes.

Project Structure

django-starter-project/
├── mysite/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   ├── wsgi.py
├── polls/
│   ├── migrations/
│   ├── templates/
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── models.py
│   ├── tests.py
│   ├── urls.py
│   ├── views.py
├── manage.py
├── db.sqlite3
└── requirements.txt
  • mysite/: The main project directory containing settings and configuration.
  • polls/: The Poll app where models, views, templates, and URLs are defined.
  • manage.py: A command-line utility for interacting with the project.
  • requirements.txt: Lists the Python dependencies for the project.

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.