Creating Views

None

Tip

Creating Views


Open up the lightning_app/lightning_address_payment/views.py file.



Let’s import the HttpResponse function and create two new views that we’ll use through-out our project.

index & success . You can do so by replacing everything in the file with the following.


from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.

def index(request):
    return HttpResponse("Hello, world. You're at the Lightning Address Payment home page.")

def success(request):
    return HttpResponse("Hello, world. You're at the Lightning Address Payment success page.")


Now, save the file. We’ll return back to these views later on. This is where we’ll do most of our code.