exo_bespin/website/bespin_app/views.py
def home(request):
    """Generate the home page.

    Parameters
    ----------
    request : HttpRequest object
        Incoming request from the webpage

    Returns
    -------
    HttpResponse object
        Outgoing response sent to the webpage
    """

    if request.method == 'GET':
        form = ExampleForm()
        template = 'home.html'
        context = {'form': form}
        return render(request, template, context)

    elif request.method == 'POST':
        form = ExampleForm(request.POST)
        if form.is_valid():
            results = _process_request(form)
            context = {'results': results}
            return render(request, 'results.html', context)
        else:
            context = {}
            return render(request, '404.html', context)

    else:
        context = {}
        return render(request, '404.html', context)
Generate the home page.

    Parameters
    ----------
    request : HttpRequest object
        Incoming request from the webpage

    Returns
    -------
    HttpResponse object
        Outgoing response sent to the webpage
    
Generate the home page.
Parameters

request : HttpRequest object
Incoming request from the webpage

Returns

HttpResponse object
Outgoing response sent to the webpage
Generate the home page . Parameters request : HttpRequest object Incoming request from the webpage Returns HttpResponse object Outgoing response sent to the webpage
def home(request):
    if request.method == 'GET':
        form = ExampleForm()
        template = 'home.html'
        context = {'form': form}
        return render(request, template, context)
    elif request.method == 'POST':
        form = ExampleForm(request.POST)
        if form.is_valid():
            results = _process_request(form)
            context = {'results': results}
            return render(request, 'results.html', context)
        else:
            context = {}
            return render(request, '404.html', context)
    else:
        context = {}
        return render(request, '404.html', context)
def home ( request ) : if request . method == 'GET' : form = ExampleForm ( ) template = 'home.html' context = { 'form' : form } return render ( request , template , context ) elif request . method == 'POST' : form = ExampleForm ( request . POST ) if form . is_valid ( ) : results = _process_request ( form ) context = { 'results' : results } return render ( request , 'results.html' , context ) else : context = { } return render ( request , '404.html' , context ) else : context = { } return render ( request , '404.html' , context )
Generate the home page.
Generate the home page .
"""Generate the home page.

    Parameters
    ----------
    request : HttpRequest object
        Incoming request from the webpage

    Returns
    -------
    HttpResponse object
        Outgoing response sent to the webpage
    """
request