Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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