├── Procfile ├── screenshots ├── ka.png ├── angg.png ├── cell1.png ├── persons.png ├── phone1.png ├── accuracy.png └── yolohome.png ├── YOLO_django_sett ├── __pycache__ │ ├── urls.cpython-37.pyc │ ├── urls.cpython-38.pyc │ ├── wsgi.cpython-37.pyc │ ├── wsgi.cpython-38.pyc │ ├── __init__.cpython-37.pyc │ ├── __init__.cpython-38.pyc │ ├── settings.cpython-37.pyc │ └── settings.cpython-38.pyc ├── wsgi.py ├── urls.py └── settings.py ├── requirements.txt ├── manage.py ├── README.md ├── coco.names ├── templates ├── styles.css └── index.html ├── yolov3-tiny.cfg └── main_working.py /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn YOLO_django.wsgi 2 | -------------------------------------------------------------------------------- /screenshots/ka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/ka.png -------------------------------------------------------------------------------- /screenshots/angg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/angg.png -------------------------------------------------------------------------------- /screenshots/cell1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/cell1.png -------------------------------------------------------------------------------- /screenshots/persons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/persons.png -------------------------------------------------------------------------------- /screenshots/phone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/phone1.png -------------------------------------------------------------------------------- /screenshots/accuracy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/accuracy.png -------------------------------------------------------------------------------- /screenshots/yolohome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/screenshots/yolohome.png -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /YOLO_django_sett/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sanjeevsd/yolo-with-django/HEAD/YOLO_django_sett/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.2.3 2 | certifi==2019.11.28 3 | chardet==3.0.4 4 | dj-database-url==0.5.0 5 | Django==3.1.13 6 | django-heroku==0.3.1 7 | gunicorn==20.0.4 8 | heroku==0.1.4 9 | idna==2.8 10 | numpy==1.17.4 11 | opencv-python==4.2.0.32 12 | psycopg2==2.8.4 13 | python-dateutil==1.5 14 | pytz==2019.3 15 | requests==2.22.0 16 | sqlparse==0.3.0 17 | urllib3==1.26.5 18 | whitenoise==5.0.1 19 | -------------------------------------------------------------------------------- /YOLO_django_sett/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for YOLO_django_sett 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/2.2/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', 'YOLO_django_sett.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'YOLO_django_sett.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # yolo-with-django 2 | The project uses yolo data model for multi oject detection in realtime using webcam implemented in django webframework. 3 | 4 | The django contains webcamera function which opens webcam and the video is fed to yolo model. The yolo model uses neural network to divide the video into images then to small boundary boxes and predicts the class object. The boundary boxes is then combined with the image and label.All the images are sent to django in form of BYTES, the bytes are automatically converted in video and streamed in new Window of webbrowser. 5 | My laptop webcam doesnot work so i used a cheap 0.3 mp webcam to work with.Manjaro linux gives new video id to the webcam everytime it is plugged, so have added a simple loop to check the video id, which runs in any system wiht any video id of range (0-9) 6 | ScreenShots: 7 | 8 | ![GitHub Logo](/screenshots/yolohome.png) 9 | ![GitHub Logo](/screenshots/cell1.png) 10 | ![GitHub Logo](/screenshots/persons.png) 11 | 12 | -------------------------------------------------------------------------------- /coco.names: -------------------------------------------------------------------------------- 1 | person 2 | bicycle 3 | car 4 | motorbike 5 | aeroplane 6 | bus 7 | train 8 | truck 9 | boat 10 | traffic light 11 | fire hydrant 12 | stop sign 13 | parking meter 14 | bench 15 | bird 16 | cat 17 | dog 18 | horse 19 | sheep 20 | cow 21 | elephant 22 | bear 23 | zebra 24 | giraffe 25 | backpack 26 | umbrella 27 | handbag 28 | tie 29 | suitcase 30 | frisbee 31 | skis 32 | snowboard 33 | sports ball 34 | kite 35 | baseball bat 36 | baseball glove 37 | skateboard 38 | surfboard 39 | tennis racket 40 | bottle 41 | wine glass 42 | cup 43 | fork 44 | knife 45 | spoon 46 | bowl 47 | banana 48 | apple 49 | sandwich 50 | orange 51 | broccoli 52 | carrot 53 | hot dog 54 | pizza 55 | donut 56 | cake 57 | chair 58 | sofa 59 | pottedplant 60 | bed 61 | diningtable 62 | toilet 63 | tvmonitor 64 | laptop 65 | mouse 66 | remote 67 | keyboard 68 | cell phone 69 | microwave 70 | oven 71 | toaster 72 | sink 73 | refrigerator 74 | book 75 | clock 76 | vase 77 | scissors 78 | teddy bear 79 | hair drier 80 | toothbrush 81 | -------------------------------------------------------------------------------- /templates/styles.css: -------------------------------------------------------------------------------- 1 | { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | font-family: Arial, Helvetica, sans-serif; 7 | margin: 0; 8 | } 9 | 10 | .header { 11 | padding: 80px; 12 | text-align: center; 13 | background: #1abc9c; 14 | color: white; 15 | } 16 | .header h1 { 17 | font-size: 40px; 18 | } 19 | .row { 20 | display: -ms-flexbox; /* IE10 */ 21 | display: flex; 22 | -ms-flex-wrap: wrap; /* IE10 */ 23 | flex-wrap: wrap; 24 | } 25 | 26 | .side { 27 | -ms-flex: 30%; /* IE10 */ 28 | flex: 30%; 29 | background-color: #f1f1f1; 30 | padding: 20px; 31 | } 32 | .main { 33 | -ms-flex: 70%; /* IE10 */ 34 | flex: 70%; 35 | background-color: white; 36 | padding: 20px; 37 | } 38 | .fakeimg { 39 | background-color: #aaa; 40 | width: 100%; 41 | padding: 20px; 42 | } 43 | 44 | .footer { 45 | padding: 20px; 46 | text-align: center; 47 | background: #ddd; 48 | } 49 | @media screen and (max-width: 700px) { 50 | .row { 51 | flex-direction: column; 52 | } 53 | } 54 | 55 | @media screen and (max-width: 400px) { 56 | .navbar a { 57 | float: none; 58 | width: 100%; 59 | } 60 | } -------------------------------------------------------------------------------- /YOLO_django_sett/urls.py: -------------------------------------------------------------------------------- 1 | """YOLO_django_sett URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.http import StreamingHttpResponse 18 | from django.urls import path 19 | 20 | from main_working import VideoCamera, gen 21 | import main_working 22 | urlpatterns = [ 23 | path('', main_working.index, name='main-view'), 24 | path('yolo/', lambda r: StreamingHttpResponse(gen(VideoCamera()), 25 | content_type='multipart/x-mixed-replace; boundary=frame')), 26 | path('admin/', admin.site.urls), 27 | ] 28 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | YOLO in Djnago 5 | 6 | 7 | 8 | 9 | 10 | 11 | {% load static %} 12 | 13 |
14 |

