diff --git a/modoboa/core/commands/deploy.py b/modoboa/core/commands/deploy.py index 63f857813..733f53365 100644 --- a/modoboa/core/commands/deploy.py +++ b/modoboa/core/commands/deploy.py @@ -96,11 +96,14 @@ class DeployCommand(Command): amavis_conn = t.render(Context(self.ask_db_info('amavis'))) if parsed_args.with_amavis \ else None + allowed_host = raw_input('Under which domain do you want to deploy modoboa? ') + mod = __import__(parsed_args.name, globals(), locals(), ['settings']) tpl = self._render_template("%s/settings.py" % self._templates_dir, { 'default_conn' : default_conn, 'amavis_conn' : amavis_conn, 'secret_key' : mod.settings.SECRET_KEY, - 'name' : parsed_args.name, 'django14' : django14 + 'name' : parsed_args.name, 'django14' : django14, + 'allowed_host': allowed_host }) fp = open("%s/settings.py" % path, "w") fp.write(tpl) diff --git a/modoboa/core/templates/settings.py b/modoboa/core/templates/settings.py index c88afcd21..54a900da9 100644 --- a/modoboa/core/templates/settings.py +++ b/modoboa/core/templates/settings.py @@ -11,6 +11,10 @@ ADMINS = ( # ('Your Name', 'your_email@example.com'), ) +ALLOWED_HOSTS = [ + '{{ allowed_host }}', +] + MANAGERS = ADMINS DATABASES = { {{ default_conn|safe }} diff --git a/tests/install_from_scratch.py b/tests/install_from_scratch.py index cb7247656..9eebc0da5 100644 --- a/tests/install_from_scratch.py +++ b/tests/install_from_scratch.py @@ -52,6 +52,8 @@ class DeployTest(unittest.TestCase): child.sendline(self.dbuser) child.expect("Password:", timeout=timeout) child.sendline(self.dbpassword) + child.expect("Under which domain do you want to deploy modoboa?", timeout=timeout) + child.sendline("localhost") child.wait() fout.close() self.assertEqual(child.exitstatus, 0)