HelloWebApp - Registration & Thing Creation Error - SOLVED


#1

Thank You . I figured out the mistake… and I correct it. Now the problem is solved

Thank you

I am following line by line the Book and on the Regostration Chapter & Thing Creation upon User’s Registration I click on submit to create the Thing (Name & Description) & I get this error bellow! I would much apprecaited your assistance

Find Here My GitHub Repository with my so far code. The Error comes when I just click on submit. The bizzare thing is that the user & its associated Thing are both created and can be edited again and again afterward if I just write my localhost url.

=================================
NameError at /accounts/create_thing/
global name ‘name’ is not defined

  Request Method:
  POST


  Request URL:
  http://localhost:8000/accounts/create_thing/



  Django Version:
  1.7.8



  Exception Type:
  NameError




  Exception Value:
  global name 'name' is not defined




  Exception Location:
  /home/anapan/Documents/projects/hellowebapp/hellowebapp/collection/views.py in create_thing, line 51



  Python Executable:
  /home/anapan/Documents/projects/hellowebapp/env/bin/python


  Python Version:
  2.7.8


  Python Path:
  ['/home/anapan/Documents/projects/hellowebapp/hellowebapp',

‘/home/anapan/Documents/projects/hellowebapp/env/lib64/python27.zip’,
’/home/anapan/Documents/projects/hellowebapp/env/lib64/python2.7’,
’/home/anapan/Documents/projects/hellowebapp/env/lib64/python2.7/plat-linux2’,
’/home/anapan/Documents/projects/hellowebapp/env/lib64/python2.7/lib-tk’,
’/home/anapan/Documents/projects/hellowebapp/env/lib64/python2.7/lib-old’,
’/home/anapan/Documents/projects/hellowebapp/env/lib64/python2.7/lib-dynload’,
’/usr/lib64/python2.7’,
’/usr/lib/python2.7’,
’/usr/lib64/python2.7/lib-tk’,
’/home/anapan/Documents/projects/hellowebapp/env/lib/python2.7/site-packages’]

  Server time:
  Sun, 28 Jun 2015 18:58:33 +0000

#2

Awesome, thanks for letting me know it was solved. :) How did you solve it?


#3

Hi !!
I just changed this: slug = slugify ( name )
Into this: slug = slugify ( thing.name )

And then it worked smoothly with no errors

:-)

Thank you again… Your book is wonderful


#4

Thanks for replying! <3


#5

Yeah! Thanks mate… this solution helped me also :))