Skip to content

anselmix80/k8sTutorialApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Comments App

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.

Project Structure

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

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd django-comments-app
    
  2. Create a virtual environment and activate it:

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

    pip install django
    
  4. 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
    
  5. Start the development server:

    python manage.py runserver
    
  6. 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

Note

For test in .env set these values: DJANGO_ENV not equal to production and DJANGO_DEBUG to True

Docker and K8s

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

Usage

  • 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.

Contributing

Feel free to submit issues or pull requests for improvements or bug fixes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors