Skip to content
/ django-base Public template

A clean and extensible Django template with base pages and Gemini chatbot integration.

License

Notifications You must be signed in to change notification settings

Lluc24/django-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧩 Django Template Project with Gemini Chat Integration

MIT License Python Last Commit Repo Size Issues Stars

This is a Django template project intended as a base for other web applications. It includes:

  • 🏠 A homepage
  • ℹ️ An "About Us" page
  • 📬 A contact form
  • 🤖 An AI Advisor chatbot powered by Google's Gemini API

It is structured for modularity and ease of extension.


🛠 Installation

✅ Prerequisites

  • Python 3.6+ (tested with Python 3.10.13)
  • pip (Python package manager)
  • git (optional but recommended)

📁 Clone the Repository

Clone this template to your local machine using:

git clone https://github.com/Lluc24/django-base.git
cd django-base

🔧 Setup Steps

  1. Create a virtual environment:

    python -m venv env
    source env/bin/activate  # On Windows: env\Scripts\activate
  2. Install the dependencies:

    pip install -r requirements.txt
  3. Apply database migrations (SQLite3):

    python manage.py migrate

🤖 Gemini API Setup

The advisor chatbot uses Google Gemini to generate responses.

🔐 Obtain and configure your API key

  1. Get an API key at:

    👉 https://aistudio.google.com/apikey

  2. Add it to your environment variables:

    export GOOGLE_API_KEY="your_api_key"  # On Windows: set GOOGLE_API_KEY=your_api_key

▶️ Running the Server

To run the project on your local machine:

python manage.py runserver

Then open your browser at http://localhost:8000

📁 Project Structure

The directory structure and relevant files of the project is:

.
├── advisor/                   # Chatbot app with Gemini integration
│   ├── admin.py
│   ├── apps.py
│   ├── forms/
│   ├── migrations/
│   ├── models/
│   │   └── chat_message.py
│   ├── templates/advisor/
│   │   └── chatmessage_form.html
│   ├── tests/
│   ├── urls.py
│   ├── utils/
│   └── views/
│       └── chat_form_view.py
│
├── base/                      # Base pages (home, contact, about)
│   ├── admin.py
│   ├── apps.py
│   ├── forms/
│   ├── migrations/
│   ├── models/
│   │   └── contact.py
│   ├── static/base/
│   │   ├── background.css
│   │   └── favicon.jpeg
│   ├── templates/base/
│   │   ├── about-us.html
│   │   ├── base-form.html
│   │   ├── base-template.html
│   │   ├── contact_detail.html
│   │   ├── contact_form.html
│   │   └── home.html
│   ├── tests/
│   ├── urls.py
│   ├── utils/
│   └── views/
|
├── LICENSE
│
├── mysite/                    # Django project settings and configuration
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
│
├── manage.py
├── requirements.txt
└── README.md

🧠 Gemini Chat Usage

Visit the following route in your browser:

/chat/

Ask questions and interact with the AI-powered advisor. Session-based chat history is preserved during your visit.

💡 Customization Ideas

You can extend this template by adding:

  • User authentication
  • Admin dashboards
  • RESTful APIs using Django REST Framework (DRF)
  • Bootstrap or TailwindCSS for responsive UI
  • Deployment configurations (Docker, Gunicorn, Nginx, etc.)

📬 Feedback & Contributions

Feel free to fork the project and adapt it to your needs. Contributions, bug reports, and suggestions are always welcome!

📜 License

This project is released under the MIT License. See LICENSE for details.

About

A clean and extensible Django template with base pages and Gemini chatbot integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published