myapp

forms.py

from django import forms



class FormSniffer(forms.Form):

    CHOICES = (
        ('Open_webpage', 'Open webpage'),('Open_all_links_of_a_webpage', 'Open all links of a webpage')
        , ('Open_all_pages_of_entire_site', 'Open all pages of entire site'),('Run_loop', 'Run Loop'), ('Find_content_of_website', 'Find content of website'),
    )
    web_address=forms.CharField(required=True)

    option = forms.ChoiceField(choices=CHOICES, required=True, label='Options')


views.py

from django.shortcuts import render

from .forms import FormSniffer

def Open_webpage(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            if option=='Open_webpage':
                import webbrowser
                webbrowser.open_new(web_address)


import time
import webbrowser
import requests
from bs4 import BeautifulSoup

def Open_all_links_of_a_webpage(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            r=requests.get(web_address)
            b=BeautifulSoup(r.content)
            for l in b.find_all('a'):
                h=l.get('href')
                if h.startswith('h'):
                    webbrowser.open_new_tab(h)
                    time.sleep(3)
                else:
                    webbrowser.open_new_tab(web_address+h)
                    time.sleep(3)

import wget

def Open_all_pages_of_entire_site(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            r=requests.get(web_address)
            b=BeautifulSoup(r.content)
            for l in b.find_all('a'):
                h=l.get('href')
                if h.startswith('h') and web_address in h:
                    webbrowser.open_new_tab(h)
                    time.sleep(3)
                    wget.download(h)
                    r1=requests.get(h)
                    b1=BeautifulSoup(r1.content)
                    for l1 in b1.find_all('a'):
                        h1=l1.get('href')
                        if h1.startswith('h') and web_address in h1:
                            webbrowser.open_new_tab(h1)
                            time.sleep(3)
                            wget.download(h1)
                        else:
                             webbrowser.open_new_tab(h+h1)
                             time.sleep(3)
                else:
                    webbrowser.open_new_tab(web_address+h)
                    time.sleep(3)

def Run_loop(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            for i in range(0,10000):
                webbrowser.open_new(web_address)


from django.http import HttpResponse
import requests
def Find_content_of_website(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            import webbrowser
            webbrowser.open_new(web_address)
            r=requests.get(web_address)
            c=r.content
            print(c)
            from bs4 import BeautifulSoup
            content=BeautifulSoup(c)
            return HttpResponse(content)
#            return render(request, 'myapp/content.html', {'content':content})
        else:
            form=FormSniffer()

from django.http import HttpResponseRedirect
def ViewSniffer(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']

            if option=='Open_webpage':
                option=Open_webpage(request)

            if option=='Open_all_page_links':
                option= Open_all_links_of_a_webpage(request)

            if option=='Run_loop':
                option=Run_loop(request)

            if option=='Find_content_of_website':
                option=Find_content_of_website(request)

            if option=='Open_all_pages_of_entire_site':
                option=Open_all_pages_of_entire_site(request)
    else:
        form = FormSniffer()

    return render(request, 'myapp/index.html', {'form': form})


index.html



{% load staticfiles %}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Cover Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/cover.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body background="">
    <div class="site-wrapper">

      <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <nav>
                <ul class="nav masthead-nav">
                  <li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
                  <li><a href="http://www.pythonlake.com">Python Lake</a></li>
                  <li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
                </ul>
              </nav>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Web Page Sniffer</h1>
            <p class="lead" ><h5>Enter web address to explore the contents of webpage.</h5></p>
          </div>
           <br>
            <form action="" method="post">
            {%csrf_token%}
              <label for="id_web_address">Web Address</label>
              <input id="id_web_address" name="web_address" type="text" class="form-control" />
              <br>
              <label for="id_option">Options</label>
                <select id="id_option" name="option" class="form-control" >
                  <option value="Open_webpage">Open webpage</option>
                  <option value="Open_all_links_of_a_webpage">Open all links of a webpage</option>
                  <option value="Open_all_pages_of_entire_site">Open all pages of entire site</option>
                  <option value="Run_loop">Run loop</option>
                  <option value="Find_content_of_website">Find content of website</option>


                </select>
              <br>
              <input class="btn btn-default" type="submit" value="Submit">
            </form>
        </div>
      </div>
    </div>


<p><h6>  A project of  <a href="http://djangoschool.org/">Django School</a> | Copyright © 2015 |  All rights reserved. </h6> </p>

  </body>
</html>


<body>

{{content}}

</body>


settings.py


"""
Django settings for myproject project.

Generated by 'django-admin startproject' using Django 1.8.3.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

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/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hrk@ipe^e_)(uisp%+)tejdf)$fm$#ka^j1+7_rd*z59-4p91&'

# 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', 'myapp'
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'myproject.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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 = 'myproject.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/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/1.8/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static'),
)


urls.py

"""myproject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url

from myapp.views import ViewSniffer

urlpatterns = [
    url(r'^', ViewSniffer),
]












from django.shortcuts import render

from .forms import FormSniffer

def Open_webpage(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            if option=='Open_webpage':
                import webbrowser
                webbrowser.open_new(web_address)


import time
import webbrowser
import requests
from bs4 import BeautifulSoup

def Open_all_page_links(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            r=requests.get(web_address)
            b=BeautifulSoup(r.content)
            for l in b.find_all('a'):
                h=l.get('href')
                if h.startswith('h'):
                    webbrowser.open_new_tab(h)
                    time.sleep(3)
                else:
                    webbrowser.open_new_tab(web_address+h)
                    time.sleep(3)


def Run_loop(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']
            for i in range(0,10000):
                webbrowser.open_new(web_address)


def ViewSniffer(request):
    if request.method == 'POST':
        form = FormSniffer(request.POST)
        if form.is_valid():
            web_address = form.cleaned_data['web_address']
            option=form.cleaned_data['option']

            if option=='Open_webpage':
                option=Open_webpage(request)

            if option=='Open_all_page_links':
                option= Open_all_page_links(request)

            if option=='Run_loop':
                option=Run_loop(request)


    else:
        form = FormSniffer()

    return render(request, 'sniffer/index.html', {'form': form})



from django import forms



class FormSniffer(forms.Form):

    CHOICES = (
        ('Open_webpage', 'Open webpage'),('Open_all_page_links', 'Open all page links')
        , ('Run_loop', 'Run Loop'),
    )
    web_address=forms.CharField(required=True)

    option = forms.ChoiceField(choices=CHOICES, required=True, label='Options')




 
{% load staticfiles %}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Cover Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/cover.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body background="">
    <div class="site-wrapper">

      <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <nav>
                <ul class="nav masthead-nav">
                  <li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
                  <li><a href="http://www.pythonlake.com">Python Lake</a></li>
                  <li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
                </ul>
              </nav>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Web Page Sniffer</h1>
            <p class="lead" ><h5>Enter web address to explore the contents of webpage.</h5></p>
          </div>
           <br>
            <form action="" method="post">
            {%csrf_token%}
              <label for="id_web_address">Web Address</label>
              <input id="id_web_address" name="web_address" type="text" class="form-control" />
              <br>
              <label for="id_option">Options</label>
                <select id="id_option" name="option" class="form-control" >
                  <option value="Open_webpage">Open webpage</option>
                  <option value="Open_all_page_links">Open all page links</option>
                  <option value="Run_loop">Run loop</option>

                </select>
              <br>
              <input class="btn btn-default" type="submit" value="Submit">
            </form>
        </div>
      </div>
    </div>
<p><h6>  A project of  <a href="http://djangoschool.org/">Django School</a> | Copyright © 2015 |  All rights reserved. </h6> </p>

  </body>
</html>

















{% load staticfiles %}


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">

<title>Cover Template for Bootstrap</title>

<!-- Bootstrap core CSS -->
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="/static/bootstrap/css/cover.css" rel="stylesheet">

<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>

<body background="">


<div class="site-wrapper">

<div class="site-wrapper-inner">

<div class="cover-container">

<div class="masthead clearfix">
<div class="inner">
<nav>
<ul class="nav masthead-nav">
<li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
<li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
</ul>
</nav>
</div>
</div>

<div class="inner cover">
<h1 class="cover-heading">Web Page Sniffer</h1>
<p class="lead" ><h5>Enter web address to explore the contents of webpage.</h5></p>
</div>
<br>
<br>
<br>
<form action="" method="post">
{%csrf_token%}
<label for="id_web_address">Web Address</label>
<input id="id_web_address" name="web_address" type="text" class="form-control" />

<br>
<label for="id_option">Options:</label>
<select id="id_option" name="option" class="form-control" >
<option value="OPENPAGE">Open Webpage</option>
<option value="DOWNLOAD">Download</option>

</select>


<br>
<input class="btn btn-default" type="submit" value="Submit">



</form>


</div>

</div>

</div>


</body>
</html> 



from django.shortcuts import render
from django.http import HttpResponseRedirect

from .forms import FormSniffer

def ViewSniffer(request):
if request.method == 'POST':
form = FormSniffer(request.POST)
if form.is_valid():
web_address = form.cleaned_data['web_address']
option=form.cleaned_data['option']
import webbrowser
webbrowser.open_new(web_address)

return HttpResponseRedirect('/thanks/')

else:
form = FormSniffer()

return render(request, 'sniffer/index.html', {'form': form})













__author__ = 'adilwaseem75'


from django import forms


class FormSniffer(forms.Form):
web_address=forms.CharField()

CHOICES = (
('OPENPAGE', 'Open Webpage'),('DOWNLOAD', 'Download'),
)
option = forms.ChoiceField(choices=CHOICES, required=True, label='Options')












files 




settings.py


import os

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/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-eai3j%ji)17s-2qo!q+)t7!b0bs93rubq5yhk+d%69^a=whr$'

# 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', 'myapp'
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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 = 'mysite.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/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/1.8/howto/static-files/

STATIC_URL = '/static/'


STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static'),
)


urls.py


The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin

from myapp.views import TextFieldView, Response


urlpatterns = [
    # url(r'^$', ViewUrl),  url(r'^thanks/$', Response),
    # url(r'^$', ViewUrl),  url(r'^thanks/$', Response),

     url(r'^$', TextFieldView), url(r'^thanks/$', Response),

]


models.py


from django.db import models

# Create your models here.
class ModelTextField(models.Model):
    Enter_your_text_here=models.TextField()
   # models.TextField()

    def __str__(self):
        return self.Enter_your_text_here



forms.py


__author__ = 'adilwaseem75'
from django import forms
from .models import ModelTextField

class FormTextField(forms.ModelForm):
    class Meta:
        model=ModelTextField
        fields=['Enter_your_text_here']


views.py
from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import FormTextField
from .models import ModelTextField

def TextFieldView(request):
    form=FormTextField(request.POST)
    if form.is_valid():
        form.save(commit=False)
        form.save()
        return HttpResponseRedirect('/thanks/')

    else:
        form=FormTextField

    return render(request,'myapp/index.html',{'form':form})

from django.http import HttpResponse
from .models import ModelTextField
from django.shortcuts import render
def Response(request):
    model = ModelTextField
    id=ModelTextField.objects.latest('id')
    string=str(id)
    upper=string.upper()

    return render(request,'myapp/uppercase.html',{'upper':upper})

index.html

{% load staticfiles %}


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Cover Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/cover.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="site-wrapper">

      <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <nav>
                <ul class="nav masthead-nav">
                  <li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
                  <li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
                </ul>
              </nav>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Text Converter</h1>
            <p class="lead">Enter you text to convert it to uppercase.</p>
          </div>



            <form action="" method="post">
{%csrf_token%}


            <label for="id_Enter_your_text_here">Enter your text here:</label>

            <textarea cols="40" id="id_Enter_your_text_here" name="Enter_your_text_here" rows="10" class="form-control">

            </textarea>
            <br>
            <input class="btn btn-default" type="submit" value="Submit">


            {{upper}}

    </form>

        </div>

      </div>

    </div>


  </body>
</html>


uppercase.html

{% load staticfiles %}


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Cover Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/cover.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body background="http://www.pythonlake.com">

    <div class="site-wrapper">

      <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <nav>
                <ul class="nav masthead-nav">
                  <li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
                  <li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
                </ul>
              </nav>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Text Converter</h1>
            <p class="lead">Enter you text to convert it to uppercase.</p>
          </div>
            <br>
            <h1><a href="http://localhost:8000/">Back</a></h1>
            <br>
             {{upper}}

        </div>

      </div>

    </div>


  </body>
</html>











forms.py 

from django import forms

class SnifferForm(forms.Form):
    url = forms.URLField(max_length=100)

views.py

from django.shortcuts import render
from django.http import HttpResponseRedirect

from .forms import SnifferForm

def SnifferView(request):
    if request.method == 'POST':
        form = SnifferForm(request.POST)
        if form.is_valid():
            url = form.cleaned_data['url']
            import webbrowser
            webbrowser.open_new(url)

            return HttpResponseRedirect('/thanks/')

    else:
        form = SnifferForm()

    return render(request, 'sniffer/index.html', {'form': form})

index.html

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<form method="POST" action="">
 {% csrf_token %}
{{form}}
    <button name="Submit"> Submit </button>
    </form>
</body>
</html>









Django apps can convert the text into the uppercase. First text was saved in the db and then data is retrieved and convert into the uppercase and displayed in uppercase.html.

Installation process

Django Window CMD Commands
Steps for creating virtual environment, startproject, startapps, migration, & running server:
  • virtualenv [virtual environment name]
  • cd  [virtual environment name]
  • .\Scripts\activate
  • .\Scripts\deactivate
  • pip install django
  • python .\Scripts\django-admin.py startproject [project name]
  • cd [project name]
  • python manage.py runserver
  • python manage.py startapp [name of app]
  • python manage.py migrate
  • python manage.py runserver

urls.py


from textfieldapp.views import TextFieldView
from textfieldapp.views import Response

urlpatterns = [
    # url(r'^$', ViewUrl),  url(r'^thanks/$', Response),
    # url(r'^$', ViewUrl),  url(r'^thanks/$', Response),

     url(r'^$', TextFieldView), url(r'^thanks/$', Response),

]


models.py

from django.db import models

# Create your models here.
class ModelTextField(models.Model):
    Enter_your_text_here=models.TextField()
   # models.TextField()

    def __str__(self):
        return self.Enter_your_text_here

forms.py

__author__ = 'adilwaseem75'
from django import forms
from .models import ModelTextField

class FormTextField(forms.ModelForm):
    class Meta:
        model=ModelTextField
        fields=['Enter_your_text_here']

views.py

from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import FormTextField

def TextFieldView(request):
    form=FormTextField(request.POST)
    if form.is_valid():
        form.save(commit=False)
        form.save()
        return HttpResponseRedirect('/thanks/')

    else:
        form=FormTextField

    return render(request,'textfieldapp/index.html',{'form':form})

from django.http import HttpResponse
from .models import ModelTextField
from django.shortcuts import render
import time
import webbrowser
def Response(request):
    model = ModelTextField
    id=ModelTextField.objects.latest('id')
    string=str(id)
    upper=string.upper()

    return render(request,'textfieldapp/uppercase.html',{'upper':upper})

textfieldapp/index.html

<html>
<head>
  <style>
body  {
</style>
    <div class="container">
      <div class="header clearfix">
        <nav>
          <ul class="nav nav-pills pull-right">
            <li role="presentation" class="active"><a href="http://www.djangoschool.org">Django School</a></li>
            <li role="presentation"><a href="http://www.djangoschool.org/python/contactus">Contact</a></li>

          </ul>
        </nav>
      </div>
</head>
    <body>
    <div class="jumbotron">
        <h1>Uppercase Text Converter</h1>
        <form  action="" method="post">
          <div class="form-group">
          <br>
          <br>
                 {%csrf_token%} {{form}}

                    <button type="submit" class="btn btn-default">Submit</button> </p>

                    </div>
            <p> {{upper}} </p>

        <h6> <a href="http://www.djangoschool.org">Django School</a>, A apps of <a href="http://www.pythonlake.com">
          Python Lake</a>  All Rights Reserved.</h6>
      <br>
          <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    </body>

</html>

textfieldapp/uppercase.html


<html>


<head>
  <style>
body  {

</style>

    <div class="container">
      <div class="header clearfix">
        <nav>
          <ul class="nav nav-pills pull-right">
            <li role="presentation" class="active"><a href="http://www.djangoschool.org">Django School</a></li>
            <li role="presentation"><a href="http://www.djangoschool.org/python/contactus">Contact</a></li>

          </ul>
        </nav>
      </div>
</head>
    <body>
    <div class="jumbotron">
        <h1>Uppercase Text Converter</h1>
        <form  action="" method="post">
          <div class="form-group">
          <br>
          <br><a href="http://localhost:8000/">Back</a>
           <p> Upper Case</p>
           <p>         <p> {{upper}} </p>
          <br>
          <br>
          <br>
            </div>
              </form>

        <h6> <a href="http://www.djangoschool.org">Django School</a>, A apps of <a href="http://www.pythonlake.com">
          Python Lake</a>  All Rights Reserved.</h6>
      <br>
          <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    </body>

</html>












 
import requests

from bs4 import BeautifulSoup

r=requests.get('http://www.pythonlake.com')
c=r.content

b=BeautifulSoup(c)

for link in b.find_all('link'):
    h=link.get('href')
    import webbrowser
    webbrowser.open_new(h)
    import wget
    wget.download(h)
    








 


setting.py


INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles', 'myapp',
)


urls.py

from django.conf.urls import url

from myapp.views import ViewUrl
from myapp.views import Response

urlpatterns = [
     url(r'^$', ViewUrl),  url(r'^thanks/$', Response),
]

models.py

from django.db import models

# Create your models here.
class ModelUrl(models.Model):
    url=models.URLField()

    def __str__(self):
        return self.url

forms.py

from django import forms
from .models import ModelUrl

class FormUrl(forms.ModelForm):
    class Meta:
        model=ModelUrl
        fields=['url']


views.py

from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import FormUrl

def ViewUrl(request):
    form=FormUrl(request.POST)
    if form.is_valid():
        form.save(commit=False)
        form.save()
        return HttpResponseRedirect('/thanks/')

    else:
        form=FormUrl

    return render(request,'myapp/index.html',{'form':form})


from .models import ModelUrl
import time
import webbrowser
def Response(request):
    model = ModelUrl
    v=ModelUrl.objects.latest('id')
    s=str(v)
    for i in range(0,10):
        w=webbrowser.open_new(s)
        time.sleep(10)


html




<html>


<head>
  <style>
body  {

</style>

    <div class="container">
      <div class="header clearfix">
        <nav>
          <ul class="nav nav-pills pull-right">
            <li role="presentation" class="active"><a href="http://www.djangoschool.org">Django School</a></li>
            <li role="presentation"><a href="">Terms & Condition</a></li>
            <li role="presentation"><a href="http://www.djangoschool.org/python/contactus">Contact</a></li>

          </ul>
        </nav>
      </div>

</head>

    <body>

    <div class="jumbotron">
        <h1>Viral Content Generator</h1>
              <h3>Instantly generate thousands of views on your website pages, video, and anywhere.
                Just enter your web URL and sit tight while viral content is on a way. </h3>



        <form  action="" method="post">
          <div class="form-group">
          <br>
          <br>
           <p> In this format: http://www.youtube.com/yourchannel</p>
           <p>         {%csrf_token%} {{form}}
                    <input type="checkbox"> Agree to terms and conditions.

                    <button type="submit" class="btn btn-default">Submit</button> </p>
          <br>
          <br>
          <br>
            </div>
              </form>

        <h6> <a href="http://www.djangoschool.org">Django School</a>, A project of <a href="http://www.pythonlake.com">
          Python Lake</a>  All Rights Reserved.</h6>
      <br>
          <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    </body>

</html>


requestsapp/views.py

from django.http import HttpResponse
from .models import ModelUrl
import time
import webbrowser
import requests
from bs4 import BeautifulSoup
def Response(request):
    model = ModelUrl
    v=ModelUrl.objects.latest('id')
    s=str(v)
    r=requests.get(s)
    b=BeautifulSoup(r.content)
    for l in b.find_all('a'):
            h=l.get('href')
            time.sleep(5)
            webbrowser.open_new_tab(h)

    return HttpResponse('You request is processed')



requestsapp.py will open the all url links in the website


from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import FormUrl

def ViewUrl(request):
    form=FormUrl(request.POST)
    if form.is_valid():
        form.save(commit=False)
        form.save()
        return HttpResponseRedirect('/thanks/')

    else:
        form=FormUrl

    return render(request,'requestsapp/index.html',{'form':form})


from django.http import HttpResponse
from .models import ModelUrl
import time
import webbrowser
import requests
from bs4 import BeautifulSoup
def Response(request):
    model = ModelUrl
    v=ModelUrl.objects.latest('id')
    s=str(v)
    r=requests.get(s)
    b=BeautifulSoup(r.content)
    for l in b.find_all('a'):
            h=l.get('href')
            if h.startswith('h'):
                webbrowser.open_new_tab(h)
                time.sleep(5)
    return HttpResponse('You request is processed')


from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import FormUrl

def ViewUrl(request):
    form=FormUrl(request.POST)
    if form.is_valid():
        form.save(commit=False)
        form.save()
        return HttpResponseRedirect('/thanks/')

    else:
        form=FormUrl
    return render(request,'requestsapp/index.html',{'form':form})


from django.http import HttpResponse
from .models import ModelUrl
import time
import webbrowser
import requests
from bs4 import BeautifulSoup
def Response(request):
    model = ModelUrl
    v=ModelUrl.objects.latest('id')
    s=str(v)
    r=requests.get(s)
    b=BeautifulSoup(r.content)
    for l in b.find_all('a'):
            h=l.get('href')
            if h.startswith('h'):
                webbrowser.open_new_tab(h)
                time.sleep(3)
                print(webbrowser.open_new_tab(h))
            else:
                webbrowser.open_new_tab(s+h)
                time.sleep(3)
                webbrowser.open_new_tab(s+h)
                print(webbrowser.open_new_tab(s+h))

    return HttpResponse('You request is processed')




import time
import webbrowser
import random
import subprocess
import requests
import webbrowser

from bs4 import BeautifulSoup
r=requests.get('http://www.pythonlake.com')
b=BeautifulSoup(r.content)
for l in b.find_all('a'):
    h=l.get('href')
    for i in range(1,10):
        r=random.randrange(1,5)
        p = subprocess.Popen(["C:\Program Files\Internet Explorer\iexplore.exe", h])
        time.sleep(r)
        p.kill()


import time

import webbrowser

import random

import subprocess

import requests

import webbrowser

from bs4 import BeautifulSoup


re=requests.get('http://www.pythonlake.com')

soup=BeautifulSoup(re.content)


for link in soup.find_all('a'): 

   href=link.get('href')

    subprocess.Popen(["C:\Program Files\Internet Explorer\iexplore.exe", href])

    r=requests.get(href)

    s=BeautifulSoup(re.content)

    for l in soup.find_all('a'):

        h=link.get('href')

        subprocess.Popen(["C:\Program Files\Internet Explorer\iexplore.exe", h])





files
 




settings.py


import os

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/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-eai3j%ji)17s-2qo!q+)t7!b0bs93rubq5yhk+d%69^a=whr$'

# 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', 'myapp'
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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 = 'mysite.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/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/1.8/howto/static-files/

STATIC_URL = '/static/'


STATICFILES_DIRS=(os.path.join(BASE_DIR, 'static'),

urls.py


The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin

from myapp.views import TextFieldView, Response


urlpatterns = [
    # url(r'^$', ViewUrl),  url(r'^thanks/$', Response),
    # url(r'^$', ViewUrl),  url(r'^thanks/$', Response),

     url(r'^$', TextFieldView), url(r'^thanks/$', Response),

]


models.py


from django.db import models

# Create your models here.
class ModelTextField(models.Model):
    Enter_your_text_here=models.TextField()
   # models.TextField()

    def __str__(self):
        return self.Enter_your_text_here



forms.py


__author__ = 'adilwaseem75'
from django import forms
from .models import ModelTextField

class FormTextField(forms.ModelForm):
    class Meta:
        model=ModelTextField
        fields=['Enter_your_text_here']


views.py
from django.shortcuts import render
from django.http import HttpResponseRedirect
from .forms import FormTextField
from .models import ModelTextField

def TextFieldView(request):
    form=FormTextField(request.POST)
    if form.is_valid():
        form.save(commit=False)
        form.save()
        return HttpResponseRedirect('/thanks/')

    else:
        form=FormTextField

    return render(request,'myapp/index.html',{'form':form})

from django.http import HttpResponse
from .models import ModelTextField
from django.shortcuts import render
def Response(request):
    model = ModelTextField
    id=ModelTextField.objects.latest('id')
    string=str(id)
    upper=string.upper()

    return render(request,'myapp/uppercase.html',{'upper':upper})

index.html

{% load staticfiles %}


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Cover Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/cover.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="site-wrapper">

      <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <nav>
                <ul class="nav masthead-nav">
                  <li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
                  <li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
                </ul>
              </nav>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Text Converter</h1>
            <p class="lead">Enter you text to convert it to uppercase.</p>
          </div>



            <form action="" method="post">
{%csrf_token%}


            <label for="id_Enter_your_text_here">Enter your text here:</label>

            <textarea cols="40" id="id_Enter_your_text_here" name="Enter_your_text_here" rows="10" class="form-control">

            </textarea>
            <br>
            <input class="btn btn-default" type="submit" value="Submit">


            {{upper}}

    </form>

        </div>

      </div>

    </div>


  </body>
</html>


uppercase.html






{% load staticfiles %}


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Cover Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/bootstrap/css/cover.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body background="http://www.pythonlake.com">

    <div class="site-wrapper">

      <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <nav>
                <ul class="nav masthead-nav">
                  <li class="active"><a href="http://www.djangoschool.org">Django School</a></li>
                  <li><a href="http://djangoschool.org/python/contactus">Contact</a></li>
                </ul>
              </nav>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Text Converter</h1>
            <p class="lead">Enter you text to convert it to uppercase.</p>
          </div>
            <br>
            <h1><a href="http://localhost:8000/">Back</a></h1>
            <br>
             {{upper}}

        </div>

      </div>

    </div>


  </body>
</html>









Comments