|
Hi, I am having problems with syncdb and settings - checked the forum and docs but still haven't been able to figure it out. I was able to set up a django app using the tutorial while using startproject / startapp on the server. I am also able to syncdb with a mysql database set up. So setting up the app and syncdb on the server is not a problem. However, I am having problems when I am trying to syncdb on an application which I uploaded from github (and works on my development machine). After setting up a Django 1.3 / Python 2.6 app ('django3rd'), I uploaded the application ('bookmark') into the django3rd dir: [apechai@web212 django3rd]$ git clone git@github.com:Apechai/bookmarks.git then edited the wsgi to have 'bookmarks.settings' and renamed myproject.wsgi to bookmarks.wsgi: [apechai@web212 django3rd]$ vi myproject.wsgi import os import sys from django.core.handlers.wsgi import WSGIHandler os.environ['DJANGO_SETTINGS_MODULE'] = 'bookmarks.settings' application = WSGIHandler() then edited http conf to point to bookmarks.wsgi: [apechai@web212 conf]$ vi httpd.conf changed the myproject.wsgi to: WSGIScriptAlias / /home/apechai/webapps/django3rd/bookmarks.wsgi then edited settings.py in /django3rd/bookmarks/ to switch from sqlite3 to mysql. When I run syncdb, I get an Import error. (I already set the default Python to 2.6 in .bash_profile): [apechai@web212 bookmarks]$ python manage.py syncdb Traceback (most recent call last): File "manage.py", line 14, in <module> execute_manager(settings) File "/home/apechai/webapps/django3rd/lib/python2.6/django/core/management/init.py", line 438, in execute_manager utility.execute() File "/home/apechai/webapps/django3rd/lib/python2.6/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/apechai/webapps/django3rd/lib/python2.6/django/core/management/init.py", line 261, in fetch_command klass = load_command_class(app_name, subcommand) File "/home/apechai/webapps/django3rd/lib/python2.6/django/core/management/init.py", line 67, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/home/apechai/webapps/django3rd/lib/python2.6/django/utils/importlib.py", line 35, in import_module import(name) File "/home/apechai/webapps/django3rd/lib/python2.6/django/core/management/commands/syncdb.py", line 7, in <module> from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal File "/home/apechai/webapps/django3rd/lib/python2.6/django/core/management/sql.py", line 6, in <module> from django.db import models File "/home/apechai/webapps/django3rd/lib/python2.6/django/db/init.py", line 14, in <module> if not settings.DATABASES: File "/home/apechai/webapps/django3rd/lib/python2.6/django/utils/functional.py", line 276, in getattr self._setup() File "/home/apechai/webapps/django3rd/lib/python2.6/django/conf/init.py", line 42, in _setup self._wrapped = Settings(settings_module) File "/home/apechai/webapps/django3rd/lib/python2.6/django/conf/init.py", line 89, in init raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) ImportError: Could not import settings 'bookmarks.settings' (Is it on sys.path?): No module named settings Any ideas how to fix this? |
|
If you can't syncdb, it's not an issue with Apache at all, it's an issue with an import. Are there any dependencies in the application you're using? Have they all been installed on the live server? |