New Question How to Let a user upload a Video and then show the content on Templates in Django?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

New Question How to Let a user upload a Video and then show the content on Templates in Django?

djangorobert
Hi Im not sure if i am the only one in the Django community who has been trying to add this feauture for a couple of years Basically what i want is to let the user upload videos.
I know that you could add the line in your models with a ImageField is that right? 

but then in the template with a 


{{ object.photo.url}}.

you could do something like that 

but when i load the page it just does not load the pictures or videos 

any help would be great thanks 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0e2b1c19-5aa9-4dab-bec7-b61a689006f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New Question How to Let a user upload a Video and then show the content on Templates in Django?

Carlos Rocha-5
what use Imagefield?,  you use FileField is you need the user upload a video like mp4. avi, mpg etc.
and in your html use tag <video> for render. {{object.video}}
example
<video width="320" height="240" controls>
  <source src="{{object.video}}" type="video/mp4">
Your browser does not support the video tag.
</video>



On Mon, Mar 12, 2018 at 1:16 PM, djangorobert <[hidden email]> wrote:
Hi Im not sure if i am the only one in the Django community who has been trying to add this feauture for a couple of years Basically what i want is to let the user upload videos.
I know that you could add the line in your models with a ImageField is that right? 

but then in the template with a 


{{ object.photo.url}}.

you could do something like that 

but when i load the page it just does not load the pictures or videos 

any help would be great thanks 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0e2b1c19-5aa9-4dab-bec7-b61a689006f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
att.
Carlos Rocha

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM-7rO1PuJngmq-gpEmojW8T9HaemhKVDqpTzu_yre%3DVLrxFfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New Question How to Let a user upload a Video and then show the content on Templates in Django?

anuch thakker
In reply to this post by djangorobert
try to create one folder "{% static 'your folder name /file name' %}"also create static folder


On Tuesday, 13 March 2018 00:46:52 UTC+5:30, djangorobert wrote:
Hi Im not sure if i am the only one in the Django community who has been trying to add this feauture for a couple of years Basically what i want is to let the user upload videos.
I know that you could add the line in your models with a ImageField is that right? 

but then in the template with a 


{{ object.photo.url}}.

you could do something like that 

but when i load the page it just does not load the pictures or videos 

any help would be great thanks 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fe8aa5d1-b359-4443-9cb0-0d8738dfbb3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New Question How to Let a user upload a Video and then show the content on Templates in Django?

djangorobert
In reply to this post by Carlos Rocha-5
Hi Carlos I figured it out actually i put this {{user.profile.vid.url}}

On Monday, March 12, 2018 at 2:29:11 PM UTC-5, sacrac wrote:
what use Imagefield?,  you use FileField is you need the user upload a video like mp4. avi, mpg etc.
and in your html use tag <video> for render. {{object.video}}
example
<video width="320" height="240" controls>
  <source src="{{object.video}}" type="video/mp4">
Your browser does not support the video tag.
</video>



On Mon, Mar 12, 2018 at 1:16 PM, djangorobert <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="lZw465V7AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">djangoc...@...> wrote:
Hi Im not sure if i am the only one in the Django community who has been trying to add this feauture for a couple of years Basically what i want is to let the user upload videos.
I know that you could add the line in your models with a ImageField is that right? 

but then in the template with a 


{{ object.photo.url}}.

you could do something like that 

but when i load the page it just does not load the pictures or videos 

any help would be great thanks 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="lZw465V7AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="lZw465V7AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/0e2b1c19-5aa9-4dab-bec7-b61a689006f7%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/0e2b1c19-5aa9-4dab-bec7-b61a689006f7%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/0e2b1c19-5aa9-4dab-bec7-b61a689006f7%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/0e2b1c19-5aa9-4dab-bec7-b61a689006f7%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
att.
Carlos Rocha

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/afe2b044-665d-42c0-b9d7-913450cf8c1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.