Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics What a View! Running the Server

Error Running Django In Workspaces

Hi all!

I'm trying to follow along with the 'Django Basics' course but keep getting this error when I try to start the server:

treehouse:~/workspace/learning_site$ python manage.py runserver 0.0.0.0:8000

RuntimeError: __class__ not set defining 'AbstractBaseUser' as <class 'django.contrib.auth.base_user.Abstra
ctBaseUser'>. Was __classcell__ propagated to type.__new__?  

Anyone familiar with this error or how to get around it?

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

The issue is with workspaces. Current workspaces seem to be using Django 1.9.9 with Python 3.9. This combination does not work with this course material.

As written, this course refers to Django 1.8 with Python 3.8. This question has been flagged as feedback to developers.

Developers: error can be recreated by:

  • launching a new workspace from the video
  • cd learning_site
  • $ python manage.py runserver
Chris Freeman
Chris Freeman
Treehouse Moderator 68,423 Points

A workaround is to create a virtualenv based on python 3.8, then do python3 -m pip install django==1.8