YOLO with Django

15 |

A Realtime Multi-object Detection in webapp

16 |

17 |
18 | 19 |

Close the window afterwards to exit the detection

20 |
21 | 22 |
23 |
24 |
25 |

About Me

26 |

Sanjeev Das

27 |

4th year BCT student @ Kantipur Engineering College. Pursuing a career in AI/ML

28 | 34 |
35 |
36 |

YOLO in Django

37 |
By using YOLO Algorithm together with django webframework, a realtime multi object detecting webapp is built.
38 |

The YOLO alogirthm is basically copy paste(Understanding how it works took some time :D)

39 |

Implementing YOLO in django framework was quite easy as I have learned django in the past and certified too from @Neosphere

40 |
41 |
42 |
43 | 44 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /yolov3-tiny.cfg: -------------------------------------------------------------------------------- 1 | [net] 2 | # Testing 3 | batch=1 4 | subdivisions=1 5 | # Training 6 | # batch=64 7 | # subdivisions=2 8 | width=416 9 | height=416 10 | channels=3 11 | momentum=0.9 12 | decay=0.0005 13 | angle=0 14 | saturation = 1.5 15 | exposure = 1.5 16 | hue=.1 17 | 18 | learning_rate=0.001 19 | burn_in=1000 20 | max_batches = 500200 21 | policy=steps 22 | steps=400000,450000 23 | scales=.1,.1 24 | 25 | [convolutional] 26 | batch_normalize=1 27 | filters=16 28 | size=3 29 | stride=1 30 | pad=1 31 | activation=leaky 32 | 33 | [maxpool] 34 | size=2 35 | stride=2 36 | 37 | [convolutional] 38 | batch_normalize=1 39 | filters=32 40 | size=3 41 | stride=1 42 | pad=1 43 | activation=leaky 44 | 45 | [maxpool] 46 | size=2 47 | stride=2 48 | 49 | [convolutional] 50 | batch_normalize=1 51 | filters=64 52 | size=3 53 | stride=1 54 | pad=1 55 | activation=leaky 56 | 57 | [maxpool] 58 | size=2 59 | stride=2 60 | 61 | [convolutional] 62 | batch_normalize=1 63 | filters=128 64 | size=3 65 | stride=1 66 | pad=1 67 | activation=leaky 68 | 69 | [maxpool] 70 | size=2 71 | stride=2 72 | 73 | [convolutional] 74 | batch_normalize=1 75 | filters=256 76 | size=3 77 | stride=1 78 | pad=1 79 | activation=leaky 80 | 81 | [maxpool] 82 | size=2 83 | stride=2 84 | 85 | [convolutional] 86 | batch_normalize=1 87 | filters=512 88 | size=3 89 | stride=1 90 | pad=1 91 | activation=leaky 92 | 93 | [maxpool] 94 | size=2 95 | stride=1 96 | 97 | [convolutional] 98 | batch_normalize=1 99 | filters=1024 100 | size=3 101 | stride=1 102 | pad=1 103 | activation=leaky 104 | 105 | ########### 106 | 107 | [convolutional] 108 | batch_normalize=1 109 | filters=256 110 | size=1 111 | stride=1 112 | pad=1 113 | activation=leaky 114 | 115 | [convolutional] 116 | batch_normalize=1 117 | filters=512 118 | size=3 119 | stride=1 120 | pad=1 121 | activation=leaky 122 | 123 | [convolutional] 124 | size=1 125 | stride=1 126 | pad=1 127 | filters=255 128 | activation=linear 129 | 130 | 131 | 132 | [yolo] 133 | mask = 3,4,5 134 | anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 135 | classes=80 136 | num=6 137 | jitter=.3 138 | ignore_thresh = .7 139 | truth_thresh = 1 140 | random=1 141 | 142 | [route] 143 | layers = -4 144 | 145 | [convolutional] 146 | batch_normalize=1 147 | filters=128 148 | size=1 149 | stride=1 150 | pad=1 151 | activation=leaky 152 | 153 | [upsample] 154 | stride=2 155 | 156 | [route] 157 | layers = -1, 8 158 | 159 | [convolutional] 160 | batch_normalize=1 161 | filters=256 162 | size=3 163 | stride=1 164 | pad=1 165 | activation=leaky 166 | 167 | [convolutional] 168 | size=1 169 | stride=1 170 | pad=1 171 | filters=255 172 | activation=linear 173 | 174 | [yolo] 175 | mask = 0,1,2 176 | anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 177 | classes=80 178 | num=6 179 | jitter=.3 180 | ignore_thresh = .7 181 | truth_thresh = 1 182 | random=1 -------------------------------------------------------------------------------- /main_working.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | from django.shortcuts import render 4 | 5 | def getCameraId(): #my os gives random video ids to wencams on every boot, tesaile loop lagayera check garya, idk whats alternative 6 | for i in range(0, 10): 7 | vd=cv2.VideoCapture(i) 8 | if vd.isOpened(): 9 | return i 10 | class VideoCamera(object): 11 | def __init__(self): 12 | id=getCameraId() 13 | self.video = cv2.VideoCapture(id) 14 | 15 | 16 | def __del__(self): 17 | self.video.release() 18 | 19 | def get_frame(self): 20 | success, image = self.video.read() 21 | ret, jpeg = cv2.imencode('.jpg', image) 22 | net = cv2.dnn.readNet('yolov3-tiny.weights', 'yolov3-tiny.cfg') 23 | classes = [] 24 | with open('coco.names', 'r') as f: 25 | classes = [line.strip() for line in f.readlines()] 26 | layer_names = net.getLayerNames() 27 | output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()] 28 | colors = np.random.uniform(0, 255, size=(len(classes), 3)) 29 | cap = self.video 30 | frame_width = int(cap.get(3)) 31 | frame_height = int(cap.get(4)) 32 | while (cap.isOpened()): 33 | ret, frame = cap.read() 34 | if ret == True: 35 | img = frame 36 | height, width, n_channels = img.shape 37 | blob = cv2.dnn.blobFromImage(img, 0.00392, (416, 416), (0, 0, 0), True, crop=False) 38 | net.setInput(blob) 39 | outs = net.forward(output_layers) 40 | class_ids = [] 41 | boxes = [] 42 | confidences = [] 43 | for out in outs: 44 | for det in out: 45 | scores = det[5:] 46 | class_id = np.argmax(scores) 47 | confidence = scores[class_id] 48 | 49 | if confidence > 0.5: 50 | cx = int(det[0] * width) 51 | cy = int(det[1] * height) 52 | 53 | w = int(det[2] * width) 54 | h = int(det[3] * height) 55 | 56 | x = int(cx - w / 2) 57 | y = int(cy - h / 2) 58 | boxes.append([x, y, w, h]) 59 | confidences.append(float(confidence)) 60 | class_ids.append(class_id) 61 | n_det = len(boxes) 62 | indexes = cv2.dnn.NMSBoxes(boxes, confidences, 0.5, 0.4) # removes boxes those are alike 63 | font = cv2.FONT_HERSHEY_PLAIN 64 | for i in range(n_det): 65 | if i in indexes: 66 | x, y, w, h = boxes[i] 67 | label = str(classes[class_ids[i]]) 68 | color = colors[i] 69 | cv2.rectangle(img, (x, y), (x + h, y + w), color, 2) 70 | cv2.putText(img, label, (x, y + 30), font, 1, color, 3) 71 | rets, jpegs = cv2.imencode('.jpg', img) 72 | return jpegs.tobytes() 73 | else: 74 | break 75 | cap.release() 76 | cv2.waitKey(0) 77 | cv2.destroyAllWindows() 78 | return jpeg.tobytes() 79 | 80 | 81 | def gen(camera): 82 | while True: 83 | frame = camera.get_frame() 84 | yield (b'--frame\r\n' 85 | b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n') 86 | 87 | def check(): 88 | print('checking') 89 | 90 | 91 | def index(request): 92 | print("sanjeev") 93 | return render(request,'index.html') -------------------------------------------------------------------------------- /YOLO_django_sett/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for YOLO_django_sett project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.2.3. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.2/ref/settings/ 11 | """ 12 | import django_heroku 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'd=j7y_#hw(dx315rzsmr@iqmk+d#jkvyus60)$by7=vyl=v*s^' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 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 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'YOLO_django_sett.urls' 54 | 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [os.path.join(BASE_DIR, 'templates')], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'YOLO_django_sett.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.2/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.sqlite3', 81 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 82 | } 83 | } 84 | 85 | 86 | # Password validation 87 | # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators 88 | 89 | AUTH_PASSWORD_VALIDATORS = [ 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 92 | }, 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 101 | }, 102 | ] 103 | 104 | 105 | # Internationalization 106 | # https://docs.djangoproject.com/en/2.2/topics/i18n/ 107 | 108 | LANGUAGE_CODE = 'en-us' 109 | 110 | TIME_ZONE = 'UTC' 111 | 112 | USE_I18N = True 113 | 114 | USE_L10N = True 115 | 116 | USE_TZ = True 117 | 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/2.2/howto/static-files/ 121 | STATICFILES_DIRS = [ 122 | os.path.join(BASE_DIR, 'templates'), 123 | ] 124 | STATIC_URL = '/static/' 125 | 126 | django_heroku.settings(locals()) --------------------------------------------------------------------------------