Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Django tutorial
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ed McLaughlin  
View profile  
 More options Apr 9 2012, 8:54 pm
From: Ed McLaughlin <edmclaug...@gmail.com>
Date: Mon, 9 Apr 2012 17:54:43 -0700 (PDT)
Local: Mon, Apr 9 2012 8:54 pm
Subject: Django tutorial
Hello! I am working through the Django tutorial (
https://docs.djangoproject.com/en/1.4/intro/tutorial01/ ) and I have
hit a roadblock in the 'database setup' portion of part 1. When I
enter the command 'python manage.py syncdb' I get the error below. I
believe I properly installed MySQL Community Server and mysqldb....
Any help would be GREATLY appreciated.

Eds-MacBook-Air:mysite edmclaugh76$ python manage.py syncdb
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/core/management/
__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/
__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/
__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Library/Python/2.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 "/Library/Python/2.7/site-packages/django/utils/importlib.py",
line 35, in import_module
    __import__(name)
  File "/Library/Python/2.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 "/Library/Python/2.7/site-packages/django/core/management/
sql.py", line 6, in <module>
    from django.db import models
  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line
40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line
34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line
92, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line
24, in load_backend
    return import_module('.base', backend_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py",
line 35, in import_module
    __import__(name)
  File "/Library/Python/2.7/site-packages/django/db/backends/mysql/
base.py", line 16, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: dlopen(/Library/Python/2.7/site-packages/MySQL_python-1.2.3-
py2.7-macosx-10.7-intel.egg/_mysql.so, 2): Library not loaded:
libmysqlclient.18.dylib
  Referenced from: /Library/Python/2.7/site-packages/
MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.so
  Reason: image not found
Eds-MacBook-Air:mysite edmclaugh76$

Thanks!!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mario Gudelj  
View profile  
 More options Apr 9 2012, 10:16 pm
From: Mario Gudelj <mario.gud...@gmail.com>
Date: Tue, 10 Apr 2012 12:16:38 +1000
Local: Mon, Apr 9 2012 10:16 pm
Subject: Re: Django tutorial

Go to /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-inte l.egg/
on your Mac and see if _mysql.so is int there. You may need to re-install
MySQL_python connector. Maybe this can help
http://www.brambraakman.com/blog/comments/installing_mysql_python_mys...

Otherwise, you can always use SQlite for dev environment until you go to
production. I find it a lot easier to manage.

On 10 April 2012 10:54, Ed McLaughlin <edmclaug...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed McLaughlin  
View profile  
 More options Apr 10 2012, 12:05 am
From: Ed McLaughlin <edmclaug...@gmail.com>
Date: Mon, 9 Apr 2012 21:05:05 -0700 (PDT)
Local: Tues, Apr 10 2012 12:05 am
Subject: Re: Django tutorial
_mysql.so is in there. When I try using sqlite I get this:

Eds-MacBook-Air:mysite3 edmclaugh76$ python manage.py syncdb
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/core/management/
__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/
__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/
base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.7/site-packages/django/core/management/
base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/
base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/Library/Python/2.7/site-packages/django/core/management/
commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/Library/Python/2.7/site-packages/django/db/backends/
__init__.py", line 306, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
base.py", line 281, in _cursor
    self._sqlite_create_connection()
  File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/
base.py", line 271, in _sqlite_create_connection
    self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file

Any ideas? I really appreciate the help!

On Apr 9, 10:16 pm, Mario Gudelj <mario.gud...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ejah  
View profile  
 More options Apr 10 2012, 4:27 am
From: Ejah <ej.huijb...@gmail.com>
Date: Tue, 10 Apr 2012 01:27:32 -0700 (PDT)
Local: Tues, Apr 10 2012 4:27 am
Subject: Re: Django tutorial
Can you post the db part of your settings file?

On 10 apr, 06:05, Ed McLaughlin <edmclaug...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed McLaughlin  
View profile  
 More options Apr 10 2012, 5:15 pm
From: Ed McLaughlin <edmclaug...@gmail.com>
Date: Tue, 10 Apr 2012 14:15:40 -0700 (PDT)
Local: Tues, Apr 10 2012 5:15 pm
Subject: Re: Django tutorial
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '/usr/local/mysql/data/mysite',                      #
Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for
localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for
default. Not used with sqlite3.
    }

}

On Apr 10, 4:27 am, Ejah <ej.huijb...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Roseman  
View profile  
 More options Apr 10 2012, 5:30 pm
From: Daniel Roseman <dan...@roseman.org.uk>
Date: Tue, 10 Apr 2012 14:30:36 -0700 (PDT)
Local: Tues, Apr 10 2012 5:30 pm
Subject: Re: Django tutorial

You haven't given the path to a file in the NAME value, as requested -
you've given the path to a directory.
--
DR.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andrea mucci  
View profile  
 More options Apr 10 2012, 5:32 pm
From: andrea mucci <cingus...@gmail.com>
Date: Tue, 10 Apr 2012 23:32:59 +0200
Local: Tues, Apr 10 2012 5:32 pm
Subject: Re: Django tutorial
hi Ed

you have configured the DB with the sqlite3 driver and you point the NAME db to a mysql folder.
you need to put the folder for your sqlite database.
cheers,
El 10/04/2012, a las 23:15, Ed McLaughlin escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
william ratcliff  
View profile  
 More options Apr 10 2012, 5:34 pm
From: william ratcliff <william.ratcl...@gmail.com>
Date: Tue, 10 Apr 2012 17:34:56 -0400
Local: Tues, Apr 10 2012 5:34 pm
Subject: Re: Django tutorial

Can you try creating a file in that directory at the top of your
settings.py file?
On Apr 10, 2012 5:15 PM, "Ed McLaughlin" <edmclaug...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
william ratcliff  
View profile  
 More options Apr 10 2012, 5:37 pm
From: william ratcliff <william.ratcl...@gmail.com>
Date: Tue, 10 Apr 2012 17:37:11 -0400
Local: Tues, Apr 10 2012 5:37 pm
Subject: Re: Django tutorial

If mysite is a directory, rather than a file, then Daniel is correct.
On Apr 10, 2012 5:33 PM, "andrea mucci" <cingus...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andrea mucci  
View profile  
 More options Apr 10 2012, 5:40 pm
From: andrea mucci <cingus...@gmail.com>
Date: Tue, 10 Apr 2012 23:40:21 +0200
Local: Tues, Apr 10 2012 5:40 pm
Subject: Re: Django tutorial

a good solution could be:

SITE_ROOT = os.path.realpath(os.path.dirname(__file__))

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': os.path.join(SITE_ROOT,'sqlite.db'),                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }

}

El 10/04/2012, a las 23:34, william ratcliff escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »