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.
I have gone through it up to the point where we create the polls app with the command:
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:
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?