Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 June 12, 2010 06:09:43

Jagdeep S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

error : python manage.py shell


i am using Django Version: 1.2.1
I follow this Tutorialhttp://docs.djangoproject.com/en/1.2/intro/tutorial01/and
Edit the polls/models.py file so it looks like this:

class Poll(models.Model):
# ...
def __unicode__(self):
return self.question

class Choice(models.Model):
# ...
def __unicode__(self):
return self.choice


After doing that i run this command :

python manage.py shell

this error is come
Validating models...
Unhandled exception in thread started by <function inner_run at
0x9c574fc>
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
commands/runserver.py", line 48, in inner_run
self.validate(display_num_errors=True)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 245, in validate
num_errors = get_validation_errors(s, app)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
validation.py", line 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
loading.py", line 146, in get_app_errors
self._populate()
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
loading.py", line 61, in _populate
self.load_app(app_name, True)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
importlib.py", line 35, in import_module
__import__(name)
File "/home/jagdeep/mysite/../mysite/polls/models.py", line 19
def __unicode__(self):
^
IndentationError: unindent does not match any outer indentation level

please help....

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 12, 2010 07:27:50

Dmitry D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

error : python manage.py shell


Hi!

Jagdeep Singh Malhi wrote:
> IndentationError: unindent does not match any outer indentation level

You need to learn Python :) Indentation matters in Python. If previous
lines of your file use spaces and this line uses tabs, you'll get a wrong
indentation error.

--
Dmitry Dulepov
Twitter:http://twitter.com/dmitryd/Web:http://dmitry-dulepov.com/--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 12, 2010 07:29:03

Sam L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

error : python manage.py shell


Check your indentation of that particular line, and all of the lines
above. In Python, indentation matters, and it all needs to line up
accordingly.

We can't really help anymore without you showing us more code, which
is difficult due to the way email messes with leading spaces. You can
try posting the code here (http://pastebin.org/) then posting the link
back on this list so we can take a look.

On 12 June 2010 15:09, Jagdeep Singh Malhi <singh.malh...@gmail.com> wrote:
> i am using  Django Version: 1.2.1
> I follow this Tutorialhttp://docs.djangoproject.com/en/1.2/intro/tutorial01/> and
> Edit the polls/models.py  file so it looks like this:
>
> class Poll(models.Model):
>    # ...
>    def __unicode__(self):
>        return self.question
>
> class Choice(models.Model):
>    # ...
>    def __unicode__(self):
>        return self.choice
>
>
> After doing that  i run this command :
>
> python manage.py shell
>
> this error is come
> Validating models...
> Unhandled exception in thread started by <function inner_run at
> 0x9c574fc>
> Traceback (most recent call last):
>  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> commands/runserver.py", line 48, in inner_run
>    self.validate(display_num_errors=True)
>  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> base.py", line 245, in validate
>    num_errors = get_validation_errors(s, app)
>  File "/usr/local/lib/python2.6/dist-packages/django/core/management/
> validation.py", line 28, in get_validation_errors
>    for (app_name, error) in get_app_errors().items():
>  File "/usr/local/lib/python2.6/dist-packages/django/db/models/
> loading.py", line 146, in get_app_errors
>    self._populate()
>  File "/usr/local/lib/python2.6/dist-packages/django/db/models/
> loading.py", line 61, in _populate
>    self.load_app(app_name, True)
>  File "/usr/local/lib/python2.6/dist-packages/django/db/models/
> loading.py", line 78, in load_app
>    models = import_module('.models', app_name)
>  File "/usr/local/lib/python2.6/dist-packages/django/utils/
> importlib.py", line 35, in import_module
>    __import__(name)
>  File "/home/jagdeep/mysite/../mysite/polls/models.py", line 19
>    def __unicode__(self):
>                         ^
> IndentationError: unindent does not match any outer indentation level
>
> please  help....
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 June 12, 2010 09:00:08

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

error : python manage.py shell


On Saturday 12 June 2010 10:39:36 Jagdeep Singh Malhi wrote:
> IndentationError: unindent does not match any outer indentation level
>

no one help you in this unless you are willing to do some homework - most IDEs
have a button to press to compile the code - mine uses f8. Press that key and
it will show the indentation error - indentation is part of python syntax. You
should not waste the time of this list by bringing up basic python errors here
- if necessary please take a short course in python.
--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 June 12, 2010 09:16:57

Alexander J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

error : python manage.py shell


I think like Kenneth... django is the same python but additional library. No
python - no django
My recommendation Python Essential Reference 4th edition

On Sat, Jun 12, 2010 at 11:01 AM, Kenneth Gonsalves <law...@au-kbc.org>wrote:

> On Saturday 12 June 2010 10:39:36 Jagdeep Singh Malhi wrote:
> > IndentationError: unindent does not match any outer indentation level
> >
>
> no one help you in this unless you are willing to do some homework - most
> IDEs
> have a button to press to compile the code - mine uses f8. Press that key
> and
> it will show the indentation error - indentation is part of python syntax.
> You
> should not waste the time of this list by bringing up basic python errors
> here
> - if necessary please take a short course in python.
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#6 June 12, 2010 17:09:18

Jagdeep S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

error : python manage.py shell


thanks very much Django users........its work

On Jun 12, 1:16 pm, Alexander Jeliuc <jeliucalexa...@gmail.com> wrote:
> I think like Kenneth... django is the same python but additional library. No
> python - no django
> My recommendation Python Essential Reference 4th edition
>
> On Sat, Jun 12, 2010 at 11:01 AM, Kenneth Gonsalves
> <law...@au-kbc.org>wrote:> On Saturday 12 June 2010 10:39:36 Jagdeep Singh
> Malhi wrote:
> > > IndentationError: unindent does not match any outer indentation level
>
> > no one help you in this unless you are willing to do some homework - most
> > IDEs
> > have a button to press to compile the code - mine uses f8. Press that key
> > and
> > it will show the indentation error - indentation is part of python syntax.
> > You
> > should not waste the time of this list by bringing up basic python errors
> > here
> > - if necessary please take a short course in python.
> > --
> > Regards
> > Kenneth Gonsalves
> > Senior Associate
> > NRC-FOSS at AU-KBC
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 20th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support