Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6042217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:45:56+00:00 2026-05-23T06:45:56+00:00

I have a Django application which includes a custom model field (and accompanying form

  • 0

I have a Django application which includes a custom model field (and accompanying form field). When I run the project with the built-in development server, it works fine. Loading the server with gunicorn, however, results in the following error:

TemplateSyntaxError at /admin/
Caught TypeError while rendering: Error when calling the metaclass bases
    must be type, not None

I’ve included the whole error below for completeness, which shows the line at fault:

Traceback:
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/contrib/admin/sites.py" in wrapper
  214.                 return self.admin_view(view, cacheable)(*args, **kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  93.                     response = view_func(request, *args, **kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  79.         response = view_func(request, *args, **kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  197.             return view(request, *args, **kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  79.         response = view_func(request, *args, **kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/contrib/admin/sites.py" in index
  382.             context_instance=context_instance
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  188.         return t.render(context_instance)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  123.             return self._render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  127.         return compiled_parent._render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  127.         return compiled_parent._render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  311.             return self.nodelist_true.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  311.             return self.nodelist_true.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  64.             result = block.nodelist.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  437.             url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
  391.             *args, **kwargs)))
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
  312.         possibilities = self.reverse_dict.getlist(lookup_view)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
  229.             self._populate()
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate
  208.                     for name in pattern.reverse_dict:
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
  229.             self._populate()
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate
  208.                     for name in pattern.reverse_dict:
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
  229.             self._populate()
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate
  197.         for pattern in reversed(self.url_patterns):
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _get_url_patterns
  279.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
  274.             self._urlconf_module = import_module(self.urlconf_name)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/home/rob/projects/shipp/shipp/tickets/urls.py" in <module>
  3. from shipp.tickets.views import TicketListView, TicketDetailView, \
File "/home/rob/projects/shipp/shipp/tickets/views.py" in <module>
  15. from shipp.tickets.forms import TicketForm, TicketAttributesForm, \
File "/home/rob/projects/shipp/shipp/tickets/forms.py" in <module>
  26. class TicketTimeSpentForm(forms.ModelForm):
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/forms/models.py" in __new__
  205.                                       opts.exclude, opts.widgets, formfield_callback)
File "/home/rob/.virtualenvs/shipp/lib/python2.7/site-packages/django/forms/models.py" in fields_for_model
  159.             formfield = f.formfield(**kwargs)
File "/home/rob/projects/shipp/shipp/../shipp/tickets/fields.py" in formfield
  43.         return super(TimedeltaField, self).formfield(*args, **defaults)

Exception Type: TemplateSyntaxError at /admin/
Exception Value: Caught TypeError while rendering: Error when calling the metaclass bases
    must be type, not None

As you can see from the traceback, the line causing the issue (line 43 in fields.py) is just a regular super call. Do you have any ideas as to why this error is happening? It occurs in different places also, if I remove the method causing the issue above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:45:56+00:00Added an answer on May 23, 2026 at 6:45 am

    This is due to a bug in Gunicorn when we were trying to reload Django. Its since been reverted and should be fixed on master. We’re currently working on an alternative method to get reloading running for the run_gunicorn command. You can follow the progress of this here:

    https://github.com/benoitc/gunicorn/issues/222

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have worked a bit with Django and I quite like its project/applications model
In a blog application (which I have mostly built following a tutorial), I would
I have a App Engine/Python/Django application which has grown and been modified over the
I have Django application with inline in place: class Account(models.Model): ContractNum = models.PositiveIntegerField(unique=True, blank=True,
I have an existing Django application with a pretty typical model implementation that's backed
We have a Django project which runs on Google App Engine and used db.UserProperty
I have a django application xxx which does a number of things. I also
I have a Django application, myApp. In it, there's a tests.py file which defines
I've deployed a django-application, which basically works fine. The only problem I have is
I have set up a Django application that uses images. I think I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.