Nick Dong
Nick Dong

Reputation: 3736

manage.py and other.py files is not in same level file

I have Django 1.4 and Python 2.6.6 When I use "django-amdin.py startproject djproject" follow the steps in webpage https://www.ibm.com/developerworks/cn/linux/l-django/#resources And I get files as follows:

djproject/
|-- djproject
|   |-- __init__.py
|   |-- settings.py
|   |-- urls.py
|   `-- wsgi.py
`-- manage.py

Note: manage.py and other.py files is not in same level folder, Why?

++++++

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

When I configure 'ENGINE' as 'sqlite3' instead of 'django.db.backends.sqlite3', I got the error:

django.core.exceptions.ImproperlyConfigured: 'sqlite3' isn't an available database backend.  
Try using django.db.backends.sqlite3 instead.  
Error was: No module named base     

Is that also a new character of 1.4?

Upvotes: 1

Views: 248

Answers (2)

mega.venik
mega.venik

Reputation: 657

Project directory structure changed in Django 1.4

More detailes here - http://www.tdd-django-tutorial.com/blog/articles/2012/tutorials-updated-django-14-and-its-weird-new-fold/

Upvotes: 1

Simeon Visser
Simeon Visser

Reputation: 122376

This was changed in Django 1.4:

Django 1.4 ships with an updated default project layout and manage.py file for the startproject management command. These fix some issues with the previous manage.py handling of Python import paths that caused double imports, trouble moving from development to deployment, and other difficult-to-debug path issues.

Upvotes: 3

Related Questions