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 Model Administration Django's Admin

Oskar Techi
Oskar Techi
7,407 Points

RuntimeError when saving a new course through admin panel

I'm having problems moving on with that error:


Request Method: POST

Request URL: http://127.0.0.1:8000/admin/courses/course/add/

Django Version: 1.8

Exception Type: RuntimeError

Exception Value: generator raised StopIteration

Exception Location: /Users/oskar/.virtualenvs/th_django_basics/lib/python3.7/site-packages/django/http/multipartparser.py in read, line 337

Python Executable: /Users/oskar/.virtualenvs/th_django_basics/bin/python3


Where should look to solve my problem?

2 Answers

Oskar Techi
Oskar Techi
7,407 Points

I managed to solve this problem myself.

I think everyone following along with workspaces should be fine..

Since I'm following along this course in my local machine I had a difference in my Python module version.

I was running Python 3.7 and Django 1.8 and was getting this error. I changed my settings to Python 3.4.1 (like Kenneth has in this course), Django stayed the same, and everything worked fine with the same exact code!

This course would need a retouch asap! Hope this helps anyone struggling with same problem.

Moses Williams III
Moses Williams III
28,802 Points

Where did you change the python version?

Oskar Techi
Oskar Techi
7,407 Points

I used virtual environments to set up the versions I needed.

To use the python version I needed, i used 'pyenv'. Link: https://github.com/pyenv/pyenv

Here's a bit of a tutorial how to set it all up on macOS: https://medium.com/python-every-day/python-development-on-macos-with-pyenv-virtualenv-ec583b92934c