jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
http://django-embed-video.rtfd.org
MIT License
382 stars 135 forks source link

AttributeError: 'module' object has no attribute 'EmbedVideoField' #44

Closed PeeraphatHan closed 9 years ago

PeeraphatHan commented 9 years ago

this is my code

from django.db import models
from django.contrib.auth.models import User
from django.forms import ModelForm
from SinUser.models import Sin_User
from embed_video.fields import EmbedVideoField

class Campaigns(models.Model):

    name = models.CharField(max_length=30)
    slug = models.SlugField(unique=True,blank=True)
    position = models.IntegerField(null=True,blank=True)
    CurrencyField = models.CharField(max_length=10,null=True,blank=True)
    goal = models.IntegerField(null=True,blank=True)
    start = models.DateTimeField(null=True,blank=True)
    end = models.DateTimeField(null=True,blank=True)
    organization= models.TextField(null=True,blank=True)
    catagory=models.TextField(null=True,blank=True)
    location= models.TextField(null=True,blank=True)
    description = models.TextField(null=True,blank=True)
    campaign_pic =models.ImageField(upload_to='static/img/campaign_img',null=True,blank=True)
    donationonly= models.BooleanField(default=0,blank=True)
    url = models.EmbedVideoField(null=True,blank=True)
    user=models.ForeignKey(Sin_User,null=True,blank=True,related_name="foruser")
    backer=models.ManyToManyField(Sin_User,null=True,blank=True,related_name="forbacker")
    backeramount=models.IntegerField(null=True,blank=True)
    durations = models.IntegerField(null=True,blank=True)
    submitdate= models.DateTimeField(null=True,blank=True)

    def __unicode__(self):
        return self.name

class reward(models.Model):

    rewardname = models.CharField(max_length=30)
    slug = models.SlugField(unique=True)
    limit = models.IntegerField('#')
    campagin =models.ForeignKey(Campaigns)
    def __unicode__(self):
        return self.campagin+self.rewardname

i'm alrady pip install django-embed-video i have embed _video in install app i have 'django.core.context_processors.request', in template context

how ever when i makemigrations or syncdb

it error AttributeError: 'module' object has no attribute 'EmbedVideoField'

ps i use django 1.7

yetty commented 9 years ago

You should not use models.EmbedVideoField but EmbedVideoField only - check your imports.

url = EmbedVideoField(null=True,blank=True)
PeeraphatHan commented 9 years ago

thank so much

44harsh commented 1 year ago

You should not use models.EmbedVideoField but EmbedVideoField only - check your imports.

url = EmbedVideoField(null=True,blank=True)

thank you soo much

44harsh commented 1 year ago

thank you