diff --git a/myproject/debug.log b/myproject/debug.log index 073fa8c386d4cea3bb1ac4684fef14907d69a35a..421ec9ac1d067eede71ab39bffb1425409eb0a17 100644 --- a/myproject/debug.log +++ b/myproject/debug.log @@ -1074,3 +1074,87 @@ Watching for file changes with StatReloader /usr/src/app/myapp/views.py changed, reloading. Watching for file changes with StatReloader Watching for file changes with StatReloader +Watching for file changes with StatReloader +Not Found: /favicon.ico +Not Found: /favicon.ico +Not Found: /favicon.ico +Not Found: /favicon.ico +Not Found: /favicon.ico +Internal Server Error: /user/ +Traceback (most recent call last): + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 502, in parse + compile_func = self.tags[command] + ~~~~~~~~~^^^^^^^^^ +KeyError: 'endblock' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner + response = get_response(request) + ^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response + response = wrapped_callback(request, *callback_args, **callback_kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/src/app/myapp/views.py", line 187, in users + return render(request, 'user_page.html', context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/shortcuts.py", line 24, in render + content = loader.render_to_string(template_name, context, request, using=using) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/loader.py", line 61, in render_to_string + template = get_template(template_name, using=using) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/loader.py", line 15, in get_template + return engine.get_template(template_name) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/backends/django.py", line 33, in get_template + return Template(self.engine.get_template(template_name), self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/engine.py", line 175, in get_template + template, origin = self.find_template(template_name) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/engine.py", line 157, in find_template + template = loader.get_template(name, skip=skip) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/loaders/cached.py", line 57, in get_template + template = super().get_template(template_name, skip) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/loaders/base.py", line 28, in get_template + return Template( + ^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 154, in __init__ + self.nodelist = self.compile_nodelist() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 196, in compile_nodelist + return parser.parse() + ^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 510, in parse + raise self.error(token, e) + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 508, in parse + compiled_result = compile_func(self, token) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/loader_tags.py", line 295, in do_extends + nodelist = parser.parse() + ^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 510, in parse + raise self.error(token, e) + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 508, in parse + compiled_result = compile_func(self, token) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/loader_tags.py", line 234, in do_block + nodelist = parser.parse(("endblock",)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 510, in parse + raise self.error(token, e) + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 508, in parse + compiled_result = compile_func(self, token) + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/defaulttags.py", line 960, in do_if + nodelist = parser.parse(("elif", "else", "endif")) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 504, in parse + self.invalid_block_tag(token, command, parse_until) + File "/usr/local/lib/python3.11/site-packages/django/template/base.py", line 555, in invalid_block_tag + raise self.error( +django.template.exceptions.TemplateSyntaxError: Invalid block tag on line 262: 'endblock', expected 'elif', 'else' or 'endif'. Did you forget to register or load this tag? diff --git a/myproject/myapp/templates/user_page.html b/myproject/myapp/templates/user_page.html index c6952ce5487830c6c60feb59145504edef7a5c2e..e1bba6eb33c2a123fe1305753908c11f6ea1e5c9 100644 --- a/myproject/myapp/templates/user_page.html +++ b/myproject/myapp/templates/user_page.html @@ -7,7 +7,17 @@ User settings </h1> <h3 class="mb-4 text-xl font-semibold dark:text-white"> - User type: {{ user_profile.user_type }} + {% if user_profile.user_type == 0 %} + User type: User + {% elif user_profile.user_type == 1 %} + User type: Admin + {% elif user_profile.user_type == 2 %} + User type: ML Engineer + {% elif user_profile.user_type == 3 %} + User type: Accountant + {% else %} + User type: Unknown + {% endif %} </h3> </div> <!-- Right Content -->