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 added Planteer/Planteer/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions Planteer/Planteer/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for Planteer 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', 'Planteer.settings')

application = get_asgi_application()
126 changes: 126 additions & 0 deletions Planteer/Planteer/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
"""
Django settings for Planteer 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-ys#o(!0#1*q4-6u6&_mj_%w2g(7x5e+j^d8ek196fn-_5nih#@'

# 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',
'core',
'plants',
]

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 = 'Planteer.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': ['templates'],
'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 = 'Planteer.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/'

STATICFILES_DIRS = [
BASE_DIR / "static"
]
MEDIA_URL = '/media/'
MEDIA_ROOT = 'media'
12 changes: 12 additions & 0 deletions Planteer/Planteer/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
path('', include('core.urls')),
path('plants/', include('plants.urls')),
path('admin/', admin.site.urls),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
16 changes: 16 additions & 0 deletions Planteer/Planteer/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for Planteer 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', 'Planteer.settings')

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

# Register your models here.


class ContactAdmin(admin.ModelAdmin):
list_display = ('first_name', 'last_name', 'email', 'created_at')
list_filter = ('created_at',)

admin.site.register(Contact, ContactAdmin)
5 changes: 5 additions & 0 deletions Planteer/core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class CoreConfig(AppConfig):
name = 'core'
25 changes: 25 additions & 0 deletions Planteer/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 6.0.3 on 2026-04-20 17:42

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Contact',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=100)),
('last_name', models.CharField(max_length=100)),
('email', models.EmailField(max_length=254)),
('message', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
]
Empty file.
14 changes: 14 additions & 0 deletions Planteer/core/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.db import models

# Create your models here.

class Contact(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
email = models.EmailField()
message = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)

def __str__(self):
return f"{self.first_name} {self.last_name}"

39 changes: 39 additions & 0 deletions Planteer/core/templates/core/article.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% extends 'Planteer/base.html' %}
{% block content %}

<!-- HERO -->
<div class="article-hero" style="background-image: url('{{ article.image }}');">
<div class="article-hero-overlay">
<div class="container">
<span class="hero-badge">{{ article.tag }}</span>
<h1 class="article-hero-title mt-3">{{ article.title }}</h1>
<div class="article-hero-meta mt-3">
<span><i class="fa-regular fa-user"></i> {{ article.author }}</span>
<span><i class="fa-regular fa-clock"></i> {{ article.read_time }}</span>
<span><i class="fa-regular fa-calendar"></i> {{ article.date }}</span>
</div>
</div>
</div>
</div>

<!-- CONTENT -->
<div class="container mt-5 mb-5">
<div class="row justify-content-center">
<div class="col-md-8">

<a href="/care-tips/" class="breadcrumb-link mb-4 d-inline-block">
← Back to Care Tips
</a>

{% for section in article.content %}
<div class="article-section mb-4">
<h4 class="article-heading">{{ section.heading }}</h4>
<p class="article-text">{{ section.text }}</p>
</div>
{% endfor %}

</div>
</div>
</div>

{% endblock %}
Loading