django settings error (DB Engine) when I moved all of my apps to "apps" directory (SOLVED) -
i changed traditional django layout, , decided put of apps apps
directory.
the initial layout :
project/ apps/ myapp/ __init__.py tests/ __init__.py setting.py urls.py wsgi.py manage.py
within settings.py
set normal engine , name :
import os project_path = os.path.dirname(os.path.abspath(__file__)) 'engine': 'django.db.backends.sqlite3', 'name': os.path.join(project_path, 'dev.db'),
and within installed_apps
, i've tried both project.apps.myapp
, apps.myapp
, no success.
here engine error :
settings.databases improperly configured. please supply engine value. check settings documentation more details.
there should problem new layout ... i've seen solutions, none of them supposed such django layout ...
any idea ?
p.s. can see , i'm using django 1.4+ layout
update : ok .. solved it.
for record 1 : if decide change default layout, careful settings.py
. added settings
directory, beside of settings.py
, main source of problem .. still don't know how handle such settings. say, if i'd have different settings production, development , testing machines ..
for record 2 : found daniel greenfeld's settings layout useful(@pydanny). here link github (derived form 'two scoops of django' book)
this answer followup - how have different settings production, development , testing:
check out how it's done in django skeleton project:
http://amccloud.com/post/14689947527/django-1-4-custom-project-template
even though it's django 1.4 it's still useful (only missing allowed_hosts setting django 1.5)
it has settings.py , local_settings.py (local_settings.py should different on each machine)
Comments
Post a Comment