On Thursday, 17 October 2013 21:05:17 UTC+1, michael....@farecompare.com 
wrote:

> Hi, 
>
> I'm trying to learn Django and Python at the same time. So I realize this 
> is a really simple issue for a beginner. But since I'm new to this, I could 
> use a little help. 
>
> Basically, I'm going through the tutorial here: 
>
> https://docs.djangoproject.com/en/1.5/intro/tutorial01/
>
> I have gone through it up to the point where we create the polls app with 
> the command: 
>
> python manage.py startapp polls
>
>
> I then created the models in polls/models.py by cutting and pasting from 
> the article. 
>
> Finally, to activate the new model, I went back to my settings.py file and 
> added "polls" to my list of installed apps. However, when I run the 
> command: 
>
> python manage.py sql polls
>
>
> I get the following error: 
>
> Michael$ python manage.py sql polls
> Traceback (most recent call last):
>   File "manage.py", line 10, in <module>
>     execute_from_command_line(sys.argv)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 453, in execute_from_command_line
>     utility.execute()
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 392, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 263, in fetch_command
>     app_name = get_commands()[subcommand]
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 109, in get_commands
>     apps = settings.INSTALLED_APPS
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
>  
> line 53, in __getattr__
>     self._setup(name)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
>  
> line 48, in _setup
>     self._wrapped = Settings(settings_module)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
>  
> line 132, in __init__
>     mod = importlib.import_module(self.SETTINGS_MODULE)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
>  
> line 35, in import_module
>     __import__(name)
>   File 
> "/Users/Michael/dev/projects/python/ape_admin/ape_admin/settings.py", line 
> 127, in <module>
>     polls,
> NameError: name 'polls' is not defined
>
> I have a folder called "polls" that is in the same directory as my 
> manage.py file. Can someone tell me what I'm doing wrong? Is there a step 
> I'm missing that's not in the tutorial that a Python developer would just 
> know automatically? 
>
> Thanks,
>
> Michael
>
>
Sounds like you've put a line with just
   polls
in your INSTALLED_APPS, instead of
   "polls"
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5c2d606c-5491-4af2-b1bb-09711c04348e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to