Exemplo n.º 1
0
Arquivo: dev.py Projeto: ochan1/quark
    def handle(self, *args, **kwargs):
        if len(args) != 0:
            # Don't need any args
            raise CommandError('Usage: python manage.py dev')

        if os.environ.get('RUN_MAIN', False) == 'true':
            # Only run update_db if this is not a thread spawned by
            # restart_with_reloader. This prevents update_db from happening
            # more than once when the management command is run. See
            # https://code.djangoproject.com/ticket/8085#comment:13
            print 'Running development server'
            dev_utils.update_db()

        dev = DevServer(username=getpass.getuser())
        dev.run_server()
Exemplo n.º 2
0
 def test_ip_localhost(self):
     local_server = DevServer(username='******', localhost=True)
     self.assertEqual(local_server.ip, 'localhost')
Exemplo n.º 3
0
 def setUp(self):
     self.server = DevServer()