diff --git a/animaldetectionwebsite/animaldetection/__init__.py b/animaldetectionwebsite/animaldetection/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/animaldetectionwebsite/animaldetection/__pycache__/__init__.cpython-310.pyc b/animaldetectionwebsite/animaldetection/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..3d32ded Binary files /dev/null and b/animaldetectionwebsite/animaldetection/__pycache__/__init__.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/__pycache__/admin.cpython-310.pyc b/animaldetectionwebsite/animaldetection/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000..e8a4e99 Binary files /dev/null and b/animaldetectionwebsite/animaldetection/__pycache__/admin.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/__pycache__/apps.cpython-310.pyc b/animaldetectionwebsite/animaldetection/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000..9f6d92d Binary files /dev/null and b/animaldetectionwebsite/animaldetection/__pycache__/apps.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/__pycache__/models.cpython-310.pyc b/animaldetectionwebsite/animaldetection/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000..05d258f Binary files /dev/null and b/animaldetectionwebsite/animaldetection/__pycache__/models.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/__pycache__/urls.cpython-310.pyc b/animaldetectionwebsite/animaldetection/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..3388dfd Binary files /dev/null and b/animaldetectionwebsite/animaldetection/__pycache__/urls.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/__pycache__/views.cpython-310.pyc b/animaldetectionwebsite/animaldetection/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000..d4b791c Binary files /dev/null and b/animaldetectionwebsite/animaldetection/__pycache__/views.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/admin.py b/animaldetectionwebsite/animaldetection/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/animaldetectionwebsite/animaldetection/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/animaldetectionwebsite/animaldetection/apps.py b/animaldetectionwebsite/animaldetection/apps.py new file mode 100644 index 0000000..674d573 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AnimaldetectionConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'animaldetection' diff --git a/animaldetectionwebsite/animaldetection/migrations/__init__.py b/animaldetectionwebsite/animaldetection/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/animaldetectionwebsite/animaldetection/migrations/__pycache__/__init__.cpython-310.pyc b/animaldetectionwebsite/animaldetection/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..73937da Binary files /dev/null and b/animaldetectionwebsite/animaldetection/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetection/models.py b/animaldetectionwebsite/animaldetection/models.py new file mode 100644 index 0000000..b42b9e2 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/models.py @@ -0,0 +1,14 @@ +# animaldetection/models.py +from django.db import models + +class AnimalDetection(models.Model): + area_name = models.CharField(max_length=100) + animal_name = models.CharField(max_length=100) + confidence = models.FloatField() + time = models.DateTimeField(auto_now_add=True) + animal_image = models.CharField(max_length=100) + sound_file = models.CharField(max_length=100) + no_detection = models.CharField(max_length=100) + + + diff --git a/animaldetectionwebsite/animaldetection/static/css/alldocuments.css b/animaldetectionwebsite/animaldetection/static/css/alldocuments.css new file mode 100644 index 0000000..2822c44 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/static/css/alldocuments.css @@ -0,0 +1,55 @@ + +body { + font-family: cursive; + background: linear-gradient(90deg, #00220a 0%, #018b13 100%); + margin: 0; + padding: 0; +} + +.container { + max-width: 600px; + margin: 0 auto; + padding: 20px; +} + +.heading1{ + background: linear-gradient(0deg, #ffffff 0%, #58ff60 100%); + border: 1px solid #14cf2d; + border-radius: 14px; + margin-bottom: 40px; + padding: 7px; + padding-top: 20px; +} + +h1 { + font-size: 28px; + color: #000000; + margin: 0 0 20px; + text-align: center; +} + +.document-list { + background: rgb(213, 248, 213); + padding: 20px; + border: 1px solid #14cf2d; + border-radius: 14px; + margin-bottom: 20px; +} + +.document-info { + padding: 10px 0; + border-bottom: 3px solid #14cf2d; + gap: 100; +} + +.document-info p { + margin: 0; + color: #000000; + font-weight: bold; +} + +.document-info img { + width: 50%;/* Adjust the max-width as needed */ + padding-top: 10px; + border-radius: 17px; +} diff --git a/animaldetectionwebsite/animaldetection/static/css/home.css b/animaldetectionwebsite/animaldetection/static/css/home.css new file mode 100644 index 0000000..9f6e26c --- /dev/null +++ b/animaldetectionwebsite/animaldetection/static/css/home.css @@ -0,0 +1,30 @@ +body { + background: linear-gradient(90deg, #00220a 0%, #018b13 100%); + font-family: cursive; +} +.container { + max-width: 400px; + margin: 0 auto; + padding: 40px; + background: linear-gradient(0deg, #ffffff 30%, #afffb3 100%); + border-radius: 14px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); + margin-top: 100px; +} +h1 { + text-align: center; + color: #000000; +} +button { + width: 100%; + height: 40px; + margin-top: 20px; + background-color: #14cf2d; + color: #000000; + border: none; + border-radius: 20px; + font-size: 16px; + font-family: cursive; + font-weight: bold; + cursor: pointer; +} \ No newline at end of file diff --git a/animaldetectionwebsite/animaldetection/static/css/lastdocument.css b/animaldetectionwebsite/animaldetection/static/css/lastdocument.css new file mode 100644 index 0000000..b625392 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/static/css/lastdocument.css @@ -0,0 +1,59 @@ + +body { + background: linear-gradient(90deg, #00220a 0%, #018b13 100%); + font-family: cursive; +} + +.container { + max-width: 600px; + margin: 0 auto; + padding: 20px; + background: linear-gradient(0deg, #ffffff 30%, #98ff9e 100%); + border-radius: 20px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); + text-align: center; +} + +h1 { + color: #000000; + margin-top: 0; + font-size: 35px; +} + +h4 { + font-weight: bolder; + font-size: larger; + background-color: rgb(255, 61, 61); + border-radius: 8px; + padding: 6px; + width: 200px; + margin-left: 190px; +} + +p { + color: #000000; + margin: 10px 0; + font-family: cursive; + font-weight: bold; +} + +.btn { + display: inline-block; + padding: 10px 20px; + background-color:#14cf2d; + font-family: cursive; + font-weight: bold; + color: #000000; + border: none; + border-radius: 20px; + cursor: pointer; +} + +.btn:hover { + background-color: #4caf50; +} + +.button-section { + margin-top: 20px; + text-align: center; +} diff --git a/animaldetectionwebsite/animaldetection/static/css/login.css b/animaldetectionwebsite/animaldetection/static/css/login.css new file mode 100644 index 0000000..a8a0bb9 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/static/css/login.css @@ -0,0 +1,98 @@ +body { + background: linear-gradient(90deg, #00220a 0%, #018b13 100%); + font-family:cursive; + color: #000000; + height: 500px; + margin: auto; + +} + +.container { + max-width: 300px; + margin-top: 60px; + margin-left: 450px; + + padding: 40px; + padding-left: 25px; + padding-bottom: 20px; + background: linear-gradient(0deg, #ffffff 50%, #b6ffbd 100%); + border-radius: 20px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); +} + +h1 { + text-align: center; + color: #000000; + font-size: 28px; + margin-bottom: 14px; + margin-top: 1px; +} + +label { + display: block; + margin-bottom: 8px; + color: #000000; + font-size: 14px; + margin-top: 10px; + margin-bottom: 5px; +} + +input[type="email"], +input[type="password"] { + width: 100%; + height: 30px; + padding: 8px; + border: 1px solid #f3f3f3; + border-radius: 15px; + font-size: 14px; + font-family: cursive; + color: #000000; + background-color: rgb(224, 224, 224); + outline: none; +} + +input[type="submit"], +button { + width: 100%; + height: 40px; + margin-top: 20px; + background-color: #14cf2d; + color: #000000; + border: none; + border-radius: 20px; + font-size: 16px; + cursor: pointer; + font-weight: bold; + font-family: cursive; +} + +.forgot-password { + margin-top: 10px; + text-align: right; + font-size: 14px; +} + +.forgot-password a { + color: #14cf2d; + text-decoration: none; + font-size: 12px; +} + +.checkbox-label { + display: block; + margin-top: 10px; + margin-bottom: 1px; + color: #000000; + font-size: 14px; +} + +.sign-up { + margin-top: 20px; + text-align: center; +} + +.sign-up a { + color: #14cf2d; + text-decoration: none; + font-size: 14px; +} \ No newline at end of file diff --git a/animaldetectionwebsite/animaldetection/static/css/registration.css b/animaldetectionwebsite/animaldetection/static/css/registration.css new file mode 100644 index 0000000..0e66c88 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/static/css/registration.css @@ -0,0 +1,65 @@ +body { + background-color: #f2f2f2; + font-family: Arial, sans-serif; +} + +.container { + max-width: 400px; + margin: 0 auto; + padding: 40px; + background-color: #ffffff; + border-radius: 5px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); +} + +h1 { + text-align: center; + color: #333333; +} + +label { + display: block; + margin-bottom: 8px; + color: #333333; +} + +input[type="text"], +input[type="email"], +input[type="password"] { + width: 100%; + height: 30px; + padding: 5px; + border: 1px solid #cccccc; + border-radius: 5px; + font-size: 12px; + color: #555555; +} + +input[type="submit"], +button { + width: 100%; + height: 40px; + margin-top: 20px; + background-color: #4caf50; + color: #ffffff; + border: none; + border-radius: 5px; + font-size: 16px; + cursor: pointer; +} + +.checkbox-label { + display: block; + margin-top: 10px; + color: #555555; +} + +.sign-in { + margin-top: 20px; + text-align: center; +} + +.sign-in a { + color: #4caf50; + text-decoration: none; +} \ No newline at end of file diff --git a/animaldetectionwebsite/animaldetection/static/css/reset.css b/animaldetectionwebsite/animaldetection/static/css/reset.css new file mode 100644 index 0000000..5239b3e --- /dev/null +++ b/animaldetectionwebsite/animaldetection/static/css/reset.css @@ -0,0 +1,71 @@ +body { + background: linear-gradient(90deg, #00220a 0%, #018b13 100%); + font-family: cursive; +} + +.container { + max-width: 350px; + max-height: 250px; + margin: 100px auto; + padding: 40px; + background: linear-gradient(0deg, #ffffff 30%, #afffb3 100%); + border-radius: 20px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); + font-family: cursive; +} + +h1 { + text-align: center; + color: #333333; + margin-bottom: 40px; + margin-top: 1px; +} + +input[type="email"] { + width: 94%; + height: 25px; + padding: 10px; + border-radius: 15px; + font-size: 14px; + border: 1px solid #f3f3f3; + background-color: rgb(226, 226, 226); + color: #606060; + margin-bottom: 20px; + font-family: cursive; +} + +input[type="submit"] { + display: block; + width: 100%; + height: 40px; + background-color: #14cf2d; + color: #000000; + border: none; + border-radius: 20px; + font-size: 16px; + font-weight: bold; + cursor: pointer; + font-family: cursive; +} + +.back { + text-align: center; + margin-top: 20px; +} + +.back button { + background-color: #14cf2d; + color: rgb(0, 0, 0); + border: none; + padding: 5px 10px; + border-radius: 20px; + font-size: 16px; + font-weight: bold; + cursor: pointer; + font-family: cursive; +} + +.error { + text-align: center; + margin-top: 10px; +} \ No newline at end of file diff --git a/animaldetectionwebsite/animaldetection/tests.py b/animaldetectionwebsite/animaldetection/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/animaldetectionwebsite/animaldetection/urls.py b/animaldetectionwebsite/animaldetection/urls.py new file mode 100644 index 0000000..ee26961 --- /dev/null +++ b/animaldetectionwebsite/animaldetection/urls.py @@ -0,0 +1,16 @@ +from django.urls import path +from . import views + +app_name = 'animaldetection' + +urlpatterns = [ + path('', views.signIn, name='signIn'), + path('last/', views.lastdocument, name='lastdocument'), + path('all/', views.alldocuments, name='alldocuments'), + path('postsignIn/', views.postsignIn), + path('signUp/', views.signUp, name="signUp"), + path('logout/', views.logout, name="logout"), + path('postsignUp/', views.postsignUp), + path('reset/', views.reset), + path('postReset/', views.postReset), +] diff --git a/animaldetectionwebsite/animaldetection/views.py b/animaldetectionwebsite/animaldetection/views.py new file mode 100644 index 0000000..0aa833a --- /dev/null +++ b/animaldetectionwebsite/animaldetection/views.py @@ -0,0 +1,105 @@ +# animaldetection/views.py +from django.shortcuts import render,HttpResponseRedirect +from pymongo import MongoClient +from .models import AnimalDetection +from pyrebase import pyrebase + + +config={ + "apiKey": "AIzaSyDzq2dvyGCKA1A1_8Kl62q0AfeVkDGiEYM", + "authDomain": "animaldetection-43a5c.firebaseapp.com", + "projectId": "animaldetection-43a5c", + "storageBucket": "animaldetection-43a5c.appspot.com", + "messagingSenderId": "563487220348", + "appId": "1:563487220348:web:d2acba2d5ed8a72a7f5ff9", + "measurementId": "G-QK59KBR5HV", + "databaseURL": "" +} +# Initialising database,auth and firebase for further use +firebase=pyrebase.initialize_app(config) +authe = firebase.auth() +database=firebase.database() + + +def alldocuments(request): + #connection to MongoDB + client = MongoClient('mongodb://localhost:27017') + db = client['animal_detection'] + collection = db['detections'] + + + documents = collection.find().sort('_id', -1) + + context = { + 'documents': documents, + } + return render(request, 'alldocuments.html', context) + +def signIn(request): + return render(request,"Login.html") + + +def postsignIn(request): + email=request.POST.get('email') + pasw=request.POST.get('pass') + try: + + user=authe.sign_in_with_email_and_password(email,pasw) + except: + message="Invalid Credentials!!Please ChecK your Data" + return render(request,"Login.html",{"message":message}) + session_id=user['idToken'] + request.session['uid']=str(session_id) + return render(request,"Home.html",{"email":email}) + +def logout(request): + try: + del request.session['uid'] + except: + pass + return render(request,"Login.html") + +def signUp(request): + return render(request,"Registration.html") + +def postsignUp(request): + email = request.POST.get('email') + passs = request.POST.get('pass') + name = request.POST.get('name') + try: + + user=authe.create_user_with_email_and_password(email,passs) + uid = user['localId'] + idtoken = request.session['uid'] + print(uid) + except: + message="username already exists" + return render(request, "Registration.html",{"message":message}) + return render(request,"Login.html") +def reset(request): + return render(request, "Reset.html") + +def postReset(request): + email = request.POST.get('email') + try: + authe.send_password_reset_email(email) + message = "A email to reset password is successfully sent" + return render(request, "Reset.html", {"msg":message}) + except: + message = "Something went wrong, Please check the email you provided is registered or not" + return render(request, "Reset.html", {"msg":message}) + +def lastdocument(request): + #connection to MongoDB + client = MongoClient('mongodb://localhost:27017') + db = client['animal_detection'] + collection = db['detections'] + + + document = collection.find().sort('_id', -1).limit(1)[0] + + + context = { + 'document': document, + } + return render(request, 'lastdocument.html', context) diff --git a/animaldetectionwebsite/animaldetectionwebsite/__init__.py b/animaldetectionwebsite/animaldetectionwebsite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/animaldetectionwebsite/animaldetectionwebsite/__pycache__/__init__.cpython-310.pyc b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..493011b Binary files /dev/null and b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/__init__.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetectionwebsite/__pycache__/settings.cpython-310.pyc b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000..19d2a8e Binary files /dev/null and b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/settings.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetectionwebsite/__pycache__/urls.cpython-310.pyc b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..b95216a Binary files /dev/null and b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/urls.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetectionwebsite/__pycache__/wsgi.cpython-310.pyc b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000..aae4e85 Binary files /dev/null and b/animaldetectionwebsite/animaldetectionwebsite/__pycache__/wsgi.cpython-310.pyc differ diff --git a/animaldetectionwebsite/animaldetectionwebsite/asgi.py b/animaldetectionwebsite/animaldetectionwebsite/asgi.py new file mode 100644 index 0000000..bd2fca2 --- /dev/null +++ b/animaldetectionwebsite/animaldetectionwebsite/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for animaldetectionwebsite project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'animaldetectionwebsite.settings') + +application = get_asgi_application() diff --git a/animaldetectionwebsite/animaldetectionwebsite/settings.py b/animaldetectionwebsite/animaldetectionwebsite/settings.py new file mode 100644 index 0000000..fb0a47c --- /dev/null +++ b/animaldetectionwebsite/animaldetectionwebsite/settings.py @@ -0,0 +1,141 @@ +""" +Django settings for animaldetectionwebsite project. + +Generated by 'django-admin startproject' using Django 4.1.9. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.1/ref/settings/ +""" + +from pathlib import Path + +# 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/4.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-79i&mf0=r()#i&8+)=_x*taqf5sse@bu8p(xe4ajh9nwuo(w85' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = ['192.168.20.5','127.0.0.1'] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'animaldetection', +] + +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 = 'animaldetectionwebsite.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', + ], + }, + }, +] + +WSGI_APPLICATION = 'animaldetectionwebsite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'djongo', + 'NAME': 'animal_detection', + 'CLIENT': { + 'host': 'mongodb://localhost:27017/', + } + } +} + + + +# Password validation +# https://docs.djangoproject.com/en/4.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/4.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/4.1/howto/static-files/ + +# animaldetectionwebsite/settings.py + + +# ... + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.1/howto/static-files/ + +STATIC_URL = '/static/' + + + +# ... + + +# Default primary key field type +# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' \ No newline at end of file diff --git a/animaldetectionwebsite/animaldetectionwebsite/urls.py b/animaldetectionwebsite/animaldetectionwebsite/urls.py new file mode 100644 index 0000000..181b044 --- /dev/null +++ b/animaldetectionwebsite/animaldetectionwebsite/urls.py @@ -0,0 +1,8 @@ +#animaldetectionwebsite/urls +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('animaldetection.urls')), +] diff --git a/animaldetectionwebsite/animaldetectionwebsite/wsgi.py b/animaldetectionwebsite/animaldetectionwebsite/wsgi.py new file mode 100644 index 0000000..7bff462 --- /dev/null +++ b/animaldetectionwebsite/animaldetectionwebsite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for animaldetectionwebsite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'animaldetectionwebsite.settings') + +application = get_wsgi_application() diff --git a/animaldetectionwebsite/manage.py b/animaldetectionwebsite/manage.py new file mode 100644 index 0000000..d1615c0 --- /dev/null +++ b/animaldetectionwebsite/manage.py @@ -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', 'animaldetectionwebsite.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() diff --git a/animaldetectionwebsite/package.json b/animaldetectionwebsite/package.json new file mode 100644 index 0000000..bd132a1 --- /dev/null +++ b/animaldetectionwebsite/package.json @@ -0,0 +1,12 @@ +{ + "name": "animaldetectionwebsite", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/animaldetectionwebsite/templates/Home.html b/animaldetectionwebsite/templates/Home.html new file mode 100644 index 0000000..d66ebc7 --- /dev/null +++ b/animaldetectionwebsite/templates/Home.html @@ -0,0 +1,23 @@ +{% load static %} + + + + + Home Page + + + +
+

Welcome!

+ +
+ +
+ +
+ +
+ +
+ + diff --git a/animaldetectionwebsite/templates/Login.html b/animaldetectionwebsite/templates/Login.html new file mode 100644 index 0000000..a9baecf --- /dev/null +++ b/animaldetectionwebsite/templates/Login.html @@ -0,0 +1,39 @@ +{% load static %} + + + + + Login Page + + + + + +
+

STATION MASTER LOGIN

+ {% if message %} + + {% endif %} +
+ {% csrf_token %} + + + + + + + +

+ Forgot Password? Click Here to Reset +

+ + +
+
+ + diff --git a/animaldetectionwebsite/templates/Registration.html b/animaldetectionwebsite/templates/Registration.html new file mode 100644 index 0000000..89a39d0 --- /dev/null +++ b/animaldetectionwebsite/templates/Registration.html @@ -0,0 +1,57 @@ +{% load static %} +{% if message %} + +{% endif %} + + + + + Registration Page + + + + +
+

Registration

+
+ {% csrf_token %} + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/animaldetectionwebsite/templates/Reset.html b/animaldetectionwebsite/templates/Reset.html new file mode 100644 index 0000000..5fce75c --- /dev/null +++ b/animaldetectionwebsite/templates/Reset.html @@ -0,0 +1,30 @@ +{% load static %} + +{% if msg %} + +{% endif %} + + + + + Reset Page + + + +
+

