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.
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.
- 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.
To get started with this project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/django-starter-project.git cd django-starter-project
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser for the admin interface:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
The project will be available at
http://127.0.0.1:8000/
.
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.
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.
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.