diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 28817aa..e07be8a 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/urls.py b/config/urls.py index bcfc074..dad9fcb 100644 --- a/config/urls.py +++ b/config/urls.py @@ -22,6 +22,7 @@ from django.conf.urls.static import static urlpatterns = [ path("admin/", admin.site.urls), path("", include("core.urls")), + path('accounts/', include('django.contrib.auth.urls')), ] if settings.DEBUG: diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..bad7c42 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000..95f25a0 Binary files /dev/null and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..689703e 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..f6c145f 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..bc8f537 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..7487255 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,15 @@ from django.contrib import admin +from django.contrib.auth.admin import UserAdmin as BaseUserAdmin +from django.contrib.auth.models import User +from .models import UserProfile -# Register your models here. +class UserProfileInline(admin.StackedInline): + model = UserProfile + can_delete = False + verbose_name_plural = 'profile' + +class UserAdmin(BaseUserAdmin): + inlines = (UserProfileInline,) + +admin.site.unregister(User) +admin.site.register(User, UserAdmin) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..e13c76b --- /dev/null +++ b/core/forms.py @@ -0,0 +1,21 @@ +from django import forms +from django.contrib.auth.forms import UserCreationForm +from django.contrib.auth.models import User +from .models import UserProfile + +class CustomUserCreationForm(UserCreationForm): + user_type = forms.ChoiceField(choices=UserProfile.USER_TYPE_CHOICES) + + class Meta(UserCreationForm.Meta): + model = User + fields = UserCreationForm.Meta.fields + ('email',) + + def save(self, commit=True): + user = super().save(commit=False) + if commit: + user.save() + UserProfile.objects.create( + user=user, + user_type=self.cleaned_data['user_type'] + ) + return user diff --git a/core/models.py b/core/models.py index 71a8362..e9acb7f 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,13 @@ from django.db import models +from django.contrib.auth.models import User -# Create your models here. +class UserProfile(models.Model): + USER_TYPE_CHOICES = ( + ('guide', 'Guide'), + ('customer', 'Customer'), + ) + user = models.OneToOneField(User, on_delete=models.CASCADE) + user_type = models.CharField(max_length=10, choices=USER_TYPE_CHOICES) + + def __str__(self): + return f'{self.user.username} - {self.get_user_type_display()}' \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..b802fbb 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -14,6 +14,10 @@ {% endif %} {% load static %} + + + + {% block head %}{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..26c3e52 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,65 @@ {% extends "base.html" %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% block title %}Outdoor Adventures Marketplace{% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
- + + +
+
+
+
+

Find Your Next Adventure

+

Connect with the best outdoor guides and outfitters. Book your dream trip today.

+ Get Started +
+
+
+
+ +
+
+
+
+
+

Expert Guides

+

Our guides are experienced, certified, and passionate about the outdoors.

+
+
+
+
+

Unique Trips

+

Discover one-of-a-kind adventures, from mountain treks to coastal kayaking.

+
+
+
+
+

Seamless Booking

+

Book your next trip in minutes with our secure and easy-to-use platform.

+
+
+
+
+
{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/register.html b/core/templates/registration/register.html new file mode 100644 index 0000000..48a6a55 --- /dev/null +++ b/core/templates/registration/register.html @@ -0,0 +1,22 @@ +{% extends 'base.html' %} + +{% block title %}Register{% endblock %} + +{% block content %} +
+
+
+
+

Create Your Account

+
+ {% csrf_token %} + {{ form.as_p }} +
+ +
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index 6299e3d..869b64b 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,8 @@ from django.urls import path -from .views import home +from .views import home, register urlpatterns = [ path("", home, name="home"), + path('register/', register, name='register'), ] diff --git a/core/views.py b/core/views.py index c9aed12..2daeef9 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,15 @@ -import os -import platform - -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone - +from django.shortcuts import render, redirect +from .forms import CustomUserCreationForm def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() + return render(request, 'core/index.html') - context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), - } - return render(request, "core/index.html", context) +def register(request): + if request.method == 'POST': + form = CustomUserCreationForm(request.POST) + if form.is_valid(): + form.save() + return redirect('home') + else: + form = CustomUserCreationForm() + return render(request, 'registration/register.html', {'form': form}) diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..579d180 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,91 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; + +:root { + --primary-color: #2A3D45; + --secondary-color: #C17C74; + --accent-color: #F2D3AC; + --background-color: #F7F7F7; + --text-color: #333333; + --heading-font: 'Poppins', sans-serif; + --body-font: 'Lato', sans-serif; +} + +body { + font-family: var(--body-font); + color: var(--text-color); + background-color: var(--background-color); +} + +h1, h2, h3, h4, h5, h6 { + font-family: var(--heading-font); + font-weight: 600; +} + +.navbar { + border-bottom: 1px solid #eee; +} + +.navbar-brand { + font-family: var(--heading-font); + font-weight: 700; + font-size: 1.5rem; + color: var(--primary-color); +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); + font-weight: 600; + padding: 0.75rem 1.5rem; + transition: background-color 0.3s ease; +} + +.btn-primary:hover { + background-color: #1a2b34; + border-color: #1a2b34; +} + +.hero-section { + background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1470770841072-f978cf4d019e?q=80&w=2070&auto=format&fit=crop') no-repeat center center; + background-size: cover; + color: white; + padding: 10rem 0; + text-align: left; +} + +.hero-section h1 { + font-size: 4.5rem; + font-weight: 700; +} + +.hero-section .lead { + font-size: 1.5rem; + margin-bottom: 2rem; +} + +.features-section { + padding: 6rem 0; +} + +.feature h3 { + font-size: 1.75rem; + margin-bottom: 1rem; + color: var(--primary-color); +} + +.feature p { + font-size: 1.1rem; + color: #666; +} + +.registration-form { + background-color: #fff; + padding: 3rem; + border-radius: 10px; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); +} + +.registration-form h2 { + text-align: center; + margin-bottom: 2rem; + color: var(--primary-color); }