Pretty nice commit overall, made the upload mechanic much more realistic and usable. Only thing left for the upload is the user id assignment. Check new ideas in discord.

This commit is contained in:
Yamozha
2021-02-17 03:00:51 +02:00
parent e5db5a969f
commit 322047b51b
43 changed files with 161 additions and 28 deletions

View File

@ -5,16 +5,16 @@
{% 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 file_url %}
<h3>Succesfully uploaded</h3>
<img src="{{ file_url }}" alt="connect" style="max-height:300px">
{% endif %}
<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>
<img src="{{ img_obj.image.url}}" alt="connect" style="max-height:300px">
{% endif %}
{% else %}
<p>You are not logged in</p>
<a href="{% url 'login' %}">Log In</a>

View File

@ -0,0 +1,22 @@
{% 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 %}