Skip to content

Commit bd599bc

Browse files
Add files via upload
1 parent 90cacd6 commit bd599bc

6 files changed

Lines changed: 224 additions & 0 deletions

File tree

My_Portfolio_Website/Essentiall_Files/__init__.py

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for Hi_backend project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/6.0/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hi_backend.settings')
15+
16+
application = get_asgi_application()
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
"""
2+
Django settings for Hi_backend project.
3+
4+
Generated by 'django-admin startproject' using Django 6.0.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/6.0/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/6.0/ref/settings/
11+
"""
12+
13+
from pathlib import Path
14+
15+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+
BASE_DIR = Path(__file__).resolve().parent.parent
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/6.0/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'django-insecure-mzek)w2q^5ljp)7zvbt)ogqc**4875*33eg+9)251vr^bol%ur'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'django.contrib.admin',
35+
'django.contrib.auth',
36+
'django.contrib.contenttypes',
37+
'django.contrib.sessions',
38+
'django.contrib.messages',
39+
'django.contrib.staticfiles',
40+
'Hi_backend',
41+
# <-- add your app here
42+
]
43+
44+
45+
MIDDLEWARE = [
46+
'django.middleware.security.SecurityMiddleware',
47+
'django.contrib.sessions.middleware.SessionMiddleware',
48+
'django.middleware.common.CommonMiddleware',
49+
'django.middleware.csrf.CsrfViewMiddleware',
50+
'django.contrib.auth.middleware.AuthenticationMiddleware',
51+
'django.contrib.messages.middleware.MessageMiddleware',
52+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
53+
'django.contrib.messages.middleware.MessageMiddleware',
54+
55+
]
56+
57+
ROOT_URLCONF = 'Hi_backend.urls'
58+
59+
TEMPLATES = [
60+
{
61+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
62+
'DIRS': [BASE_DIR / 'templates'],
63+
'APP_DIRS': True,
64+
'OPTIONS': {
65+
'context_processors': [
66+
'django.template.context_processors.request',
67+
'django.contrib.auth.context_processors.auth',
68+
'django.contrib.messages.context_processors.messages',
69+
],
70+
},
71+
},
72+
]
73+
74+
WSGI_APPLICATION = 'Hi_backend.wsgi.application'
75+
76+
77+
# Database
78+
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases
79+
80+
DATABASES = {
81+
'default': {
82+
'ENGINE': 'django.db.backends.sqlite3',
83+
'NAME': BASE_DIR / 'db.sqlite3',
84+
}
85+
}
86+
87+
88+
# Password validation
89+
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
90+
91+
AUTH_PASSWORD_VALIDATORS = [
92+
{
93+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
94+
},
95+
{
96+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
97+
},
98+
{
99+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
100+
},
101+
{
102+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
103+
},
104+
]
105+
106+
107+
# Internationalization
108+
# https://docs.djangoproject.com/en/6.0/topics/i18n/
109+
110+
LANGUAGE_CODE = 'en-us'
111+
112+
TIME_ZONE = 'UTC'
113+
114+
USE_I18N = True
115+
116+
USE_TZ = True
117+
118+
119+
# Static files (CSS, JavaScript, Images)
120+
# https://docs.djangoproject.com/en/6.0/howto/static-files/
121+
122+
STATIC_URL = '/static/' # URL prefix
123+
124+
STATICFILES_DIRS = [
125+
BASE_DIR / 'static', # Django will look here for your static files
126+
]
127+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
URL configuration for Hi_backend project.
3+
4+
The `urlpatterns` list routes URLs to views. For more information please see:
5+
https://docs.djangoproject.com/en/6.0/topics/http/urls/
6+
Examples:
7+
Function views
8+
1. Add an import: from my_app import views
9+
2. Add a URL to urlpatterns: path('', views.home, name='home')
10+
Class-based views
11+
1. Add an import: from other_app.views import Home
12+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13+
Including another URLconf
14+
1. Import the include() function: from django.urls import include, path
15+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16+
"""
17+
from django.contrib import admin
18+
from django.urls import path
19+
from Hi_backend import views
20+
21+
urlpatterns = [
22+
path('myadmin/', admin.site.urls),
23+
path('', views.Home, name="Home"),
24+
path('About/', views.About, name="About"),
25+
path('Skills/', views.Skills, name="Skill"),
26+
path('Contact_us/', views.Contact, name="Contact_us"),
27+
path('Projects/', views.Projects, name="Projects"),
28+
path('Hire/', views.Hire, name="Hire"), # homepage using portfolioHome.html
29+
]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from django.shortcuts import render, redirect
2+
3+
from django.contrib import messages
4+
5+
def Home(request):
6+
return render(request, "PortfolioHome.html")
7+
8+
def About(request):
9+
return render(request, "About.html")
10+
11+
def Skills(request):
12+
return render(request, "Skill.html")
13+
14+
def Projects(request):
15+
return render(request, "Projects.html")
16+
17+
def Hire(request):
18+
return render(request, "Hire.html")
19+
20+
def Contact(request):
21+
return render(request, "Contact_us.html")
22+
23+
def Contact(request):
24+
if request.method == "POST":
25+
name = request.POST.get("name")
26+
email = request.POST.get("email")
27+
message = request.POST.get("message")
28+
29+
# (Abhi database use nahi kar rahe — simple)
30+
messages.success(request, "✅ Your message has been sent successfully!")
31+
32+
return redirect("Contact_us") # IMPORTANT 🔥
33+
34+
return render(request, "Contact_us.html")
35+
36+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for Hi_backend project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/6.0/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hi_backend.settings')
15+
16+
application = get_wsgi_application()

0 commit comments

Comments
 (0)