Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
16 changes: 16 additions & 0 deletions CarsRental/CarsRental/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for CarsRental project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/6.0/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CarsRental.settings')

application = get_asgi_application()
118 changes: 118 additions & 0 deletions CarsRental/CarsRental/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
"""
Django settings for CarsRental project.

Generated by 'django-admin startproject' using Django 6.0.3.

For more information on this file, see
https://docs.djangoproject.com/en/6.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/6.0/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/6.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-wn0bhngrk58m42&!&=7+y=ohm!mhic-q6cx#!ks_lv(8qh^17x'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'main',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'CarsRental.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'CarsRental.wsgi.application'


# Database
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/6.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/6.0/howto/static-files/

STATIC_URL = 'static/'
25 changes: 25 additions & 0 deletions CarsRental/CarsRental/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
URL configuration for CarsRental project.

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/6.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include

urlpatterns = [
path('admin/', admin.site.urls),
path('', include("main.urls")),

]
16 changes: 16 additions & 0 deletions CarsRental/CarsRental/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for CarsRental project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/6.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CarsRental.settings')

application = get_wsgi_application()
Empty file added CarsRental/main/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions CarsRental/main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions CarsRental/main/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MainConfig(AppConfig):
name = 'main'
Empty file.
3 changes: 3 additions & 0 deletions CarsRental/main/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
65 changes: 65 additions & 0 deletions CarsRental/main/templates/main/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Premium Car Rentals</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, sans-serif;
background-color: #003049;
color: #fdf0d5;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
text-align: center;
}

.container {
border: 4px double #c1121f;
padding: 40px;
max-width: 600px;
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

h1 {
font-size: 3rem;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 3px;
color: #fdf0d5;
text-shadow: 2px 2px 0px #c1121f;
}

p {
font-size: 1.2rem;
line-height: 1.6;
color: #669bbc;
font-style: italic;
}

.highlight {
color: #c1121f;
font-weight: bold;
}
</style>
</head>
<body>

<div class="container">
<h1>Drive Your <span class="highlight">Dreams</span></h1>

<p>
Experience the ultimate freedom on the road. From luxury sedans to powerful SUVs,
we provide the perfect ride for your next journey.
<br>
<strong>Reliability meet Elegance.</strong>
</p>
</div>

</body>
</html>
71 changes: 71 additions & 0 deletions CarsRental/main/templates/main/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Car Rentals - Home</title>
<style>

body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #003049;
background: radial-gradient(circle, #003049 0%, #001a2c 100%);
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}


.hero-container {
border: 2px solid #fdf0d5;
padding: 50px;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
max-width: 900px;
text-align: center;
background-color: rgba(253, 240, 213, 0.05);
}

h1 {
color: #fdf0d5;
font-size: 3.5rem;
margin: 0;
line-height: 1.3;
text-shadow: 3px 3px 6px rgba(0,0,0,0.6);
}

span {
color: #c1121f;
font-weight: bold;
display: inline-block;
transition: transform 0.3s ease;
}


span:hover {
transform: scale(1.1);
text-shadow: 0 0 15px #c1121f;
}

.welcome-text {
font-size: 1.5rem;
color: #669bbc;
margin-top: 20px;
display: block;
opacity: 0.9;
}
</style>
</head>
<body>
<div class="hero-container">
<h1>
<span>Hello World,</span><br>
This is my new HOME for <br>
Car Rentals Website!
</h1>
<span class="welcome-text">We're excited to welcome you here.</span>
</div>
</body>
</html>
Loading