tutorial part 1...syncing db

37 views
Skip to first unread message

Brandy

unread,
Apr 12, 2012, 5:09:42 PM4/12/12
to django...@googlegroups.com
I am working (again) through the tutorial part 1. I have made changes to Engine and Name as specified in the instructions. However, running "python manage.py syncdb" continues to return "Please supply the ENGINE value." I did not encounter this problem the first time I worked through this tutorial.
 
# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'c:/program files/bitnami djangostack/mysite/sqlite3.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.
    }
}

victoria

unread,
Apr 12, 2012, 5:32:21 PM4/12/12
to django...@googlegroups.com

Your settings seem correct. Which version of django are you using?
Have you checked that the settings.py file is in the correct location
for your django version?

Django 1.4 expects this layout:

mysite/
manage.py
mysite/
__init__.py
settings.py
urls.py
wsgi.py

While Django 1.3 expects this:

mysite/
__init__.py
manage.py
settings.py
urls.py


Since 1.4 was released this seems one of the most common mistakes that
could cause this error.

> --
> 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/-/qnfmdfEObKAJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

Brandy

unread,
Apr 12, 2012, 6:38:37 PM4/12/12
to django...@googlegroups.com
I am in version 1.4. I feel like this is what is happening: I open the file to edit it in either Emacs or BlueFish. The file seems to save properly (I have verified that the files are being saved to the correct directory), but those changes don't seem to be reflected in the files when I access them through Django. It is very strange, because when I open the files in an editor, they appear to be correct. But django is not picking up on the changes for some reason.

> django-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

> django-users+unsubscribe@googlegroups.com.

Leonid Toshchev

unread,
Apr 12, 2012, 6:33:13 PM4/12/12
to django...@googlegroups.com
Hello.
Try to escape spaces. I don`t check how django work when path have
spaces inside, but i meet same problems in my practice.

p.s. sorry for my bad english.

12 апреля 2012 г. 21:32 пользователь victoria <ka...@bitnami.org> написал:

william ratcliff

unread,
Apr 12, 2012, 7:00:24 PM4/12/12
to django...@googlegroups.com
Can you post your full code somewhere as a zip?

Brandy

unread,
Apr 12, 2012, 7:37:05 PM4/12/12
to django...@googlegroups.com
This is the whole directory.

>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
mysite.zip

william ratcliff

unread,
Apr 12, 2012, 8:13:58 PM4/12/12
to django...@googlegroups.com
Hi Brandy,

I downloaded your project modified the beginning to the following:

# Django settings for mysite project.

import os,sys
HOMEDIR=os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': os.path.join(HOMEDIR,'testdb'),                      # 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.
    }
}

It works under the django 1.4 that I just pulled onto a "virgin" windows 7 box.     My suspicion is that in your engine file, you wanted to use:
r'c:/program files/bitnami djangostack/mysite/sqlite3.db'
instead of:
'c:/program files/bitnami djangostack/mysite/sqlite3.db',

This is assuming that you have read/write permissions to that directory, etc.    I prefer the pattern that I used of putting the sqllite database relative to __file__ because it is easier to move it between machines.   So, for example, if I develop on a mac (or windows), when I deploy to linux (not so much for the database) for production, I don't have to manipulate the path throughout the code...Later, if I need to find something relative to the project root, I can then do a:

from django.conf import settings
and grab settings.HOME as the base directory

Best,
William
(btw. I placed the directory in c:\mysite for my test

so you have:
-- denotes a mysite directory


c:\mysite
    manage.py
    --mysite
          __init__.py
          settings.py
          testdb
          urls.py
          wsgi.py
   

)



2012/4/12 Brandy <brandy....@yahoo.com>
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/YNcdzM_WZJcJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Brandy

unread,
Apr 12, 2012, 11:22:14 PM4/12/12
to django...@googlegroups.com
FINALLY! I used your modifications and adjusted the security settings of the directory (twice). And now it works. Thank you everyone for taking the time to look at my code!
 
Brandy


2012/4/12 Brandy <brandy....@yahoo.com>
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages