Hi,
I am trying to develop an sample project in Django and getting errors when
i run syncdb command.
This is how my project structure looks like:
/Users/Sreek/django_demo/godjango/bookings:
manage.py
registration/
forms.py
views.py
models.py
urls.py
bookings/
settings.py
urls.py
And my manage.py file looks like below :
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookings.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
And my PYTHONPATH and DJANGO_SETTINGS_MODULE are set as below
$echo $DJANGO_SETTINGS_MODULE
bookings.settings
$ echo $PYTHONPATH
/Users/Sreek/django_demo/godjango/bookings
And my WSGI.py file looks like below:
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookings.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
But when i run the python manage.py syncdb command, i am getting the
following error.
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/core/management/__init__.py",
line 443, in execute_from_command_line
utility.execute()
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/core/management/__init__.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/core/management/__init__.py",
line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/core/management/__init__.py",
line 69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
line 8, in <module>
from django.core.management.sql import custom_sql_for_model,
emit_post_sync_signal
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/core/management/sql.py",
line 6, in <module>
from django.db import models
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/db/__init__.py",
line 11, in <module>
if DEFAULT_DB_ALIAS not in settings.DATABASES:
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/utils/functional.py",
line 184, in inner
self._setup()
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/conf/__init__.py",
line 42, in _setup
self._wrapped = Settings(settings_module)
File
"/Users/Sreekanth/django_demo/godjango/lib/python2.7/site-packages/django/conf/__init__.py",
line 95, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?):
%s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'bookings.settings' (Is it on
sys.path?): No module named unipath
Could someone suggest what i am missing? Thanks in Advance.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/evZ8yLHpyrAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.