{% extends 'base.html' %}

{% block title %} Home {% endblock %}

{% block content %}
{% if user.is_authenticated %}
  Hi {{ user.username }}!<br>
<form method="post" enctype="multipart/form-data">
  	  {% csrf_token %}
  	   {{ form.as_p }}
  	  <button type="submit">Upload</button>
  	</form>
  	
  	{% if img_obj %}
  	  <h3>Succesfully uploaded : {{img_obj.title}}</h3>
  	  <source src="{{ img_obj.image.url}}" type="video/mp4" alt="connect" style="max-height:300px">
  	{% endif %}
	{% else %}
  <p>You are not logged in</p>
  <a href="{% url 'login' %}">Log In</a>
{% endif %}
{% endblock %}
