3. Creation of various urls
urlpatterns = [
path('', homepage, name="homepage"), #? first parameter is the url, second is what function will be runned at the url, and the third is the internal name of the link used to reference the link regardless of its url domain
path('store/', store, name="store"),
path('youraccount/', your_account, name="your_account"),
path('login/', login, name="login"),
path('cart/', cart, name="cart"),
path('checkout/', checkout, name="checkout"),
]# Create your views here.
def homepage(request): #? the first parameter always has to be a request
return render(request, 'homepage.html') #? returns the homepage
def store(request):
return render(request, 'store.html')
def cart(request):
return render(request, 'cart.html')
def checkout(request):
return render(request, 'checkout.html')
def your_account(request):
return render(request, 'user/your_account.html')
def login(request):
return render(request, 'user/login.html') 
Last updated