Monday, March 5, 2018

Django don't start full

Django 1.11 project which I start with
(spd_auftritt) egon@Epsil173 ~/Entw/spd_auftritt/spd_auftritt $ python manage. runserver --settings=spd.settings.dev
and nothing happens. I cancel with CTRL-C. I added some test instructions (prints) in django/core/management/__init__.py:
    def execute(self):
        """
        Given the command-line arguments, this figures out which subcommand is
        being run, creates a parser appropriate to that command, and runs it.
        """

        import sys
        sys.stdout = open('~/django.log3', 'a')
        sys.stderr = sys.stdout
        print(289,291,self.argv)

        try:
            subcommand = self.argv[1]
        except IndexError:
            subcommand = 'help'  # Display help if no arguments were given.
        print(298,subcommand)
        # Preprocess options to extract --settings and --pythonpath.
        # These options could affect the commands that are available, so they
        # must be processed early.
        parser = CommandParser(None, usage="%(prog)s subcommand [options] [args]", add_help=False)
        parser.add_argument('--settings')
        parser.add_argument('--pythonpath')
        parser.add_argument('args', nargs='*')  # catch-all
        try:
            options, args = parser.parse_known_args(self.argv[2:])
            print(308,options,args)
            handle_default_options(options)
        except CommandError:
            pass  # Ignore any option errors at this point.
        print(311, options, args)
        #print(313, settings)
        print(314, settings.INSTALLED_APPS)
        print(315)


The log shows:
289 291 ['manage.py', 'runserver', '--settings=spd.settings.dev']
298 runserver
308 Namespace(args=[], pythonpath=None, settings='spd.settings.dev') []
311 Namespace(args=[], pythonpath=None, settings='spd.settings.dev') []
289 291 ['manage.py', 'runserver', '--settings=spd.settings.dev']
298 runserver
308 Namespace(args=[], pythonpath=None, settings='spd.settings.dev') []
311 Namespace(args=[], pythonpath=None, settings='spd.settings.dev') []

 
After the print in line 311 the prints in line 314 and line 315 are not shown but the print lines 289 - 311  second time.

Any idea

Egon

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1e13fe0f-8828-4af0-8ca2-9b4ef2ccbb1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment