GithubHelp home page GithubHelp logo

Comments (5)

felixxm avatar felixxm commented on June 2, 2024

Can you attach a full traceback?

from django-request.

billyquith avatar billyquith commented on June 2, 2024

Can you attach a full traceback?

Thanks for the reply. After trying to work around this several different ways I switched to the "legacy" VS2019 Python debugger and the problem appears to disappear. I don't know what the difference is between the debuggers but the newer one appears to do something that causes the initialisation/construction of Python to go wrong.

The first issue is in settings:

Message='SERVER_NAME'
  Source=C:\Tools\Web\myweb\mywebApp\apps\request\settings.py
  StackTrace:
  File "C:\Tools\Web\myweb\mywebApp\apps\request\settings.py", line 40, in <module> (Current frame)
    BASE_URL = getattr(settings, 'REQUEST_BASE_URL', 'http://{0}'.format(get_current_site(HttpRequest()).domain))
  File "C:\Tools\Web\myweb\mywebApp\apps\request\models.py", line 9, in <module>
    from . import settings as request_settings
  File "C:\Tools\Web\myweb\mywebApp\manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)

If I skip that I get:

Message='super' object has no attribute '__getattr__'
  Source=C:\Tools\Web\myweb\mywebApp\apps\request\managers.py
  StackTrace:
  File "C:\Tools\Web\myweb\mywebApp\apps\request\managers.py", line 106, in __getattr__ (Current frame)
    super().__getattr__(*args, **kwargs)
  File "C:\Tools\Web\myweb\mywebApp\apps\request\models.py", line 16, in <module>
    class Request(models.Model):
  File "C:\Tools\Web\myweb\mywebApp\manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)

from django-request.

billyquith avatar billyquith commented on June 2, 2024

It would be nice to use the newer debugger as it appears to be a lot faster.

Docs:

Visual Studio 2017 versions 15.8 and later use a debugger based on ptvsd version 4.1+. Visual Studio 2019 versions 16.5 and later use a debugger based on debugpy. These versions of the debugger are compatible with Python 2.7 and Python 3.5+.

from django-request.

billyquith avatar billyquith commented on June 2, 2024

I guess this is a bug with debugpy. Not 100% sure though.

from django-request.

billyquith avatar billyquith commented on June 2, 2024

I upgraded debugpy to 1.6.0 from 1.2.0 and still get issues. I can runserver from the command-line without issues, but in VS2019 I get, as before:

Message='super' object has no attribute '__getattr__'
  Source=C:\Tools\Web\MyWeb\MyWebApp\apps\request\managers.py
  StackTrace:
  File "C:\Tools\Web\MyWeb\MyWebApp\apps\request\managers.py", line 106, in __getattr__ (Current frame)
    super().__getattr__(*args, **kwargs)
  File "C:\Tools\Web\MyWeb\MyWebApp\apps\request\models.py", line 16, in <module>
    class Request(models.Model):
  File "C:\Tools\Web\MyWeb\MyWebApp\manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)

Not getting the SERVER_NAME issue now though.

from django-request.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.