Skip to content

Commit e1f21ce

Browse files
authored
Add files via upload
1 parent 23a7a63 commit e1f21ce

File tree

4 files changed

+159
-0
lines changed

4 files changed

+159
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for BloodDonation 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/3.1/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', 'BloodDonation.settings')
15+
16+
application = get_asgi_application()
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
from pathlib import Path
2+
import os
3+
4+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
5+
BASE_DIR = Path(__file__).resolve().parent.parent
6+
7+
8+
# Quick-start development settings - unsuitable for production
9+
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
10+
11+
# SECURITY WARNING: keep the secret key used in production secret!
12+
SECRET_KEY = 'wy#+(&hxnf5$hd=wx)0mffwknu5h+@=u7&e%e%v8nlj!bd*4)l'
13+
14+
# SECURITY WARNING: don't run with debug turned on in production!
15+
DEBUG = True
16+
17+
ALLOWED_HOSTS = []
18+
19+
20+
# Application definition
21+
22+
INSTALLED_APPS = [
23+
'django.contrib.admin',
24+
'django.contrib.auth',
25+
'django.contrib.contenttypes',
26+
'django.contrib.sessions',
27+
'django.contrib.messages',
28+
'django.contrib.staticfiles',
29+
'home',
30+
]
31+
32+
MIDDLEWARE = [
33+
'django.middleware.security.SecurityMiddleware',
34+
'django.contrib.sessions.middleware.SessionMiddleware',
35+
'django.middleware.common.CommonMiddleware',
36+
'django.middleware.csrf.CsrfViewMiddleware',
37+
'django.contrib.auth.middleware.AuthenticationMiddleware',
38+
'django.contrib.messages.middleware.MessageMiddleware',
39+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
40+
]
41+
42+
ROOT_URLCONF = 'BloodDonation.urls'
43+
44+
TEMPLATES = [
45+
{
46+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
47+
'DIRS': ["home/templates"],
48+
'APP_DIRS': True,
49+
'OPTIONS': {
50+
'context_processors': [
51+
'django.template.context_processors.debug',
52+
'django.template.context_processors.request',
53+
'django.contrib.auth.context_processors.auth',
54+
'django.contrib.messages.context_processors.messages',
55+
],
56+
},
57+
},
58+
]
59+
60+
WSGI_APPLICATION = 'BloodDonation.wsgi.application'
61+
62+
63+
# Database
64+
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
65+
66+
DATABASES = {
67+
'default': {
68+
'ENGINE': 'django.db.backends.sqlite3',
69+
'NAME': BASE_DIR / 'db.sqlite3',
70+
}
71+
}
72+
73+
74+
# Password validation
75+
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
76+
77+
AUTH_PASSWORD_VALIDATORS = [
78+
{
79+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
80+
},
81+
{
82+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
83+
},
84+
{
85+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
86+
},
87+
{
88+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
89+
},
90+
]
91+
92+
93+
# Internationalization
94+
# https://docs.djangoproject.com/en/3.1/topics/i18n/
95+
96+
LANGUAGE_CODE = 'en-us'
97+
98+
TIME_ZONE = 'UTC'
99+
100+
USE_I18N = True
101+
102+
USE_L10N = True
103+
104+
USE_TZ = True
105+
106+
107+
# Static files (CSS, JavaScript, Images)
108+
# https://docs.djangoproject.com/en/3.1/howto/static-files/
109+
110+
STATIC_URL = '/static/'
111+
112+
MEDIA_ROOT = os.path.join(BASE_DIR, 'home/media')
113+
MEDIA_URL = '/media/'
114+
115+
STATICFILES_DIRS = [
116+
os.path.join(BASE_DIR, "home/static")
117+
]
118+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from django.contrib import admin
2+
from django.urls import path, include
3+
from django.conf import settings
4+
from django.conf.urls.static import static
5+
6+
urlpatterns = [
7+
path('admin/', admin.site.urls),
8+
path('', include('home.urls')),
9+
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for BloodDonation project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'BloodDonation.settings')
15+
16+
application = get_wsgi_application()

0 commit comments

Comments
 (0)