These are chat archives for django/django

14th
Jan 2016
cs89gr
@cs89gr
Jan 14 2016 09:38 UTC

want to create a video from youtube url in the django using embed-video
1.step install embed-video

'pip install django-embed-video'
step
Add' embed_video' to 'INSTALLED_APPS' in your Django settings.

TEMPLATE_CONTEXT_PROCESSORS = (
...
'django.core.context_processors.request',
)
3.step my model.py

'from django.db import models'
'from embed_video.fields import EmbedVideoField'

'class Item(models.Model):'
' video = EmbedVideoField() # same like models.URLField()'
4.step admin .py

'class MyModelAdmin(AdminVideoMixin, admin.ModelAdmin):'
' pass'

'admin.site.register(MyModelAdmin)'
5.step html tags

'{% load embed_video_tags %}'
the video tag:
'{% video item.video as my_video %}'
'URL: {{ my_video.url }}'
'Thumbnail: {{ my_video.thumbnail }}'
'Backend: {{ my_video.backend }}'

' {% video my_video "large" %}'
'{% endvideo %}'
in the 5 step show me error Unresolved tag 'video'

why have error ? i follow the docs embed-video

kdelinx
@kdelinx
Jan 14 2016 11:26 UTC
@cs89gr try to look by django-debug-toolbar, what is context sended to template, and write here. Because, in first look its ok...
cs89gr
@cs89gr
Jan 14 2016 12:54 UTC
This message was deleted
Steven Thate
@swthate
Jan 14 2016 15:20 UTC
Hi folks! I’m trying out Django and I have a question about Django versions!
The first version of Django I installed a while back was version 1.7.7. I started following the documentation again because I wanted to start a new Django project, but it looks like Django is now 1.9.x (1.9.1?).
Nicholas Penny
@nickpennyuk
Jan 14 2016 15:21 UTC
Go for it! Someone will definitely be able to help.
Steven Thate
@swthate
Jan 14 2016 15:22 UTC
So I did pip3 install -U Django (I was able to get pip install to work) and I was able to confirm that I had version 1.9 installed via the python terminal.
however, when I try to create a new Django project and check its version, it still says version 1.7.7 :(
(I wasn’t* able to get pip install to work, only pip3 install would work)
Nicholas Penny
@nickpennyuk
Jan 14 2016 15:23 UTC
@swthate pip install django==1.9
@swthate what OS are you using? Maybe try installing python again.
Steven Thate
@swthate
Jan 14 2016 15:26 UTC
OSX Yosemite
I have Python 3.4.3
i might have multiple python versions...
Dan Gamble
@dan-gamble
Jan 14 2016 15:27 UTC
What do you get if you run pip freeze?
Steven Thate
@swthate
Jan 14 2016 15:27 UTC
Django==1.9.1
ah. when i enter python -V i get Python 2.7.10
but my python shell, that i opened from my launchpad, says Python 3.4.3
Nicholas Penny
@nickpennyuk
Jan 14 2016 15:32 UTC
@swthate
Steven Thate
@swthate
Jan 14 2016 15:34 UTC
@nickpennyuk I just tried python3 —version and get Python 3.4.3
Nicholas Penny
@nickpennyuk
Jan 14 2016 15:34 UTC
Read through that and the django instillation page and see if you can find your problem. They have catered for all operating systems
Steven Thate
@swthate
Jan 14 2016 15:34 UTC
so apparently I had already installed that version :)
ok
oh wait...
i have python 3.4, and django 1.9… i’m still confused as to why my new projects are using django 1.7j
i enter the dir of a newly created project and run python manage.py version and get 1.7.7
and when i run python3 manage.py version i get 1.9.1. please excuse a possibly NOOB question… but what’s going on here?
Nicholas Penny
@nickpennyuk
Jan 14 2016 15:41 UTC
Different version compatibility. I would just use the newer versions.
Steven Thate
@swthate
Jan 14 2016 15:42 UTC
hmm. how do i “create” my project with the new version? i’ve created these projects with django-admin startproject mysite
Nicholas Penny
@nickpennyuk
Jan 14 2016 15:47 UTC
It is the same. :)
Steven Thate
@swthate
Jan 14 2016 15:48 UTC
haha, alright. none of this is making much sense to me! i don’t understand how my project can live as django 1.7 and 1.9 depending on which python i use to check its version… but i suppose i’ll just keep going along. :)
Nicholas Penny
@nickpennyuk
Jan 14 2016 21:34 UTC
@swthate I may have given you wrong info earlier. If you still have a problem watch this video I found "https://youtu.be/V96QGaWFkTk" it explains everything and is on a Mac. Your problem was lack of virtual environment separating django projects I think... Hope this helps.