howto setup wsgi.py for dev and prod for django and apache -
what common way use production / dev setup on apache?
i have followings:
myproject | |── __init__.py ├── __init__.pyc ├── settings │ ├── base.py │ └── production.py | |__ dev.py ├── urls.py ├── urls.pyc ├── wsgi.py └── wsgi.pyc
in wsgi.py file:
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if path not in sys.path: sys.path.append(path) os.environ.setdefault("django_settings_module", "myproject.settings.production") django.core.wsgi import get_wsgi_application application = get_wsgi_application()
this not work, when move production.py 1 level , change setdefault "myproject.production" working fine, want keep settings in separated folder. other way this?
you need empty __init__.py
file in settings directory.
Comments
Post a Comment