This is a Django-based web application for rating issues and allowing users to vote on them. The app provides functionality for creating new issues and voting on existing issues with upvotes and downvotes.
- Python 3.8 or higher
- Django 3.2 or higher
- Pipenv or virtualenv for managing dependencies
-
Clone the repository:
git clone https://github.com/yourusername/issues-voting-app.git cd issues-voting-app
-
Create a virtual environment:
pipenv install pipenv shell
Or with virtualenv:
python -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Create a superuser to access the Django admin:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Open your browser and navigate to
http://127.0.0.1:8000
to access the application.
- To create a new issue, fill in the form on the right side of the page and click "Save".
- To vote on an issue, click the "Upvote" or "Downvote" buttons next to the issue in the list.
-
issues/
: Main app directorymigrations/
: Database migrations for the appstatic/
: Static files (CSS, JavaScript, images)templates/
: HTML templatesadmin.py
: Admin configuration for the appapps.py
: App configurationforms.py
: Forms used in the appmodels.py
: Database modelstests.py
: Test casesurls.py
: URL routing for the appviews.py
: View functions
-
project/
: Project-level configurationsettings.py
: Django settingsurls.py
: URL routing for the projectwsgi.py
: WSGI configuration
-
manage.py
: Django's command-line utility
Defines the database models for the app:
Issue
: Model representing an issue.Vote
: Model representing a vote on an issue.
Defines the forms used in the app:
IssueForm
: Form for creating a new issue.VoteForm
: Form for voting on an issue.
Contains the view functions for the app:
issue_list_and_create
: View for displaying the list of issues and creating a new issue.vote_issue
: View for voting on an issue.
HTML template for displaying the list of issues and the form for creating a new issue.
CSS file for styling the application.
Contributions are welcome! Please open an issue or submit a pull request with any changes.
This project is licensed under the MIT License.