0

utils/frontend/urls.py

from utils.frontend import views
#more stuff
views.FrontEndTestingStart.as_view()

utils/frontend/views.py

class FrontEndTestingStart(APIView):

python reports

AttributeError: 'NoneType' object has no attribute 'FrontEndTestingStart'

As if views.py would return None when importing. Why is that? I have a __init__.py in the directory

transient_loop
  • 5,984
  • 15
  • 58
  • 117
  • It could be that something in `more stuff` is shadowing/masking views. What other code is there? Also, your error message looks wrong as it says it is looking for a `Frontendesting...` – 2ps Oct 02 '16 at 02:33

2 Answers2

0

The object instance in FrontEndTestingStart is returning None. Hence the issue. For further clarification see these answers - https://stackoverflow.com/a/8949265/5911972 and https://stackoverflow.com/a/8949272/5911972

Community
  • 1
  • 1
rohit keshav
  • 305
  • 2
  • 16
0

Here's what got my problem fixed - but I don't know why. Thanks to @2ps and @rohittk239, of cournse they are both right, but I couldn't find out WHAT exactly was causing that behaviour. Thanks both for trying to help.

I am trying to help a client run a software they bought. It's built on django 1.6.2 (yes I know it's dinosaur).

It had been configured on a long list of dependencies in requirements.txt. Most of them were fixed at a specific version with ==, but some were not, and were on >=. When I then ran pip install -r requirements, this of course would install newer versions than the ones specified everywhere where there was a >= dependency.

Fixing the requirements.txt for all dependencies to == fixed the problem. Looks like some dependency in a later version would create a conflict.

transient_loop
  • 5,984
  • 15
  • 58
  • 117