title: my custom django_admin command got error AttributeError: object has no attribute 'title'
body: <p>So I am working on RSS Feed on Django. Whenever I try to run the custom command file (startjobs.py) in command prompt, the error appeared:</p>
  <pre><code>Job &quot;fetch_talkpython_posts&quot; raised an exception
  Traceback (most recent call last):
  File &quot;C:\xxx\xxx\anaconda3\lib\site-packages\feedparser\util.py&quot;, line 156, in __getattr__ 
    return self.__getitem__(key)
  File &quot;C:\xxx\xxx\anaconda3\lib\site-packages\feedparser\util.py&quot;, line 113, in __getitem__ 
    return dict.__getitem__(self, key)
  KeyError: 'title'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  File &quot;C:\xxx\xxx\anaconda3\lib\site-packages\apscheduler\executors\base.py&quot;, line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
  File &quot;C:\xxx\xxx\django_project\pyagg\content_aggregator\news\management\commands\startjobs.py&quot;, line 39, in fetch_talkpython_posts 
    save_new_posts(_feed)
  File &quot;C:\xxx\xxx\django_project\pyagg\content_aggregator\news\management\commands\startjobs.py&quot;, line 18, in save_new_posts
    feed_title = feed.channel.title
  File &quot;C:\xxx\xxx\anaconda3\lib\site-packages\feedparser\util.py&quot;, line 158, in __getattr__ 
  raise AttributeError(&quot;object has no attribute '%s'&quot; % key)
  AttributeError: object has no attribute 'title' 
  </code></pre>
  <p>I couldn't figure out why this error occured and what's wrong with <code>fetch_talkpython_posts()</code>. Any help would be appreciated.</p>
  <p>my custom command file startjobs.py:</p>
  <pre><code>import logging
  
  from django.conf import settings
  from django.core.management.base import BaseCommand
  
  import feedparser
  from dateutil import parser
  from apscheduler.schedulers.blocking import BlockingScheduler
  from apscheduler.triggers.cron import CronTrigger
  from django_apscheduler.jobstores import DjangoJobStore
  from django_apscheduler.models import DjangoJobExecution
  
  from news.models import Post
  
  logger = logging.getLogger(__name__)
  
  def save_new_posts(feed):
      feed_title = feed.channel.title
      feed_image = feed.channel.image[&quot;href&quot;]
  
      for item in feed.entries:
          if not Post.objects.filter(link=item.link).exists():
              post = Post(
                  title=item.title,
                  description=item.description,
                  pubdate=parser.parse(item.published),
                  link=item.link,
                  image=feed_image,
              )
              post.save()
  
  def fetch_realpython_posts():
      _feed = feedparser.parse(&quot;https://realpython.com/podcasts/rpp/feed&quot;)
      save_new_posts(_feed)
  
  def fetch_talkpython_posts():
      _feed = feedparser.parse(&quot;https://talkpython.fm/episodes/rss&quot;)
      save_new_posts(_feed)
  
  def delete_old_job_executions(max_age=604_800):
      DjangoJobExecution.objects.delete_old_job_executions(max_age)
  
  class Command(BaseCommand):
      help = &quot;Runs apscheduler.&quot;
      def handle(self, *args, **options):
          scheduler = BlockingScheduler(timezone=settings.TIME_ZONE)
          scheduler.add_jobstore(DjangoJobStore(), &quot;default&quot;)
  
          scheduler.add_job(
              fetch_realpython_posts,
              trigger=&quot;interval&quot;,
              minutes=2,
              id=&quot;The Real Python Podcast&quot;,
              max_instances=1,
              replace_existing=True,
          )
          logger.info(&quot;Added job: The Real Python Podcast.&quot;)
  
          scheduler.add_job(
              fetch_talkpython_posts,
              trigger=&quot;interval&quot;,
              minutes=2,
              id=&quot;Talk Python Feed&quot;,
              max_instances=1,
              replace_existing=True,
          )
          logger.info(&quot;Added job: Talk Python Feed.&quot;)
  
          scheduler.add_job(
              delete_old_job_executions,
              trigger=CronTrigger(
                  day_of_week=&quot;mon&quot;, hour=&quot;00&quot;, minute=&quot;00&quot;
              ),
              id=&quot;Delete Old Job Executions&quot;,
              max_instances=1,
              replace_existing=True,
          )
          logger.info(&quot;Added weekly job: Delete Old Job Executions.&quot;)
  
          try:
              logger.info(&quot;Starting scheduler...&quot;)
              scheduler.start()
          except KeyboardInterrupt:
              logger.info(&quot;Stopping scheduler...&quot;)
              scheduler.shutdown()
  </code></pre>
  <p>Any idea about how to solve this issue? Thanks</p>