diff --git a/MohammedApp/MohammedApp/__init__.py b/MohammedApp/MohammedApp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/MohammedApp/MohammedApp/asgi.py b/MohammedApp/MohammedApp/asgi.py new file mode 100644 index 0000000..836c9ba --- /dev/null +++ b/MohammedApp/MohammedApp/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for MohammedApp 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/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MohammedApp.settings') + +application = get_asgi_application() diff --git a/MohammedApp/MohammedApp/settings.py b/MohammedApp/MohammedApp/settings.py new file mode 100644 index 0000000..66f3eee --- /dev/null +++ b/MohammedApp/MohammedApp/settings.py @@ -0,0 +1,124 @@ +""" +Django settings for MohammedApp project. + +Generated by 'django-admin startproject' using Django 5.1.2. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/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/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure--u8fk)nql7$d-rh&4=cd=!++j7ar$(*3x2)(5-3q9mq*mu-ak2' + +# 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 = 'MohammedApp.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'MohammedApp.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/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/5.1/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/5.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/MohammedApp/MohammedApp/urls.py b/MohammedApp/MohammedApp/urls.py new file mode 100644 index 0000000..e4b76b5 --- /dev/null +++ b/MohammedApp/MohammedApp/urls.py @@ -0,0 +1,27 @@ +""" +URL configuration for MohammedApp project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/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 main import views +urlpatterns = [ + path('admin/', admin.site.urls), + path('', views.home, name='home'), + path('about/', views.about, name='about'), + path('projects/', views.projects, name='projects'), + path('contact/', views.contact, name='contact'), + path('cv/', views.cv, name='cv'), +] diff --git a/MohammedApp/MohammedApp/wsgi.py b/MohammedApp/MohammedApp/wsgi.py new file mode 100644 index 0000000..777146f --- /dev/null +++ b/MohammedApp/MohammedApp/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for MohammedApp 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/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MohammedApp.settings') + +application = get_wsgi_application() diff --git a/MohammedApp/main/__init__.py b/MohammedApp/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/MohammedApp/main/admin.py b/MohammedApp/main/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/MohammedApp/main/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/MohammedApp/main/apps.py b/MohammedApp/main/apps.py new file mode 100644 index 0000000..167f044 --- /dev/null +++ b/MohammedApp/main/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class MainConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'main' diff --git a/MohammedApp/main/migrations/__init__.py b/MohammedApp/main/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/MohammedApp/main/models.py b/MohammedApp/main/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/MohammedApp/main/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/MohammedApp/main/static/main/images/fire_fighting_robot.jpg b/MohammedApp/main/static/main/images/fire_fighting_robot.jpg new file mode 100644 index 0000000..c2477d7 Binary files /dev/null and b/MohammedApp/main/static/main/images/fire_fighting_robot.jpg differ diff --git a/MohammedApp/main/static/main/styles.css b/MohammedApp/main/static/main/styles.css new file mode 100644 index 0000000..7c7522a --- /dev/null +++ b/MohammedApp/main/static/main/styles.css @@ -0,0 +1,39 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + display: flex; /* Use Flexbox for body */ + flex-direction: column; /* Stack children vertically */ + height: 100vh; /* Full height of the viewport */ + background-color: #f5f5f5; /* Background color */ +} + +main { + display: flex; /* Use Flexbox for main */ + justify-content: center; /* Center content horizontally */ + align-items: center; /* Center content vertically */ + flex-grow: 1; /* Take up remaining space */ + padding: 20px; /* Add padding */ + text-align: center; /* Center text */ +} + +.content-container { + max-width: 800px; /* Limit width for better readability */ + width: 100%; /* Responsive width */ +} + +h1, h2 { + margin: 20px 0; /* Space above and below headings */ +} + +ul { + list-style-position: inside; /* Bullets inside list */ + padding: 0; /* Remove default padding */ +} + +footer { + text-align: center; + padding: 10px; + background-color: #333; + color: white; +} diff --git a/MohammedApp/main/templates/main/about.html b/MohammedApp/main/templates/main/about.html new file mode 100644 index 0000000..0b877f3 --- /dev/null +++ b/MohammedApp/main/templates/main/about.html @@ -0,0 +1,24 @@ +{% extends 'main/base.html' %} +{% load static %} +{% block title %}About{% endblock %} +{% block content %} +
+

