Skip to content

DONE 🥳 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
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 Hope/Hope/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions Hope/Hope/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for Hope 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', 'Hope.settings')

application = get_asgi_application()
132 changes: 132 additions & 0 deletions Hope/Hope/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
"""
Django settings for Hope project.

Generated by 'django-admin startproject' using Django 5.1.3.

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
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/5.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure--p2ou%-6$5r@(q=ej0!5m!qo@=d(no)h(ygi7@#$fo8j3%rr=i'

# 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',
'opportunities',
'organizations',
'accounts',
]

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 = 'Hope.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 = 'Hope.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'

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
30 changes: 30 additions & 0 deletions Hope/Hope/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
URL configuration for Hope 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, include
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
path('admin/', admin.site.urls),
path("", include("main.urls")),
path("opportunities/", include("opportunities.urls")),
path("organizations/", include("organizations.urls")),
path("accounts/", include("accounts.urls")),

]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
16 changes: 16 additions & 0 deletions Hope/Hope/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for Hope 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', 'Hope.settings')

application = get_wsgi_application()
Empty file added Hope/accounts/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions Hope/accounts/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.contrib import admin
from .models import OrganizationProfile, VolunteerProfile

# Register your models here.

admin.site.register (OrganizationProfile)
admin.site.register (VolunteerProfile)
6 changes: 6 additions & 0 deletions Hope/accounts/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'
35 changes: 35 additions & 0 deletions Hope/accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 5.1.3 on 2024-11-27 16:44

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='OrganizationProfile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('organization_name', models.CharField(max_length=255)),
('description', models.TextField(blank=True, null=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='VolunteerProfile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('full_name', models.CharField(max_length=255)),
('bio', models.TextField(blank=True, null=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.1.3 on 2024-11-27 17:02

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('accounts', '0001_initial'),
]

operations = [
migrations.RenameField(
model_name='organizationprofile',
old_name='user',
new_name='organization_user',
),
migrations.RenameField(
model_name='volunteerprofile',
old_name='user',
new_name='volunteer_user',
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.1.3 on 2024-11-28 13:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0002_rename_user_organizationprofile_organization_user_and_more'),
]

operations = [
migrations.AddField(
model_name='volunteerprofile',
name='experience',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='volunteerprofile',
name='profile_picture',
field=models.ImageField(blank=True, null=True, upload_to='profile_pictures/'),
),
migrations.AddField(
model_name='volunteerprofile',
name='skills',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.1.3 on 2024-11-29 09:10

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0003_volunteerprofile_experience_and_more'),
]

operations = [
migrations.AddField(
model_name='organizationprofile',
name='industry_focus_area',
field=models.CharField(blank=True, max_length=100, null=True),
),
migrations.AddField(
model_name='organizationprofile',
name='organization_logo',
field=models.ImageField(blank=True, null=True, upload_to='organization_logos/'),
),
migrations.AddField(
model_name='organizationprofile',
name='organization_type',
field=models.CharField(blank=True, max_length=100, null=True),
),
migrations.AddField(
model_name='organizationprofile',
name='website_url',
field=models.URLField(blank=True, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1.3 on 2024-11-29 09:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0004_organizationprofile_industry_focus_area_and_more'),
]

operations = [
migrations.AlterField(
model_name='organizationprofile',
name='organization_logo',
field=models.ImageField(blank=True, default='organization_logos/default_logo.png', null=True, upload_to='organization_logos/'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.1.3 on 2024-11-30 11:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0005_alter_organizationprofile_organization_logo'),
]

operations = [
migrations.AddField(
model_name='volunteerprofile',
name='education_level',
field=models.CharField(blank=True, choices=[('High School', 'High School'), ("Associate's Degree", "Associate's Degree"), ("Bachelor's Degree", "Bachelor's Degree"), ("Master's Degree", "Master's Degree"), ('Doctorate', 'Doctorate')], max_length=20, null=True),
),
migrations.AlterField(
model_name='volunteerprofile',
name='profile_picture',
field=models.ImageField(blank=True, default='profile_pictures/default_profile.png', null=True, upload_to='profile_pictures/'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 5.1.3 on 2024-11-30 17:42

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0006_volunteerprofile_education_level_and_more'),
('organizations', '0002_remove_opportunity_contact_email_and_more'),
]

operations = [
migrations.AddField(
model_name='volunteerprofile',
name='applied_opportunities',
field=models.ManyToManyField(blank=True, related_name='applicants', to='organizations.opportunity'),
),
]
Loading