No Reverse Match exception

Hi I haven’t used Django in years and cannot work out the error I’m getting, I think I need a new url path but please someone correct my otherwise.


from django.urls import path
from .views import PropertyListView

app_name = 'listings'

urlpatterns = [
    path('property-list/', PropertyListView.as_view(), name='property-list'),


class PropertyListView(View):

    def get(self, request):
        form = PropertyFilterForm()
        context = {
            'form': form,
        return render(request, 'listings/property-list.html', context)

    def post(self, request):
        form = PropertyFilterForm(request.POST)
        if form.is_valid():
            start_date = form.cleaned_data['start_date']
            end_date = form.cleaned_data['end_date']
            suburb = form.cleaned_data['suburb']
            state = form.cleaned_data['state']
            postcode = form.cleaned_data['postcode']

            listings = PropertyListing.objects.all().order_by('-date_sold')[:10]
            if start_date and end_date:
                listings = listings.filter(date_sold__range=[start_date, end_date])
            if suburb:
                listings = listings.filter(suburb__icontains=suburb)
            if state:
                listings = listings.filter(state__icontains=state)
            if postcode:
                listings = listings.filter(postcode__icontains=postcode)

            context = {
                'form': form,
                'listings': listings,

            return render(request, 'listings/property-list.html', context)

        # Form is invalid, render the form again
        context = {
            'form': form,
        return render(request, 'listings/property-list.html', context)


class PropertyFilterForm(forms.Form):
    start_date = forms.DateField(label='Start Date', required=False, input_formats=['%Y-%m-%d'], widget=forms.DateInput(attrs={'type': 'date', 'placeholder': 'YYYY-MM-DD'}))
    end_date = forms.DateField(label='End Date', required=False, input_formats=['%Y-%m-%d'], widget=forms.DateInput(attrs={'type': 'date', 'placeholder': 'YYYY-MM-DD'}))
    suburb = forms.ChoiceField(label='Suburb', choices=[], required=False)
    state = forms.ChoiceField(label='State', choices=[], required=False)
    postcode = forms.ChoiceField(label='Postcode', choices=[], required=False)

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['start_date'].choices = self.get_date_choices()
        self.fields['end_date'].choices = self.get_date_choices()
        self.fields['suburb'].choices = self.get_suburb_choices()
        self.fields['state'].choices = self.get_state_choices()
        self.fields['postcode'].choices = self.get_postcode_choices()

    def get_date_choices(self):
        return [(date_sold, date_sold) for date_sold in PropertyListing.objects.values_list('date_sold', flat=True).distinct()]

    def get_suburb_choices(self):
        return [(suburb, suburb) for suburb in PropertyListing.objects.values_list('suburb', flat=True).distinct()]

    def get_state_choices(self):
        states = PropertyListing.objects.values_list('state', flat=True).distinct()
        return [(state, state) for state in states]

    def get_postcode_choices(self):
        return [(postcode, postcode) for postcode in PropertyListing.objects.values_list('postcode', flat=True).distinct()]


<!DOCTYPE html>
<html lang="en">
        <link href=""
        integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
        <script src=""

        {% block head %}
        {% endblock %}
    <title>Property Listings</title>
    <h1>Property Listings</h1>

    <form method="post" action="{% url 'property-list' %}">
        {{ form.as_p }}
        <button type="submit">Filter</button>

    {% if form.is_valid %}
                    <th>Date Sold</th>
                    <th>Sold By</th>
                    <th>Price Guide</th>
                    <th>Price Guide Info</th>
                    <th>Number of Beds</th>
                    <th>Number of Baths</th>
                    <th>Number of Parking</th>
                    <th>Size (m²)</th>
                    <th>House Type</th>
                    <th>Full Address</th>
                    <th>Listing Type</th>
                {% for listing in listings %}
                        <td>{{ }}</td>
                        <td>{{ listing.date_sold }}</td>
                        <td>{{ listing.sold_by }}</td>
                        <td>{{ listing.price_guide }}</td>
                        <td>{{ listing.price_guide_info }}</td>
                        <td>{{ listing.address1 }}</td>
                        <td>{{ listing.num_of_beds }}</td>
                        <td>{{ listing.num_of_baths }}</td>
                        <td>{{ listing.num_of_parking }}</td>
                        <td>{{ listing.size_msq }}</td>
                        <td>{{ listing.house_type }}</td>
                        <td>{{ listing.inspection }}</td>
                        <td>{{ listing.full_address }}</td>
                        <td>{{ listing.listing_type }}</td>
                        <td>{{ listing.suburb }}</td>
                        <td>{{ listing.state }}</td>
                        <td>{{ listing.postcode }}</td>
                        <td>{{ listing.profile }}</td>
                {% empty %}
                        <td colspan="18">No listings available.</td>
                {% endfor %}
    {% endif %}


Request Method:	GET
Request URL:
Django Version:	4.2.2
Exception Type:	NoReverseMatch
Exception Value:	
Reverse for 'property-list' not found. 'property-list' is not a valid view function or pattern name.

You have:

Using the app_name creates a namespace for your urls. This means you need to reference the name within the url tag as listings:property-list.

See URL dispatcher | Django documentation | Django for more information.

That worked, thank you