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
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/SynergyPro_Team5_CS-GY-6063.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

22 changes: 22 additions & 0 deletions synergy_pro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Python
__pycache__/
*.py[cod]
*.pyo
.Python
venv/
.idea

# Django
*.sqlite3
db.sqlite3

# Environment variables
.env

# Static files
/staticfiles/
/media/

# macOS
.DS_Store

File renamed without changes.
22 changes: 22 additions & 0 deletions synergy_pro/manage.py
Original file line number Diff line number Diff line change
@@ -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', 'synergy_pro.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()
File renamed without changes.
4 changes: 2 additions & 2 deletions task_management/asgi.py → synergy_pro/synergy_pro/asgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
ASGI config for task_management project.
ASGI config for synergy_pro project.

It exposes the ASGI callable as a module-level variable named ``application``.

Expand All @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "task_management.settings")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'synergy_pro.settings')

application = get_asgi_application()
143 changes: 143 additions & 0 deletions synergy_pro/synergy_pro/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
"""
Django settings for synergy_pro 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
from django.contrib.messages import constants as messages

# 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-)n3+q*ucge#o3rx_0^!8+@51cfj%8$yjw)sq^d+wx+!3(xe)!a'

# 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',
'crispy_forms',
'users',
'tasks',
]

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

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / "templates"],
'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',
],
},
},
]
# CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
# CRISPY_TEMPLATE_PACK = "bootstrap5"


WSGI_APPLICATION = 'synergy_pro.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/'
STATICFILES_DIRS = [BASE_DIR / "static"]

MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / "media"

# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

LOGIN_REDIRECT_URL = '/' # Redirects to the home page after login
LOGOUT_REDIRECT_URL = '/users/login/' # Redirects to the login page after logout

MESSAGE_TAGS = {
messages.SUCCESS: 'alert-success',
messages.ERROR: 'alert-danger',
}

13 changes: 9 additions & 4 deletions task_management/urls.py → synergy_pro/synergy_pro/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
URL configuration for task_management project.
URL configuration for synergy_pro project.

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.1/topics/http/urls/
Expand All @@ -14,11 +14,16 @@
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.shortcuts import render

def home(request):
return render(request, 'synergy_pro/base.html')

urlpatterns = [
path("admin/", admin.site.urls),
path('', include('task_manager.urls')),
path('admin/', admin.site.urls),
path('users/', include('users.urls')),
path('tasks/', include('tasks.urls')),
path('', home, name='home'), # Root URL pattern
]
4 changes: 2 additions & 2 deletions task_management/wsgi.py → synergy_pro/synergy_pro/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
WSGI config for task_management project.
WSGI config for synergy_pro project.

It exposes the WSGI callable as a module-level variable named ``application``.

Expand All @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "task_management.settings")
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'synergy_pro.settings')

application = get_wsgi_application()
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions synergy_pro/tasks/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class TasksConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'tasks'
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions synergy_pro/tasks/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.urls import path
from . import views

urlpatterns = [
path('', views.task_calendar, name='task_calendar'),
path('create/<str:date>/', views.create_task, name='create_task'),
path('tasks/', views.task_list, name='task_list'),
path('<int:task_id>/', views.task_detail, name='task_detail'),
]

11 changes: 7 additions & 4 deletions task_manager/views.py → synergy_pro/tasks/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.shortcuts import render

# Create your views here.
from django.shortcuts import render, redirect, get_object_or_404
from .models import Task
from .forms import TaskForm
Expand All @@ -6,7 +9,7 @@
# Calendar view
def task_calendar(request):
tasks = Task.objects.all()
return render(request, 'task_manager/calendar.html', {'tasks': tasks})
return render(request, '../templates/tasks/calendar.html', {'tasks': tasks})

# View to create a task
def create_task(request, date):
Expand All @@ -20,15 +23,15 @@ def create_task(request, date):
else:
form = TaskForm()

return render(request, "task_manager/create_task.html", {'form': form, 'date': date})
return render(request, "../templates/tasks/create_task.html", {'form': form, 'date': date})

# view all tasks
def task_list(request):
tasks = Task.objects.all()
return render(request, 'task_manager/task_list.html', {'tasks': tasks})
return render(request, '../templates/tasks/task_list.html', {'tasks': tasks})

# view individual task
def task_detail(request, task_id):
task = get_object_or_404(Task, id=task_id)
return render(request, 'task_manager/task_detail.html', {'task': task})
return render(request, '../templates/tasks/task_detail.html', {'task': task})

4 changes: 4 additions & 0 deletions synergy_pro/templates/media/info-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading