diff --git a/Contact/__init__.py b/Contact/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Contact/admin.py b/Contact/admin.py new file mode 100644 index 00000000..cd4370f7 --- /dev/null +++ b/Contact/admin.py @@ -0,0 +1,4 @@ +from django.contrib import admin +from Contact.models import Contact +# Register your models here. +admin.site.register(Contact) diff --git a/Contact/apps.py b/Contact/apps.py new file mode 100644 index 00000000..8aaf09e2 --- /dev/null +++ b/Contact/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ContactConfig(AppConfig): + name = 'Contact' diff --git a/Contact/migrations/0001_initial.py b/Contact/migrations/0001_initial.py new file mode 100644 index 00000000..01a26f52 --- /dev/null +++ b/Contact/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 3.1.2 on 2020-11-12 13:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('email', models.CharField(max_length=50)), + ('desc', models.CharField(max_length=300)), + ('date', models.TimeField(auto_now=True)), + ], + ), + ] diff --git a/Contact/migrations/__init__.py b/Contact/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Contact/models.py b/Contact/models.py new file mode 100644 index 00000000..32a3cef3 --- /dev/null +++ b/Contact/models.py @@ -0,0 +1,13 @@ +from django.db import models + +# Create your models here. +class Contact(models.Model): + name=models.CharField(max_length=30) + email=models.CharField(max_length=50) + desc=models.CharField(max_length=300) + date=models.TimeField() + + def __str__(self): + return self.name + + diff --git a/Contact/tests.py b/Contact/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/Contact/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Contact/urls.py b/Contact/urls.py new file mode 100644 index 00000000..a8bbc68c --- /dev/null +++ b/Contact/urls.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.contact, name='contact'), +] \ No newline at end of file diff --git a/Contact/views.py b/Contact/views.py new file mode 100644 index 00000000..2496fd91 --- /dev/null +++ b/Contact/views.py @@ -0,0 +1,18 @@ +from django.shortcuts import render +from Contact.models import Contact +from datetime import datetime + +# Create your views here. +def contact(request): + if(request.method== "POST"): + name=request.POST.get("name") + mail=request.POST.get("email") + reason=request.POST.get("reason") + contact=Contact(name=name,email=mail,desc=reason,date=datetime.now()) + contact.save() + alert={"alert":'''Your Request has been Submited'''} + return render(request, 'contact.html',alert) + else: + return render(request, 'contact.html') + + \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 8ac810ba..aa105d15 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/templates/Contact.html b/templates/Contact.html new file mode 100644 index 00000000..f50353e3 --- /dev/null +++ b/templates/Contact.html @@ -0,0 +1,29 @@ +{% extends 'base.html' %} + +{%block title%}Contact Us{%endblock title%} + + +{%block body %} +
+

Contact Us

+
+{%csrf_token%} +
+ + +
+
+ + +
+
+ + +
+
+ +
+ {{alert}} +
+
+{%endblock body%} diff --git a/templates/Error.html b/templates/Error.html new file mode 100644 index 00000000..63a934b6 --- /dev/null +++ b/templates/Error.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} + +{%block title%}Error{%endblock title%} + + +{%block body %} +
+

{{error_msg}}

+
+{%endblock body%} + diff --git a/templates/about.html b/templates/about.html index fe320a7d..e170c205 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,68 +1,12 @@ - - - - - - +{% extends 'base.html' %} - - +{%block title%}About Us{%endblock title%} - Text Utils-Results - - - - - - + +{%block body %}
-

THIS PAGE IS STILL IN DEVELOPEMENT STAGE

- - - +

About Us

+

The Page Is Currently Waiting For Harry To Write Something

+ +{%endblock body%} - - - - - - - diff --git a/templates/analyze.html b/templates/analyze.html index 4bb031ff..f71f6ca7 100644 --- a/templates/analyze.html +++ b/templates/analyze.html @@ -1,62 +1,10 @@ - - - - - - - - - - - Text Utils-Results - - - - - - +{% extends 'base.html' %} + +{%block title %}Text Utils - Analyzed Text{%endblock title%} + +{%block body %} - - - - - - - - - - + +{%endblock script%} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 00000000..6356425c --- /dev/null +++ b/templates/base.html @@ -0,0 +1,69 @@ + + + + + + + + + + + {%block title %} {%endblock title%} + + + + + + + + +{%block body %} {%endblock body%} + + + + + + {%block script %} {%endblock script%} + + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 10f597d1..7ed2d83d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,58 +1,11 @@ - - - - - - - - - - - - - Text Utils - - - - - - + +{% extends 'base.html' %} + +{%block title%}Text Utils{%endblock title%} + +{%block body%}