+ Latest Posts
+Welcome to Blogger, explore the latest stories and thoughts.
++ +
diff --git a/Blogger/Blogger/__init__.py b/Blogger/Blogger/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Blogger/Blogger/asgi.py b/Blogger/Blogger/asgi.py new file mode 100644 index 0000000..52ba7b4 --- /dev/null +++ b/Blogger/Blogger/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for Blogger 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', 'Blogger.settings') + +application = get_asgi_application() diff --git a/Blogger/Blogger/settings.py b/Blogger/Blogger/settings.py new file mode 100644 index 0000000..0d648f4 --- /dev/null +++ b/Blogger/Blogger/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for Blogger project. + +Generated by 'django-admin startproject' using Django 6.0.4. + +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 +import os + +# 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-47shw72dbedi^x$jw5)-91cv$udm#i(47nlf#ucqbqa^_aqi&m' + +# 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', + 'posts', +] + +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 = 'Blogger.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 = 'Blogger.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/' + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') \ No newline at end of file diff --git a/Blogger/Blogger/urls.py b/Blogger/Blogger/urls.py new file mode 100644 index 0000000..b03ed63 --- /dev/null +++ b/Blogger/Blogger/urls.py @@ -0,0 +1,28 @@ +""" +URL configuration for Blogger 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,include +from django.conf import settings +from django.conf.urls.static import static +from . import settings + + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include("main.urls")), + path('posts/', include('posts.urls')), +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/Blogger/Blogger/wsgi.py b/Blogger/Blogger/wsgi.py new file mode 100644 index 0000000..03bf872 --- /dev/null +++ b/Blogger/Blogger/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for Blogger 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', 'Blogger.settings') + +application = get_wsgi_application() diff --git a/Blogger/main/__init__.py b/Blogger/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Blogger/main/admin.py b/Blogger/main/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/Blogger/main/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Blogger/main/apps.py b/Blogger/main/apps.py new file mode 100644 index 0000000..833bff6 --- /dev/null +++ b/Blogger/main/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class MainConfig(AppConfig): + name = 'main' diff --git a/Blogger/main/migrations/0001_initial.py b/Blogger/main/migrations/0001_initial.py new file mode 100644 index 0000000..6ad0b99 --- /dev/null +++ b/Blogger/main/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 6.0.4 on 2026-04-14 15:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Post', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=2048)), + ('content', models.TextField()), + ('is_published', models.BooleanField(default=True)), + ('published_at', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/Blogger/main/migrations/0002_delete_post.py b/Blogger/main/migrations/0002_delete_post.py new file mode 100644 index 0000000..d14a077 --- /dev/null +++ b/Blogger/main/migrations/0002_delete_post.py @@ -0,0 +1,16 @@ +# Generated by Django 6.0.4 on 2026-04-15 07:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0001_initial'), + ] + + operations = [ + migrations.DeleteModel( + name='Post', + ), + ] diff --git a/Blogger/main/migrations/__init__.py b/Blogger/main/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Blogger/main/models.py b/Blogger/main/models.py new file mode 100644 index 0000000..e69de29 diff --git a/Blogger/main/static/css/style.css b/Blogger/main/static/css/style.css new file mode 100644 index 0000000..b327b20 --- /dev/null +++ b/Blogger/main/static/css/style.css @@ -0,0 +1,624 @@ + + +*{ + margin: 0; + padding: 0; + box-sizing: border-box; +} + +:root { + --bg-color: #F2EDC2; + --nav-color: #346739; + --span-color: #79AE6F; + --title-color: #346739; + --text-color: #4a4a4a; + --btn-color: #79AE6F; + --txtbox-color: #ffffff; + --font-title: 'Playfair Display', serif; + --font-para: 'Montserrat', sans-serif; +} + + +.container { + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + flex-direction: column; +} +a{ + text-decoration: none; +} +/* nav styling start*/ + +.header__hero { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + background-color: var(--bg-color); + border-bottom: 1px solid var(--span-color); + width: 100%; + height: 15vh; +} + +.header__title { + color: var(--title-color); + font-family: var(--font-title); + margin: 0; +} + +.header__tagline { + color: var(--text-color); + font-family: var(--font-para); + margin-top: 5px; +} + + +.nav-bar { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px 5%; + background-color: var(--nav-color); +} + +.nav_logo img { + height: 70px; +} + +.nav_link { + display: flex; + list-style: none; + gap: 2rem; + margin: 0; + padding: 0; + font-family: var(--font-para); +} + +.nav__item a { + text-decoration: none; + color: var(--bg-color); + font-family: var(--font-para); + font-weight: 500; + transition: 0.3s; +} + +.nav__item a:hover { + color: var(--span-color); +} + +/* home styling start*/ +.bg-img { + width: 100%; + height: 600px; + overflow: hidden; +} + +.bg-img img { + width: 100%; + height: 100%; + object-fit: cover; +} + +#explore { + padding: 50px 5%; + background-color: var(--bg-color); + width: 100%; + min-height: 100vh; +} + +.explore__header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 30px; +} + +.explore__title { + color: var(--title-color); + font-family: var(--font-title); +} + +.posts-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 25px; + align-items: stretch; +} + +.post-card { + background-color: #faf9f0; + padding: 25px; + border-radius: 15px; + border: 1px solid rgba(121, 174, 111, 0.3); + box-shadow: 0 4px 15px rgba(52, 103, 57, 0.05); + display: flex; + flex-direction: column; +} + +.post-card__title { + color: var(--title-color); + font-family: var(--font-title); + margin-bottom: 10px; +} + +.post-card__excerpt { + color: var(--text-color); + font-family: var(--font-para); + line-height: 1.6; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + margin-bottom: auto; +} + +.btn-create { + background-color: var(--title-color); + color: var(--bg-color); + padding: 12px 24px; + text-decoration: none; + border-radius: 30px; + font-weight: bold; + transition: 0.3s; +} + +.btn-read-more { + color: var(--title-color); + font-weight: bold; + text-decoration: none; + font-size: 0.9rem; + border-bottom: 2px solid var(--span-color); +} + +/* footer styling start */ + +.main-footer { + background-color: var(--title-color); + color: var(--bg-color); + padding: 60px 5% 20px; + font-family: var(--font-para); +} + +.footer-content { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + gap: 40px; + margin-bottom: 40px; +} + +.footer-section { + flex: 1; + min-width: 250px; +} + +.footer-section h3 { + font-family: var(--font-title); + color: var(--span-color); + margin-bottom: 20px; +} + +.footer-section ul { + list-style: none; + padding: 0; +} + +.footer-section ul li { + margin-bottom: 10px; +} + +.footer-section ul li a { + color: var(--bg-color); + text-decoration: none; + transition: 0.3s; +} + +.footer-section ul li a:hover { + color: var(--span-color); +} + +.footer-bottom { + text-align: center; + border-top: 1px solid rgba(242, 237, 194, 0.2); + padding-top: 20px; + font-size: 0.9rem; + opacity: 0.8; +} + +.social-icons a { + color: var(--span-color); + font-size: 1.8rem; + text-decoration: none; + transition: 0.3s ease; + display: inline-block; +} + +.social-icons a:hover { + color: #faf9f0; + transform: translateY(-5px); +} + +.create-container { + padding: 60px 5%; + display: flex; + justify-content: center; + background-color: var(--bg-color); + min-height: 80vh; +} + +.form-card { + background: #faf9f0; + width: 100%; + max-width: 700px; + padding: 40px; + border-radius: 20px; + box-shadow: 0 10px 30px rgba(52, 103, 57, 0.08); +} + +.form-header { + margin-bottom: 30px; + text-align: center; +} + +.form-header h2 { + color: var(--title-color); + font-family: var(--font-title); + font-size: 2rem; +} + +.input-group { + margin-bottom: 20px; +} + +.input-group label { + display: block; + margin-bottom: 8px; + color: var(--title-color); + font-weight: 600; +} + +.input-group input, +.input-group textarea { + width: 100%; + padding: 12px 15px; + border: 1px solid rgba(121, 174, 111, 0.3); + border-radius: 10px; + background-color: white; + font-family: var(--font-para); + transition: 0.3s; +} + +.input-group input:focus, +.input-group textarea:focus { + outline: none; + border-color: var(--span-color); + box-shadow: 0 0 0 3px rgba(121, 174, 111, 0.1); +} + +.switch-group { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 30px; +} + +.form-actions { + display: flex; + justify-content: flex-end; + gap: 15px; + border-top: 1px solid rgba(0,0,0,0.05); + padding-top: 25px; +} + +.btn-cancel { + text-decoration: none; + color: #888; + padding: 12px 25px; + transition: 0.3s; +} + +.btn-submit { + background-color: var(--title-color); + color: var(--bg-color); + border: none; + padding: 12px 35px; + border-radius: 30px; + font-weight: bold; + cursor: pointer; + transition: 0.3s; +} + +.btn-submit:hover { + background-color: var(--span-color); + transform: translateY(-2px); +} + + +@media (max-width: 992px) { + .nav-bar { + padding: 15px 3%; + } + + .bg-img { + height: 400px; + } +} + +@media (max-width: 768px) { + .nav-bar { + flex-direction: column; + gap: 15px; + text-align: center; + } + + .nav_link { + gap: 1.2rem; + flex-wrap: wrap; + justify-content: center; + } + + .header__hero { + height: auto; + padding: 20px 0; + } + + .header__title { + font-size: 1.8rem; + } + + .explore__header { + flex-direction: column; + gap: 20px; + text-align: center; + } + + .posts-grid { + grid-template-columns: 1fr; + } + + .footer-content { + flex-direction: column; + text-align: center; + } + + .footer-section { + min-width: 100%; + } + + .form-card { + padding: 25px 20px; + } + + .form-actions { + flex-direction: column-reverse; + gap: 10px; + } + + .btn-submit, .btn-cancel { + width: 100%; + text-align: center; + } +} + +img { + max-width: 100%; + height: auto; +} + +.post-details { + background-color: var(--bg-color); + min-height: 100vh; + padding: 4rem 20px; + display: flex; + justify-content: center; +} + +article { + max-width: 800px; + width: 100%; +} + +h1 { + font-family: var(--font-title); + color: var(--title-color); + font-size: 3.5rem; + line-height: 1.1; + margin-bottom: 1.5rem; +} + +.meta-info { + font-family: var(--font-para); + color: var(--text-color); + font-size: 0.9rem; + margin-bottom: 3rem; + display: flex; + gap: 15px; + align-items: center; +} + +.status-badge { + background-color: var(--span-color); + color: white; + padding: 2px 12px; + border-radius: 20px; + font-size: 0.75rem; +} + +.featured-image { + width: 100%; + margin-bottom: 3rem; +} + +.featured-image img { + width: 100%; + border-radius: 8px; + box-shadow: 0 10px 30px rgba(52, 103, 57, 0.1); +} + +.content-area { + font-family: var(--font-para); + color: var(--text-color); + line-height: 1.8; + font-size: 1.15rem; +} + +.back-btn { + display: inline-block; + margin-top: 4rem; + padding: 10px 25px; + background-color: var(--btn-color); + color: white; + text-decoration: none; + border-radius: 4px; + font-family: var(--font-para); + transition: 0.3s; +} + +.back-btn:hover { + filter: brightness(0.9); + transform: translateX(-5px); +} + +.btn-edit { + display: inline-block; + padding: 10px 20px; + background-color: transparent; + color: var(--title-color); + border: 1px solid var(--title-color); + text-decoration: none; + border-radius: 4px; + font-family: var(--font-para); + font-weight: 600; + transition: 0.3s; +} + +.btn-edit:hover { + background-color: var(--title-color); + color: var(--bg-color); + transform: translateY(-2px); +} + +.current-poster-preview { + margin-bottom: 1.5rem; + padding: 12px; + border: 1px solid var(--span-color); + border-radius: 8px; + background-color: #ffffff; + display: inline-block; +} + +.current-poster-preview p { + font-family: var(--font-para); + font-size: 0.85rem; + color: var(--title-color); + margin-bottom: 8px; + font-weight: 600; +} + +.current-poster-preview img { + max-width: 180px; + height: auto; + border-radius: 4px; + box-shadow: 0 4px 10px rgba(0,0,0,0.1); + display: block; +} + +.current-poster-preview { + margin-top: 2rem; + margin-bottom: 1.5rem; + padding: 12px; + border: 1px solid var(--span-color); + border-radius: 8px; + background-color: #ffffff; + display: inline-block; +} + +.current-poster-preview img { + max-width: 180px; + height: auto; + border-radius: 4px; + display: block; +} + +#poster { + margin-top: 5px; + font-family: var(--font-para); +} + +.post-actions { + display: flex; + gap: 15px; + margin-bottom: 2.5rem; +} + +.btn-delete { + display: inline-block; + padding: 8px 18px; + background-color: transparent; + color: #c0392b; + border: 1px solid #c0392b; + text-decoration: none; + border-radius: 4px; + font-family: var(--font-para); + font-size: 0.9rem; + font-weight: 600; + transition: 0.3s; +} + +.btn-delete:hover { + background-color: #c0392b; + color: white; + transform: translateY(-2px); +} + +.post-card__image { + width: 100%; + height: 200px; + overflow: hidden; + border-radius: 10px; + margin-bottom: 15px; +} + +.post-card__image img { + width: 100%; + height: 100%; + object-fit: cover; +} + +@media (max-width: 768px) { + h1 { + font-size: 2.2rem; + margin-bottom: 1rem; + } + + .post-actions { + flex-direction: column; + gap: 10px; + width: 100%; + } + + .btn-edit, .btn-delete { + width: 100%; + text-align: center; + padding: 12px; + } + + .current-poster-preview { + display: block; + width: 100%; + text-align: center; + } + + .current-poster-preview img { + max-width: 100%; + margin: 0 auto; + } + + .post-details { + padding: 2rem 15px; + } +} + diff --git a/Blogger/main/static/imges/home-img/home-bg.jpeg b/Blogger/main/static/imges/home-img/home-bg.jpeg new file mode 100644 index 0000000..e0a6888 Binary files /dev/null and b/Blogger/main/static/imges/home-img/home-bg.jpeg differ diff --git a/Blogger/main/static/imges/home-img/home-bg1.jpeg b/Blogger/main/static/imges/home-img/home-bg1.jpeg new file mode 100644 index 0000000..150ad46 Binary files /dev/null and b/Blogger/main/static/imges/home-img/home-bg1.jpeg differ diff --git a/Blogger/main/static/imges/home-img/home-bg2.jpeg b/Blogger/main/static/imges/home-img/home-bg2.jpeg new file mode 100644 index 0000000..3331a2c Binary files /dev/null and b/Blogger/main/static/imges/home-img/home-bg2.jpeg differ diff --git a/Blogger/main/static/imges/home-img/home-bg3.jpeg b/Blogger/main/static/imges/home-img/home-bg3.jpeg new file mode 100644 index 0000000..7435eb6 Binary files /dev/null and b/Blogger/main/static/imges/home-img/home-bg3.jpeg differ diff --git a/Blogger/main/static/imges/home-img/logo.png b/Blogger/main/static/imges/home-img/logo.png new file mode 100644 index 0000000..0221137 Binary files /dev/null and b/Blogger/main/static/imges/home-img/logo.png differ diff --git a/Blogger/main/static/imges/home-img/logo1.png b/Blogger/main/static/imges/home-img/logo1.png new file mode 100644 index 0000000..c26ecd6 Binary files /dev/null and b/Blogger/main/static/imges/home-img/logo1.png differ diff --git a/Blogger/main/templates/main/base.html b/Blogger/main/templates/main/base.html new file mode 100644 index 0000000..78cc6d6 --- /dev/null +++ b/Blogger/main/templates/main/base.html @@ -0,0 +1,70 @@ +{% load static %} + + +
+ + +Stories from the road, captured in moments.
+
+ Welcome to Blogger, explore the latest stories and thoughts.
+Share your latest journey with the world.
+Modify your journey details below.
+