Django Website Not Extending Base.html for some reason

I am trying to recreate the automate the boring stuff with python. the problem is that I am having is that my functions depend on each other. I have tried to update the functions with the parameters but it seems like I am going in circles or playing whack a mole. fix one problem, another one appears.

The goal is to generate a function that is capable of generating a memory address that starts with a hex number and than have a function acitvate that would fill in a random number of garbage characters. %@#$ is what I mean by garbge characters. after that a game word would be placed. and finally the rest of the 16 character space would be filled with garbage characters.

My generator game_row_function is the culprit.
can anyone look at my code and give me pointers? chat gpt is not able to help.

automate the boring stuff with python example:

import sys
import random

basically game_words is where I am telling python to grab the 15 words used fo the hacking mini game.

Players select from this list of words hoping to guess the password.

I need 3 words that have 0 letters in common with the password
and another 3 words that have 1,2,3,4 letters in common with the password respectivley and the password all stored in a way that python can know about it.
after that I need to make a game board that will display the characters and the words on the screen.
# -----------------------------------------------------------------#

# garbage characters system
garbage_chars = "~!@#$%^&*()_+-={}[]|;:,.<>?/"

def introduce():
    name = input("To start the game please type in your player name: ")
        f"Agent {name}! The evil dictator Kim Jong Un has decided to launch the nukes. All of humanity's hopes rest on your shoulders to hack into the system and stop the launch. You will see a series of possible words that are the password. Use our hint system software to determine if you are close to guessing the password. The hint system will tell you the letters that the word choice and the password have in common as well as positioning. You are our last hope.... \n Okay agent {name}, here are list of the possible passwords. \n Type in the word from the available list of words that you believe is the password."

# This function generates a password for the player to guess.
def get_password(word_list):
    password = random.choice(word_list)
    print("test: This is a test for the password: ", password)
    return password

# this function will gather in the game words from the sevenletterwords.txt file
def get_word_list():
    with open("sevenletterwords.txt", "r") as file:
        word_list = [line.strip().upper() for line in file.readlines()]
        # test print(full_list_of_words)
    return word_list

def hex_number():
    number = random.randint(1000, 9999)
    hex_number = hex(number)
    return hex_number

# This function gets one game word from the game word list to place in the game board row.
# I want this function to randomly select one word from the game_word_set.
def get_game_word(game_word_set):
    one_game_word = random.choice(game_word_set)
    return one_game_word

# this function will fill the game row with garbage characters.
def garbage_character_filler(one_game_word):
    garbage_row = []
    garbage_placement = random.randint(2, 8)

    # we will fill the game row with a random amount of garbage characters
    for i in range(garbage_placement):
        # print(random.choice(garbage_chars), end="")

    for ending_characters in range(9 - len(garbage_row)):
    return str(garbage_row)

# this function is meant to combine the hex number, game word, and garbage characters togather.
def generate_game_row():
    hex_str = hex_number()
    garbage_str = garbage_character_filler()
    game_word_str = get_game_word(game_word_set)

    # Calculate the length of the final string
    total_length = len(hex_str) + len(garbage_str) + len(game_word_str)

    # Check if the total length is less than 16, and pad the string with garbage characters if needed
    if total_length < 16:
        remaining_length = 16 - total_length
        garbage_padding = "".join(
            random.choice(garbage_chars) for _ in range(remaining_length)
        return hex_str + garbage_str + game_word_str + garbage_padding
        return hex_str + garbage_str + game_word_str

# Example usage
row = generate_game_row()

# the game words need to have a certain amount of characters in common with the password.

def get_n_overlap(password, n):
    overlapping_words = []
    x = 0
    for word in word_list:
        if x < 3:
            # if the number of matching letters is the same as n than append that word to the list.
            overlap = set(password) & set(word)
            if len(overlap) == n and word != password:
                x += 1
                if x == 3:
    return overlapping_words

# DRIVER CODE ---------------------
# these lines of code are here to prevent not defined issues.

# we call these functions to grab the game words list and the password.
word_list = get_word_list()
password = get_password(word_list)

# we establish a place to hold the values
game_words_dictionary = {}
game_words = []
# we can target keys in a dictionary with variables!
# I want to use this technique once I get all three of them in there.

# place the words that have 0 letters in common into the dictionary at the 0 index.
game_words_dictionary[0] = get_n_overlap(password, 0)
# now do the same things for the other words
game_words_dictionary[1] = get_n_overlap(password, 1)
game_words_dictionary[2] = get_n_overlap(password, 2)
game_words_dictionary[3] = get_n_overlap(password, 3)
game_words_dictionary[4] = get_n_overlap(password, 4)

# now we combine these values in the dictionary togather into a single list.
game_word_set = sum(game_words_dictionary.values(), [])

# all of the game words are shuffled and random.shuffle will shuffle the values in place.
# alright the game words are finally established!

# now I need to get the hex() number, garbage character function run, and than have the game word be put into place.
game_word = get_game_word(game_word_set)
row = generate_game_row(game_word)

def main():
    rows = 16
    columns = 2
    tries = random.randint(3, 5)
    # introduce()
    # word_list = get_word_list()
    # password = get_password(word_list)

# If this program was run (instead of imported), run the game:
if __name__ == "__main__":
    except KeyboardInterrupt:
        sys.exit()  # When Ctrl-C is pressed, end the program.
# random will change things in place. there is no need for variables.

Are you debugging. You can use breakpoint() or pdb.set_trace with pdb to do some terminal debugging on your program or I guess use an ide like vs code to set breakpoints and see what’s happening.

In general, you should have a very clear idea of what you want each line and function to do, and breakpoints should let you see if your ideas are holding up at each juncture.