About Me

+

Hello! I'm Mohammed, a passionate computer engineer with a keen interest in technology and innovation.

+

+ This website showcases my work, projects, and experiences in the field of engineering and programming. + Here’s a brief overview of what you can find: +

+ +

+ I hope this website provides insight into my journey as an engineer and inspires others + in the tech community. Feel free to explore! +

+
+{% endblock %} diff --git a/MohammedApp/main/templates/main/base.html b/MohammedApp/main/templates/main/base.html new file mode 100644 index 0000000..80a0523 --- /dev/null +++ b/MohammedApp/main/templates/main/base.html @@ -0,0 +1,29 @@ + + + + + + {% load static %} + + {% block title %}My Projects{% endblock %} + + +
+ +
+
+ {% block content %}{% endblock %} +
+ + + diff --git a/MohammedApp/main/templates/main/contact.html b/MohammedApp/main/templates/main/contact.html new file mode 100644 index 0000000..96da3b7 --- /dev/null +++ b/MohammedApp/main/templates/main/contact.html @@ -0,0 +1,17 @@ +{% extends 'main/base.html' %} +{% block title %}Contact{% endblock %} +{% block content %} +
+

Contact Me

+
+ {% csrf_token %} + + + + + + + +
+
+{% endblock %} diff --git a/MohammedApp/main/templates/main/cv.html b/MohammedApp/main/templates/main/cv.html new file mode 100644 index 0000000..1348004 --- /dev/null +++ b/MohammedApp/main/templates/main/cv.html @@ -0,0 +1,25 @@ +{% extends 'main/base.html' %} +{% block title %}CV{% endblock %} +{% block content %} +

CV

+ +

Personal Information

+

Name: Mohammed Alkathiri

+

Email: sirexplq@gmail.com

+

Phone: +966553011972

+ +

Education

+ + +

Skills

+ + +

Contact

+

If you would like to get in touch, please visit the Contact page.

+{% endblock %} diff --git a/MohammedApp/main/templates/main/home.html b/MohammedApp/main/templates/main/home.html new file mode 100644 index 0000000..cfb042e --- /dev/null +++ b/MohammedApp/main/templates/main/home.html @@ -0,0 +1,8 @@ +{% extends 'main/base.html' %} +{% block title %}Home{% endblock %} +{% block content %} +
+

Welcome to My Website

+

This website showcases my projects, skills, and experiences in the field of engineering and programming. Whether you're interested in my graduation project or want to know more about my background, you've come to the right place!

+
+{% endblock %} diff --git a/MohammedApp/main/templates/main/projects.html b/MohammedApp/main/templates/main/projects.html new file mode 100644 index 0000000..abd23d4 --- /dev/null +++ b/MohammedApp/main/templates/main/projects.html @@ -0,0 +1,17 @@ +{% extends 'main/base.html' %} +{% load static %} +{% block title %}Projects{% endblock %} +{% block content %} +
+

My Graduation Project

+
+

Fire Fighting Robot

+ Fire Fighting Robot +

+ My graduation project is a Fire Fighting Robot designed to autonomously detect and extinguish fires. + This robot utilizes advanced sensors and a water spray mechanism to effectively combat small fires + in indoor environments, enhancing safety and emergency response capabilities. +

+
+
+{% endblock %} diff --git a/MohammedApp/main/tests.py b/MohammedApp/main/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/MohammedApp/main/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/MohammedApp/main/views.py b/MohammedApp/main/views.py new file mode 100644 index 0000000..fd677e1 --- /dev/null +++ b/MohammedApp/main/views.py @@ -0,0 +1,22 @@ +from django.shortcuts import render + +# Create your views here. +from django.shortcuts import render + +def home(request): + return render(request, 'main/home.html') + +def about(request): + return render(request, 'main/about.html') + +def projects(request): # Updated function name + return render(request, 'main/projects.html') # Updated template name + +def contact(request): + if request.method == 'POST': + # Handle the form submission here + print(request.POST) + return render(request, 'main/contact.html') + +def cv(request): + return render(request, 'main/cv.html') diff --git a/MohammedApp/manage.py b/MohammedApp/manage.py new file mode 100755 index 0000000..d646543 --- /dev/null +++ b/MohammedApp/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MohammedApp.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()