├── Notebooks
└── irisModel.ipynb
├── README.md
├── basicConcepts
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-37.pyc
│ ├── urls.cpython-37.pyc
│ └── views.cpython-37.pyc
├── admin.py
├── apps.py
├── migrations
│ └── __init__.py
├── models.py
├── tests.py
├── urls.py
└── views.py
├── djangoMLDeployment
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-37.pyc
│ ├── settings.cpython-37.pyc
│ ├── urls.cpython-37.pyc
│ └── wsgi.cpython-37.pyc
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
├── irisApp
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-37.pyc
│ ├── urls.cpython-37.pyc
│ └── views.cpython-37.pyc
├── admin.py
├── apps.py
├── migrations
│ └── __init__.py
├── models.py
├── tests.py
├── urls.py
└── views.py
├── manage.py
├── savedModels
└── model.joblib
└── templates
├── index.html
├── main.html
├── result.html
└── user.html
/Notebooks/irisModel.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "id": "sitting-trade",
7 | "metadata": {},
8 | "outputs": [],
9 | "source": [
10 | "from sklearn.datasets import load_iris\n",
11 | "data = load_iris()"
12 | ]
13 | },
14 | {
15 | "cell_type": "code",
16 | "execution_count": 2,
17 | "id": "historical-pontiac",
18 | "metadata": {},
19 | "outputs": [
20 | {
21 | "name": "stderr",
22 | "output_type": "stream",
23 | "text": [
24 | "c:\\users\\admin\\appdata\\local\\programs\\python\\python37\\lib\\importlib\\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n",
25 | " return f(*args, **kwds)\n"
26 | ]
27 | }
28 | ],
29 | "source": [
30 | "import pandas as pd\n",
31 | "X_data = pd.DataFrame(data.data, columns = data.feature_names)\n",
32 | "y_data = pd.Series(data = data.target, name = 'Targets')"
33 | ]
34 | },
35 | {
36 | "cell_type": "code",
37 | "execution_count": 3,
38 | "id": "compressed-alberta",
39 | "metadata": {},
40 | "outputs": [
41 | {
42 | "data": {
43 | "text/html": [
44 | "
\n",
45 | "\n",
58 | "
\n",
59 | " \n",
60 | " \n",
61 | " | \n",
62 | " sepal length (cm) | \n",
63 | " sepal width (cm) | \n",
64 | " petal length (cm) | \n",
65 | " petal width (cm) | \n",
66 | "
\n",
67 | " \n",
68 | " \n",
69 | " \n",
70 | " 0 | \n",
71 | " 5.1 | \n",
72 | " 3.5 | \n",
73 | " 1.4 | \n",
74 | " 0.2 | \n",
75 | "
\n",
76 | " \n",
77 | " 1 | \n",
78 | " 4.9 | \n",
79 | " 3.0 | \n",
80 | " 1.4 | \n",
81 | " 0.2 | \n",
82 | "
\n",
83 | " \n",
84 | " 2 | \n",
85 | " 4.7 | \n",
86 | " 3.2 | \n",
87 | " 1.3 | \n",
88 | " 0.2 | \n",
89 | "
\n",
90 | " \n",
91 | " 3 | \n",
92 | " 4.6 | \n",
93 | " 3.1 | \n",
94 | " 1.5 | \n",
95 | " 0.2 | \n",
96 | "
\n",
97 | " \n",
98 | " 4 | \n",
99 | " 5.0 | \n",
100 | " 3.6 | \n",
101 | " 1.4 | \n",
102 | " 0.2 | \n",
103 | "
\n",
104 | " \n",
105 | "
\n",
106 | "
"
107 | ],
108 | "text/plain": [
109 | " sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)\n",
110 | "0 5.1 3.5 1.4 0.2\n",
111 | "1 4.9 3.0 1.4 0.2\n",
112 | "2 4.7 3.2 1.3 0.2\n",
113 | "3 4.6 3.1 1.5 0.2\n",
114 | "4 5.0 3.6 1.4 0.2"
115 | ]
116 | },
117 | "execution_count": 3,
118 | "metadata": {},
119 | "output_type": "execute_result"
120 | }
121 | ],
122 | "source": [
123 | "X_data.head()"
124 | ]
125 | },
126 | {
127 | "cell_type": "code",
128 | "execution_count": 5,
129 | "id": "north-obligation",
130 | "metadata": {},
131 | "outputs": [
132 | {
133 | "data": {
134 | "text/plain": [
135 | "0 0\n",
136 | "1 0\n",
137 | "2 0\n",
138 | "3 0\n",
139 | "4 0\n",
140 | "Name: Targets, dtype: int32"
141 | ]
142 | },
143 | "execution_count": 5,
144 | "metadata": {},
145 | "output_type": "execute_result"
146 | }
147 | ],
148 | "source": [
149 | "y_data.head()"
150 | ]
151 | },
152 | {
153 | "cell_type": "code",
154 | "execution_count": 6,
155 | "id": "distant-blink",
156 | "metadata": {},
157 | "outputs": [],
158 | "source": [
159 | "from sklearn.model_selection import train_test_split\n",
160 | "X_train, X_test, y_train, y_test = train_test_split(X_data, y_data, test_size = 0.2)"
161 | ]
162 | },
163 | {
164 | "cell_type": "code",
165 | "execution_count": 7,
166 | "id": "greenhouse-weapon",
167 | "metadata": {},
168 | "outputs": [],
169 | "source": [
170 | "from sklearn.ensemble import RandomForestClassifier\n",
171 | "model = RandomForestClassifier()"
172 | ]
173 | },
174 | {
175 | "cell_type": "code",
176 | "execution_count": 8,
177 | "id": "suspected-entrepreneur",
178 | "metadata": {},
179 | "outputs": [
180 | {
181 | "data": {
182 | "text/plain": [
183 | "RandomForestClassifier(bootstrap=True, ccp_alpha=0.0, class_weight=None,\n",
184 | " criterion='gini', max_depth=None, max_features='auto',\n",
185 | " max_leaf_nodes=None, max_samples=None,\n",
186 | " min_impurity_decrease=0.0, min_impurity_split=None,\n",
187 | " min_samples_leaf=1, min_samples_split=2,\n",
188 | " min_weight_fraction_leaf=0.0, n_estimators=100,\n",
189 | " n_jobs=None, oob_score=False, random_state=None,\n",
190 | " verbose=0, warm_start=False)"
191 | ]
192 | },
193 | "execution_count": 8,
194 | "metadata": {},
195 | "output_type": "execute_result"
196 | }
197 | ],
198 | "source": [
199 | "model.fit(X_train, y_train)"
200 | ]
201 | },
202 | {
203 | "cell_type": "code",
204 | "execution_count": 10,
205 | "id": "significant-greenhouse",
206 | "metadata": {},
207 | "outputs": [],
208 | "source": [
209 | "y_pred = model.predict(X_test)"
210 | ]
211 | },
212 | {
213 | "cell_type": "code",
214 | "execution_count": 11,
215 | "id": "uniform-currency",
216 | "metadata": {},
217 | "outputs": [
218 | {
219 | "data": {
220 | "text/plain": [
221 | "0.9"
222 | ]
223 | },
224 | "execution_count": 11,
225 | "metadata": {},
226 | "output_type": "execute_result"
227 | }
228 | ],
229 | "source": [
230 | "from sklearn.metrics import accuracy_score\n",
231 | "accuracy_score(y_test, y_pred)"
232 | ]
233 | },
234 | {
235 | "cell_type": "code",
236 | "execution_count": 12,
237 | "id": "endless-glossary",
238 | "metadata": {},
239 | "outputs": [],
240 | "source": [
241 | "from joblib import dump"
242 | ]
243 | },
244 | {
245 | "cell_type": "code",
246 | "execution_count": 13,
247 | "id": "noted-heading",
248 | "metadata": {},
249 | "outputs": [
250 | {
251 | "data": {
252 | "text/plain": [
253 | "['./../savedModels/model.joblib']"
254 | ]
255 | },
256 | "execution_count": 13,
257 | "metadata": {},
258 | "output_type": "execute_result"
259 | }
260 | ],
261 | "source": [
262 | "dump(model, './../savedModels/model.joblib')"
263 | ]
264 | },
265 | {
266 | "cell_type": "code",
267 | "execution_count": null,
268 | "id": "particular-atlantic",
269 | "metadata": {},
270 | "outputs": [],
271 | "source": []
272 | }
273 | ],
274 | "metadata": {
275 | "kernelspec": {
276 | "display_name": "Python 3",
277 | "language": "python",
278 | "name": "python3"
279 | },
280 | "language_info": {
281 | "codemirror_mode": {
282 | "name": "ipython",
283 | "version": 3
284 | },
285 | "file_extension": ".py",
286 | "mimetype": "text/x-python",
287 | "name": "python",
288 | "nbconvert_exporter": "python",
289 | "pygments_lexer": "ipython3",
290 | "version": "3.7.0"
291 | }
292 | },
293 | "nbformat": 4,
294 | "nbformat_minor": 5
295 | }
296 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Django ML Deployment
2 |
3 | Learn the basics of Django required for ML Models. There are many concepts involved while learning Django, but specifically in this tutorial I teach
4 | only what you require to get started with ML Model Deployment.
5 |
6 |
7 |
8 | Subscribe to my YouTube channel for similiar type of content.
9 |
--------------------------------------------------------------------------------
/basicConcepts/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/basicConcepts/__init__.py
--------------------------------------------------------------------------------
/basicConcepts/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/basicConcepts/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/basicConcepts/__pycache__/urls.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/basicConcepts/__pycache__/urls.cpython-37.pyc
--------------------------------------------------------------------------------
/basicConcepts/__pycache__/views.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/basicConcepts/__pycache__/views.cpython-37.pyc
--------------------------------------------------------------------------------
/basicConcepts/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/basicConcepts/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class BasicconceptsConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'basicConcepts'
7 |
--------------------------------------------------------------------------------
/basicConcepts/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/basicConcepts/migrations/__init__.py
--------------------------------------------------------------------------------
/basicConcepts/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/basicConcepts/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/basicConcepts/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from . import views
3 |
4 | urlpatterns = [
5 | path('', views.Welcome, name = 'Welcome'),
6 | path('user', views.User, name = 'User')
7 | ]
--------------------------------------------------------------------------------
/basicConcepts/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 |
3 | def Welcome(request):
4 | return render(request, 'index.html')
5 |
6 | def User(request):
7 | username = request.GET['username']
8 | return render(request, 'user.html', {'name':username})
--------------------------------------------------------------------------------
/djangoMLDeployment/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/djangoMLDeployment/__init__.py
--------------------------------------------------------------------------------
/djangoMLDeployment/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/djangoMLDeployment/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/djangoMLDeployment/__pycache__/settings.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/djangoMLDeployment/__pycache__/settings.cpython-37.pyc
--------------------------------------------------------------------------------
/djangoMLDeployment/__pycache__/urls.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/djangoMLDeployment/__pycache__/urls.cpython-37.pyc
--------------------------------------------------------------------------------
/djangoMLDeployment/__pycache__/wsgi.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/djangoMLDeployment/__pycache__/wsgi.cpython-37.pyc
--------------------------------------------------------------------------------
/djangoMLDeployment/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for djangoMLDeployment 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.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', 'djangoMLDeployment.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/djangoMLDeployment/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for djangoMLDeployment project.
3 |
4 | Generated by 'django-admin startproject' using Django 3.2.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/3.2/ref/settings/
11 | """
12 |
13 | from pathlib import Path
14 |
15 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
16 | BASE_DIR = Path(__file__).resolve().parent.parent
17 |
18 |
19 | # Quick-start development settings - unsuitable for production
20 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
21 |
22 | # SECURITY WARNING: keep the secret key used in production secret!
23 | SECRET_KEY = 'django-insecure-x^ur02ler3h$2n85y$w%w_q7%+p9g=kukv8g#%fz852v2k3gnl'
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 | 'django.contrib.admin',
35 | 'django.contrib.auth',
36 | 'django.contrib.contenttypes',
37 | 'django.contrib.sessions',
38 | 'django.contrib.messages',
39 | 'django.contrib.staticfiles',
40 | ]
41 |
42 | MIDDLEWARE = [
43 | 'django.middleware.security.SecurityMiddleware',
44 | 'django.contrib.sessions.middleware.SessionMiddleware',
45 | 'django.middleware.common.CommonMiddleware',
46 | 'django.middleware.csrf.CsrfViewMiddleware',
47 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
48 | 'django.contrib.messages.middleware.MessageMiddleware',
49 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
50 | ]
51 |
52 | ROOT_URLCONF = 'djangoMLDeployment.urls'
53 |
54 | TEMPLATES = [
55 | {
56 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
57 | 'DIRS': [BASE_DIR / 'templates'],
58 | 'APP_DIRS': True,
59 | 'OPTIONS': {
60 | 'context_processors': [
61 | 'django.template.context_processors.debug',
62 | 'django.template.context_processors.request',
63 | 'django.contrib.auth.context_processors.auth',
64 | 'django.contrib.messages.context_processors.messages',
65 | ],
66 | },
67 | },
68 | ]
69 |
70 | WSGI_APPLICATION = 'djangoMLDeployment.wsgi.application'
71 |
72 |
73 | # Database
74 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
75 |
76 | DATABASES = {
77 | 'default': {
78 | 'ENGINE': 'django.db.backends.sqlite3',
79 | 'NAME': BASE_DIR / 'db.sqlite3',
80 | }
81 | }
82 |
83 |
84 | # Password validation
85 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
86 |
87 | AUTH_PASSWORD_VALIDATORS = [
88 | {
89 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90 | },
91 | {
92 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93 | },
94 | {
95 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96 | },
97 | {
98 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99 | },
100 | ]
101 |
102 |
103 | # Internationalization
104 | # https://docs.djangoproject.com/en/3.2/topics/i18n/
105 |
106 | LANGUAGE_CODE = 'en-us'
107 |
108 | TIME_ZONE = 'UTC'
109 |
110 | USE_I18N = True
111 |
112 | USE_L10N = True
113 |
114 | USE_TZ = True
115 |
116 |
117 | # Static files (CSS, JavaScript, Images)
118 | # https://docs.djangoproject.com/en/3.2/howto/static-files/
119 |
120 | STATIC_URL = '/static/'
121 |
122 | # Default primary key field type
123 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
124 |
125 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
126 |
--------------------------------------------------------------------------------
/djangoMLDeployment/urls.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from django.urls import path, include
3 |
4 | urlpatterns = [
5 | # path('', include('basicConcepts.urls')),
6 | path('', include('irisApp.urls')),
7 | path('admin/', admin.site.urls),
8 | ]
9 |
--------------------------------------------------------------------------------
/djangoMLDeployment/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for djangoMLDeployment 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.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', 'djangoMLDeployment.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/irisApp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/irisApp/__init__.py
--------------------------------------------------------------------------------
/irisApp/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/irisApp/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/irisApp/__pycache__/urls.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/irisApp/__pycache__/urls.cpython-37.pyc
--------------------------------------------------------------------------------
/irisApp/__pycache__/views.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/irisApp/__pycache__/views.cpython-37.pyc
--------------------------------------------------------------------------------
/irisApp/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/irisApp/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class IrisappConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'irisApp'
7 |
--------------------------------------------------------------------------------
/irisApp/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/irisApp/migrations/__init__.py
--------------------------------------------------------------------------------
/irisApp/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/irisApp/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/irisApp/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from . import views
3 |
4 | urlpatterns = [
5 | path('', views.predictor, name = 'predictor'),
6 | ]
--------------------------------------------------------------------------------
/irisApp/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 |
3 | from joblib import load
4 | model = load('./savedModels/model.joblib')
5 |
6 | def predictor(request):
7 | if request.method == 'POST':
8 | sepal_length = request.POST['sepal_length']
9 | sepal_width = request.POST['sepal_width']
10 | petal_length = request.POST['petal_length']
11 | petal_width = request.POST['petal_width']
12 | y_pred = model.predict([[sepal_length, sepal_width, petal_length, petal_width]])
13 | if y_pred[0] == 0:
14 | y_pred = 'Setosa'
15 | elif y_pred[0] == 1:
16 | y_pred = 'Verscicolor'
17 | else:
18 | y_pred = 'Virginica'
19 | return render(request, 'main.html', {'result' : y_pred})
20 | return render(request, 'main.html')
21 |
--------------------------------------------------------------------------------
/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 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoMLDeployment.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/savedModels/model.joblib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kanuarj/DjangoMLDeployment/8663631f909b7048b365a509317d0b4615a0343c/savedModels/model.joblib
--------------------------------------------------------------------------------
/templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | My Django
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/templates/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Iris Application
8 |
9 |
10 | Iris Django Application
11 |
12 | {% if result %}
13 | Flower you're trying to classify is {{result}}
14 | {% endif %}
15 |
16 |
24 |
25 |
--------------------------------------------------------------------------------
/templates/result.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/templates/user.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | Welcome, {{name}}
11 |
12 |
--------------------------------------------------------------------------------