0

After I added the method post_detail in the file '~/blog/views.py' im getting the error Class 'Post' has no 'objects' member but before doing this the code was working so well.

I read a lot of stuff about Models on Django website but i cant find the error.

The django server is working fine, 0 errors.

I really cant understand why this error and why my application dont work

Tâmer Cuba
  • 2,373
  • 2
  • 11
  • 26

1 Answers1

0

Install pylint-django using pip as follows

pip install pylint-django

Then in VS Code follow these steps Step 1: press CTR+SHIFT+P Step 2:type in 'configure language specific settings' and select it Step 3: type in 'python' and select it Step 4: replace the content of you found there with the following snippet

{
"python.linting.pylintArgs": [
    "--load-plugins=pylint_django"
],

"[python]": {

},

}

That's it!

quba
  • 123
  • 9
  • 1
    Hi. The comments already pointed to an answer. Please do not copy the complete text of external sources; instead, use their words and ideas to support your own. [See How do I write a good answer?](https://stackoverflow.com/help/how-to-answer) – MendelG Aug 24 '20 at 00:20