Skip to content

PatrickAsaad1/Python-Django-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kwentra Demo

Python Django License Status

A full-stack Django web application modeled after Kwentra — a real hospitality technology company. Built to practice Django fundamentals including authentication, URL routing, template inheritance, environment variable management, and protected views.


Table of Contents


Overview

This project simulates the public-facing website and members portal of a hospitality SaaS company. It demonstrates a complete Django application with:

  • A multi-page public site (Home, About, Services, Contact)
  • A protected Members Portal accessible only to authenticated users
  • Full user authentication (login, logout, signup) using Django's built-in auth system
  • A custom 404 error page
  • Secure secret key management via .env

Tech Stack

Layer Technology
Backend Python 3.8+, Django 6+
Frontend HTML5, CSS3 (custom, no framework)
Database SQLite3 (default Django dev DB)
Auth Django's built-in auth system + UserCreationForm
Config python-dotenv for environment variables
Version Control Git + GitHub

Features

Public Pages

  • Home — Hero section with company tagline, three feature cards (Hotel Management, Restaurant POS, Analytics), and an auth-aware navigation bar that shows different links depending on login state
  • About — Company background (founded 2013 by hoteliers), four value-proposition cards (Increased Revenue, Operational Efficiency, Cost-Effectiveness, Guest Loyalty), and global stats (20+ countries, 11–50 employees)

Protected Pages (login required)

  • Services — Six hospitality services in a responsive hover-card grid: Reservations Management, Front Office Operations, Revenue Optimization, Automated Accounting, Inventory Management, and Guest Loyalty & CRM
  • Contact — Company contact details including website, HQ location (EMEA), company size, global reach, LinkedIn presence, and a demo request link
  • Members Portal — Entry point for authenticated users with access to dashboards, projects, and internal resources

Authentication

  • Login and logout powered by Django's built-in LoginView and LogoutView
  • User registration via UserCreationForm — registers, logs in, and redirects in a single step
  • @login_required decorator applied to all protected views
  • LOGIN_REDIRECT_URL, LOGOUT_REDIRECT_URL, and LOGIN_URL configured in settings.py
  • CSRF protection on all forms via {% csrf_token %}

UI & Design

  • Dark navy (#0a1628) and cyan (#00d4ff) color scheme throughout
  • Hover effects on service cards (lift + blue border)
  • Logout button turns red on hover
  • Custom handler404 renders a branded 404 page with a "Back to Home" button

URL Routes

URL Page Auth Required
/ Home No
/about/ About No
/login/ Login No
/signup/ Sign Up No
/services/ Services ✅ Yes
/contact/ Contact ✅ Yes
/members/ Members Portal ✅ Yes
/logout/ Logout (POST only) ✅ Yes
/admin/ Django Admin Panel Staff only
Anything else Custom 404 Page

Getting Started

Prerequisites

  • Python 3.8 or higher
  • pip
  • Git

Installation

# 1. Clone the repository
git clone https://github.com/PatrickAsaad1/kwentra_demo.git
cd kwentra_demo
 
# 2. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate        # On Windows: venv\Scripts\activate
 
# 3. Install dependencies
pip install -r requirements.txt
 
# 4. Set up your environment variables
cp .env.example .env
# Then open .env and fill in your SECRET_KEY
 
# 5. Apply database migrations
python manage.py migrate
 
# 6. (Optional) Create a superuser for the Django admin panel
python manage.py createsuperuser
 
# 7. Start the development server
python manage.py runserver

Visit http://localhost:8000 in your browser.


Environment Variables

Create a .env file in the root directory with the following:

SECRET_KEY=your-secret-key-here

Django uses this key for session signing, CSRF token generation, and password hashing. This file must never be committed to Git — it is already listed in .gitignore.

A .env.example file is included as a safe reference template:

SECRET_KEY=

To generate a secure secret key, run:

python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"

Dependencies

All dependencies are listed in requirements.txt:

Django>=6.0
python-dotenv>=1.0

Install with:

pip install -r requirements.txt

License

This project is licensed under the MIT License — free to use, modify, and distribute with attribution.


Built as a learning project to practice Django web development.
Modeled after kwentra.com.

About

Django web apps built while learning Python web development. Blog, bot dashboard, and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors