This is a simple single-page web application built with Django that allows users to manage comments. The application supports the following features:
- Display a list of comments, paginated to show 10 comments per page.
- Add new comments.
- Edit existing comments.
- Delete comments.
The project is organized as follows:
django-comments-app
├── comments # Application for managing comments
│ ├── migrations # Database migrations
│ ├── static # Static files (CSS, JS)
│ ├── templates # HTML templates
│ ├── __init__.py # Marks the directory as a Python package
│ ├── admin.py # Admin site configuration
│ ├── apps.py # Application configuration
│ ├── models.py # Database models
│ ├── tests.py # Unit tests
│ ├── urls.py # URL routing for comments
│ └── views.py # View functions for handling requests
├── django_comments_app # Main Django project directory
│ ├── __init__.py # Marks the directory as a Python package
│ ├── asgi.py # ASGI configuration
│ ├── settings.py # Project settings
│ ├── urls.py # URL routing for the project
│ └── wsgi.py # WSGI configuration
├── manage.py # Command-line utility for managing the project
├── db.sqlite3 # SQLite database file
└── README.md # Project documentation
-
Clone the repository:
git clone <repository-url> cd django-comments-app -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` -
Install the required packages:
pip install django -
Run the migrations to set up the database and set static objects:
python manage.py makemigrations --noinput python manage.py migrate --noinput # python manage.py collectstatic --noinput -
Start the development server:
python manage.py runserver -
Open your web browser and navigate to
http://127.0.0.1:8000/to view the application.
Alternatively you can go in folder scripts and run shell command startTest.sh.
To clean all run cleanUp.sh
For test in .env set these values:
DJANGO_ENV not equal to production and DJANGO_DEBUG to True
Run startDocker.sh for Docker or startK8s.sh remember to set .env file:
DJANGO_ENV must be equal to production and DJANGO_DEBUG to False
- You can view the list of comments on the main page.
- Use the provided form to add new comments or edit existing ones.
- Each comment can be deleted, with a confirmation prompt to prevent accidental deletions.
Feel free to submit issues or pull requests for improvements or bug fixes.