Skip to content

Commit 337f45b

Browse files
committed
Initial commit
0 parents  commit 337f45b

37 files changed

+765
-0
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/TaskMasterAPI.iml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/discord.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TaskMasterAPI/__init__.py

Whitespace-only changes.

TaskMasterAPI/asgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for TaskMasterAPI project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TaskMasterAPI.settings')
15+
16+
application = get_asgi_application()

TaskMasterAPI/settings.py

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
"""
2+
Django settings for TaskMasterAPI project.
3+
4+
Generated by 'django-admin startproject' using Django 4.2.2.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.2/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/4.2/ref/settings/
11+
"""
12+
13+
from pathlib import Path
14+
15+
import rest_framework_simplejwt
16+
from datetime import timedelta
17+
18+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
19+
BASE_DIR = Path(__file__).resolve().parent.parent
20+
21+
# Quick-start development settings - unsuitable for production
22+
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
23+
24+
# SECURITY WARNING: keep the secret key used in production secret!
25+
SECRET_KEY = 'django-insecure--f3xbe$a*+d2@b7p8($h#_qzu2#&z1(6kn=%yi+mzy=k*$jfo5'
26+
27+
# SECURITY WARNING: don't run with debug turned on in production!
28+
DEBUG = True
29+
30+
ALLOWED_HOSTS = []
31+
32+
# Application definition
33+
34+
INSTALLED_APPS = [
35+
'django.contrib.admin',
36+
'django.contrib.auth',
37+
'django.contrib.contenttypes',
38+
'django.contrib.sessions',
39+
'django.contrib.messages',
40+
'django.contrib.staticfiles',
41+
'rest_framework',
42+
'corsheaders',
43+
'rest_framework_simplejwt',
44+
'account',
45+
'src'
46+
]
47+
48+
MIDDLEWARE = [
49+
'django.middleware.security.SecurityMiddleware',
50+
'django.contrib.sessions.middleware.SessionMiddleware',
51+
'corsheaders.middleware.CorsMiddleware',
52+
'django.middleware.common.CommonMiddleware',
53+
'django.middleware.csrf.CsrfViewMiddleware',
54+
'django.contrib.auth.middleware.AuthenticationMiddleware',
55+
'django.contrib.messages.middleware.MessageMiddleware',
56+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
57+
]
58+
59+
ROOT_URLCONF = 'TaskMasterAPI.urls'
60+
61+
TEMPLATES = [
62+
{
63+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
64+
'DIRS': [BASE_DIR / 'templates']
65+
,
66+
'APP_DIRS': True,
67+
'OPTIONS': {
68+
'context_processors': [
69+
'django.template.context_processors.debug',
70+
'django.template.context_processors.request',
71+
'django.contrib.auth.context_processors.auth',
72+
'django.contrib.messages.context_processors.messages',
73+
],
74+
},
75+
},
76+
]
77+
78+
WSGI_APPLICATION = 'TaskMasterAPI.wsgi.application'
79+
80+
# Database
81+
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
82+
83+
DATABASES = {
84+
'default': {
85+
'ENGINE': 'django.db.backends.sqlite3',
86+
'NAME': BASE_DIR / 'db.sqlite3',
87+
}
88+
}
89+
90+
# Password validation
91+
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
92+
93+
AUTH_PASSWORD_VALIDATORS = [
94+
{
95+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
96+
},
97+
{
98+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
99+
},
100+
{
101+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
102+
},
103+
{
104+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
105+
},
106+
]
107+
108+
# Internationalization
109+
# https://docs.djangoproject.com/en/4.2/topics/i18n/
110+
111+
LANGUAGE_CODE = 'en-us'
112+
113+
TIME_ZONE = 'Asia/Kolkata'
114+
115+
USE_I18N = True
116+
117+
USE_TZ = True
118+
119+
# Static files (CSS, JavaScript, Images)
120+
# https://docs.djangoproject.com/en/4.2/howto/static-files/
121+
122+
STATIC_URL = 'static/'
123+
124+
# Default primary key field type
125+
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
126+
127+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
128+
129+
AUTH_USER_MODEL = 'account.User'
130+
131+
REST_FRAMEWORK = {
132+
'DEFAULT_AUTHENTICATION_CLASSES': [
133+
'rest_framework_simplejwt.authentication.JWTAuthentication',
134+
],
135+
}
136+
137+
# Set token expiration time
138+
SIMPLE_JWT = {
139+
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5),
140+
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
141+
}
142+
143+
CORS_ORIGIN_ALLOW_ALL = True
144+
CORS_ALLOW_CREDENTIALS = True
145+

0 commit comments

Comments
 (0)