8 Replies - 849 Views - Last Post: 23 December 2010 - 03:05 AM Rate Topic: -----

#1 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

synching the DB with django

Posted 20 December 2010 - 08:35 PM

First off, i'm following a book on django development.

I made a DB in mysql called "iFriendsDB", created a user called "dAdmin" with the pass "test", and gave it all permissions. I input all the info into the settings.py file, and saved. Then i went to my project directory and called manage.py syncdb, and it gave my bunch of errors that are too many to read and copy down here. How can i resolve this?

Is This A Good Question/Topic? 0
  • +

Replies To: synching the DB with django

#2 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: synching the DB with django

Posted 20 December 2010 - 09:10 PM

How do you expect us to help you without knowing what the errors are?
Was This Post Helpful? 0
  • +
  • -

#3 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: synching the DB with django

Posted 21 December 2010 - 07:31 PM

this is all the errors:
http://img.ly/2Fsj
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6110
  • View blog
  • Posts: 23,670
  • Joined: 23-August 08

Re: synching the DB with django

Posted 22 December 2010 - 06:19 AM

Don't post screenshots of errors...copy and paste them into your post.
Was This Post Helpful? 0
  • +
  • -

#5 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: synching the DB with django

Posted 22 December 2010 - 07:36 AM

I'm with JackOfAllTrades. To solve an error, we might need to research it. If you don't know how to get terminal output, just do something like this in the terminal:

manage.py syncdb > output.txt

and it'll send the output to a text file which you can then copy and paste.

This post has been edited by atraub: 22 December 2010 - 07:51 AM

Was This Post Helpful? 0
  • +
  • -

#6 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: synching the DB with django

Posted 22 December 2010 - 05:47 PM

i did what atraub said, and it won't make the .txt file. It just continues to show the errors.
Was This Post Helpful? 0
  • +
  • -

#7 Seta00  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 14
  • View blog
  • Posts: 84
  • Joined: 22-September 10

Re: synching the DB with django

Posted 22 December 2010 - 06:39 PM

You set the info on settings.py and syncdb will create/populate the tables for you, you don't need to do anything directly on the database.

Just saw the error, the problem is that you didn't add the proper module for MySQL on your settings.py file. Post the full contents of that file.

This post has been edited by Seta00: 22 December 2010 - 06:42 PM

Was This Post Helpful? 0
  • +
  • -

#8 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: synching the DB with django

Posted 22 December 2010 - 06:52 PM

View PostSeta00, on 22 December 2010 - 05:39 PM, said:

You set the info on settings.py and syncdb will create/populate the tables for you, you don't need to do anything directly on the database.

Just saw the error, the problem is that you didn't add the proper module for MySQL on your settings.py file. Post the full contents of that file.


settings.py

# Django settings for iFriends project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'iFriendsDB',                      # Or path to database file if using sqlite3.
        'USER': 'dAdmin',                      # Not used with sqlite3.
        'PASSWORD': 'test',                  # 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.
    }
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''

# URL prefix for admin media -- CSS, Javascript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'hgh!u4=8^m$7zm^l4slwa$7tt)ehi^3v@8dqi%#-n9iq%7f^$%'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'iFriends.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)


Was This Post Helpful? 0
  • +
  • -

#9 Seta00  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 14
  • View blog
  • Posts: 84
  • Joined: 22-September 10

Re: synching the DB with django

Posted 23 December 2010 - 03:05 AM

Do you have this?

Or, if you have apt-get, apt-get install python-mysqldb

This post has been edited by Seta00: 23 December 2010 - 03:05 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1