# Django error - 'function' object has no attribute \[closed\]

**URL:** <https://forum.djangoproject.com/t/django-error-function-object-has-no-attribute-closed/6139>\
**Category:** Using Django\
**Created:** [January 14, 2021, 5:05pm UTC](https://forum.djangoproject.com/t/django-error-function-object-has-no-attribute-closed/6139 "2021-01-14T17:05:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![misakv](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/misakv/32/3119_2.png) [@misakv](https://forum.djangoproject.com/u/misakv)\
**Post date:** [January 14, 2021, 5:05pm UTC](https://forum.djangoproject.com/t/django-error-function-object-has-no-attribute-closed/6139/1 "2021-01-14T17:05:40Z")

</div>

I have following problem:  
I would like to call a function `vyroci_mesicV` from a module `vyroci` in my `view.py`.  
When I simply try `print(vyroci.vyroci_mesicV())` in the terminal in VS Code I got the desired output. However, when I run `py manage.py runserver`and run the local host I got and error message `AttributeError: 'function' object has no attribute 'vyroci_mesicV'`

Here is the code of views.py if needed:

```auto
def vyroci(request):
    error_msg = None
    vysledek = None
    if request.method == "POST":
        if (request.POST["operator"] == "Vysehrad"):         
            vysledek = vyroci.vyroci_mesicV()
        else:
            error_msg = "something wrong :("
            return render(request, "vyroci/vyroci.html", dict(error_msg=error_msg, vysledek=vysledek))
    return render(request, "vyroci/vyroci.html", dict(error_msg=error_msg, vysledek=vysledek))

```

and here the vyroci.html if needed:

```auto
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
        <title>XXX</title>
</head>
<body>
    <form method="POST">
        {% csrf_token %}
        <span style="color: red;">{{error_msg}}</span>
        <br>
        <select name="operator">
            <option value="Vysehrad" {% if request.POST.operator == "Vysehrad" %} selected {% endif %}>Vyšehrad</option>
        </select>
        <input type="submit"><br>
        {{vysledek}}
    </form>
</body>
</html>

```
