-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add files via upload * Django website * Template of Website * Added virtualization for Child Labour Data * Deleted junk files
- Loading branch information
1 parent
d6f2c2a
commit b0a2112
Showing
603 changed files
with
83,718 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Django Website | ||
This is sample django website |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from django.contrib import admin | ||
from .models import ContactFormModel | ||
|
||
admin.site.register(ContactFormModel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class SieveappConfig(AppConfig): | ||
name = 'SieveApp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from django import forms | ||
|
||
class ContactForm(forms.Form): | ||
name = forms.CharField(widget= forms.TextInput(attrs = | ||
{ | ||
"class": "form-control", | ||
"placeholder": "Name" | ||
} | ||
) | ||
) | ||
email = forms.EmailField(widget = forms.EmailInput(attrs = | ||
{ | ||
"class": "form-control", | ||
"placeholder": "Email" | ||
} | ||
) | ||
) | ||
message = forms.CharField(widget = forms.Textarea(attrs = | ||
{ | ||
"class": "form-control", | ||
"placeholder": "Message" | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.3 on 2019-07-14 17:30 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ContactFormModel', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=250)), | ||
('email', models.EmailField(max_length=254)), | ||
('message', models.TextField()), | ||
], | ||
), | ||
] |
Empty file.
Binary file added
BIN
+764 Bytes
SieveWeb/SieveWeb/SieveApp/migrations/__pycache__/0001_initial.cpython-37.pyc
Binary file not shown.
Binary file added
BIN
+201 Bytes
SieveWeb/SieveWeb/SieveApp/migrations/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.db import models | ||
|
||
class ContactFormModel(models.Model): | ||
name = models.CharField(max_length=250) | ||
email = models.EmailField() | ||
message = models.TextField() | ||
|
||
def __str__(self): | ||
return self.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% extends 'base/base.html' %} | ||
{% load static %} | ||
|
||
{% block content %} | ||
<!-- ================ contact section start ================= --> | ||
<div class="spacing"> | ||
<section class="contact-section section_padding"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<h2 class="contact-title">Get in Touch</h2> | ||
</div> | ||
<div class="col-lg-8"> | ||
<form class="form-contact contact_form" method="POST" id="contactForm"> | ||
{% csrf_token %} | ||
<div class="row"> | ||
<div class="col-12"> | ||
<div class="form-group"> | ||
{{ form.message }} | ||
</div> | ||
</div> | ||
<div class="col-sm-6"> | ||
<div class="form-group"> | ||
{{ form.name }} | ||
</div> | ||
</div> | ||
<div class="col-sm-6"> | ||
<div class="form-group"> | ||
{{ form.email }} | ||
</div> | ||
</div> | ||
<div class="col-12"> | ||
</div> | ||
</div> | ||
<div class="form-group mt-3"> | ||
<button type="submit" class="button button-contactForm btn_1">Send Message</button> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="col-lg-4"> | ||
<div class="media contact-info"> | ||
<span class="contact-info__icon"><i class="ti-home"></i></span> | ||
<div class="media-body"> | ||
<h3>India</h3> | ||
</div> | ||
</div> | ||
<div class="media contact-info"> | ||
<span class="contact-info__icon"><i class="ti-tablet"></i></span> | ||
<div class="media-body"> | ||
<h3>+91 xxxxxxxxxx</h3> | ||
<p>Mon to Fri 9am to 6pm</p> | ||
</div> | ||
</div> | ||
<div class="media contact-info"> | ||
<span class="contact-info__icon"><i class="ti-email"></i></span> | ||
<div class="media-body"> | ||
<h3>[email protected]</h3> | ||
<p>Send us your query anytime!</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
<!-- ================ contact section end ================= --> | ||
{% endblock %} |
16 changes: 16 additions & 0 deletions
16
SieveWeb/SieveWeb/SieveApp/templates/contact/contact__.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% extends 'base/base.html'%} | ||
|
||
{% block content %} | ||
<div class="container"> | ||
<form action='' method="POST"> | ||
{% csrf_token %} | ||
{{form.name}} | ||
<br> | ||
{{form.email}} | ||
<br> | ||
{{form.message}} | ||
<br> | ||
<button type="submit" class="btn btn-danger">Submit</button> | ||
</form> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.conf.urls import url | ||
from django.shortcuts import render | ||
from .views import contact_page | ||
|
||
app_name = "SieveApp" | ||
urlpatterns = [ | ||
url(r'^$', contact_page, name='contact'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from django.shortcuts import render, redirect | ||
from .models import ContactFormModel | ||
from .forms import ContactForm | ||
|
||
def contact_page(request): | ||
form = ContactForm(request.POST or None) | ||
|
||
if form.is_valid(): | ||
obj = ContactFormModel() | ||
obj.name = form.cleaned_data.get('name') | ||
obj.email = form.cleaned_data.get('email') | ||
obj.message = form.cleaned_data.get('message') | ||
obj.save() | ||
return redirect('/') | ||
context = { | ||
"form": form | ||
} | ||
return render(request,'contact/contact.html', context) |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
""" | ||
Django settings for SieveWeb project. | ||
Generated by 'django-admin startproject' using Django 2.2.3. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/2.2/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/2.2/ref/settings/ | ||
""" | ||
|
||
import os | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
# Quick-start development settings - unsuitable for production | ||
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'cgwv_xhha7lofxa79_d0(^tydp%#mudqd$cycccgyy-4s=8a*f' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
|
||
ALLOWED_HOSTS = [] | ||
|
||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = [ | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
'SieveApp', | ||
] | ||
|
||
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 = 'SieveWeb.urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [os.path.join(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 = 'SieveWeb.wsgi.application' | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | ||
} | ||
} | ||
|
||
|
||
# Password validation | ||
# https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/2.2/howto/static-files/ | ||
|
||
STATIC_URL = '/static/' | ||
|
||
STATICFILES_DIRS = [ | ||
os.path.join(BASE_DIR, "static_my_proj") | ||
] | ||
|
||
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_cdn", "static_root") | ||
|
||
MEDIA_URL = '/media/' | ||
|
||
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_cdn", "media_root") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from django.conf import settings | ||
from django.conf.urls.static import static | ||
|
||
from django.contrib import admin | ||
from django.conf.urls import url, include | ||
from .views import home_page, about_page, report_page | ||
|
||
|
||
urlpatterns = [ | ||
url(r'^admin/', admin.site.urls), | ||
url(r'^$', home_page, name='home_page'), | ||
url(r'^about/$', about_page, name='about_page'), | ||
url(r'^report/$', report_page, name='report_page'), | ||
url(r'^sieve/', include('SieveApp.urls', namespace = 'sieveapp')), | ||
] | ||
|
||
|
||
|
||
if settings.DEBUG: | ||
urlpatterns = urlpatterns + \ | ||
static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) | ||
urlpatterns = urlpatterns + \ | ||
static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.shortcuts import render | ||
|
||
def home_page(request): | ||
return render(request, 'index.html', {}) | ||
|
||
def about_page(request): | ||
return render(request, 'about.html', {}) | ||
|
||
def report_page(request): | ||
return render(request, 'report.html', {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
WSGI config for SieveWeb 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/2.2/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'SieveWeb.settings') | ||
|
||
application = get_wsgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
"""Django's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'SieveWeb.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() |
Oops, something went wrong.