Reset Your Password

+
+ {% csrf_token %} + + +
+
+
+ +
+
+
+ + diff --git a/animaldetectionwebsite/templates/alldocuments.html b/animaldetectionwebsite/templates/alldocuments.html new file mode 100644 index 0000000..a7c2cc5 --- /dev/null +++ b/animaldetectionwebsite/templates/alldocuments.html @@ -0,0 +1,40 @@ + +{% load static %} + + + + Second Page + + + +
+
+

ALL TIME DETECTED ANIMAL DETAILS

+
+
+ + {% if documents %} + {% for document in documents %} + {% if document.documentno == "first" %} +
+

Area-Name: {{ document.area_name }}

+

Animal-Name: {{ document.animal_name }}

+

Confidence: {{ document.confidence }}

+

Detected-DateTime: {{ document.time }}

+ {% if document.animal_image %} + {% with document.animal_image|safe as image_data %} + Detected Animal Image + {% endwith %} + {% else %} +

No image available

+ {% endif %} +
+ {% endif %} + {% endfor %} + {% else %} +

No documents available.

+ {% endif %} +
+
+ + diff --git a/animaldetectionwebsite/templates/lastdocument.html b/animaldetectionwebsite/templates/lastdocument.html new file mode 100644 index 0000000..efa2ced --- /dev/null +++ b/animaldetectionwebsite/templates/lastdocument.html @@ -0,0 +1,60 @@ + +{% load static %} + + + + First Page + + + + + + +
+
+

RAILWAY TRACK ANIMAL DETECTION SYSTEM

+ {% if document.documentno == "second" %} +

{{ document.no_detection }}

+ {% elif document.documentno == "first" %} +

Animal Detected

+

Area-Name: {{ document.area_name }}

+

Animal-Name: {{ document.animal_name }}

+

Confidence: {{ document.confidence }}

+

Detected-DateTime: {{ document.time }}

+ {% if document.animal_image %} + {% with document.animal_image|safe as image_data %} + Detected Animal Image + {% endwith %} + {% else %} +

No image available

+ {% endif %} + + + {% else %} +

No document available

+ {% endif %} +
+
+ + +
+
+ +
+
+ + +