How to avoid PEP8 'imported but unused'

A

Adam Jiang

I am new to python. Now, I am woring on an application within Django
framework. When I checked my code with pep8 and pyflakes, some warning
messages show up-'Foobar imported but unused'. Obviously, it indicates
that some modules are imprted to current module but never get
references. However, it seems the message is wrong in this case:

# file: urls.py
urlpattens = patterns(
'',
url('^signup/$', 'signup')
}

# file: register.py
def signup(request):
return ...

# file: views.py
import signup from register

The warning message is shown in file views.py. It seems to me that the
code is okay because Django requires all functions serve as 'view' is
typically go into views.py. 'import' is about get 'signup' function
into module 'views.py'. Or, I am totally wrong? Is there a proper way
to avoid this warnning?

Best regards,
/Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top