If test is another application,
from .other import sample
does not work.
Update:
You can use relative imports only when importing from the same application.
Inside test application
from .other import sample
will work. But you still need the full form
from cones.foo import bar
if you import the method defined in foo from the test application.
Thus, answering your question, the second way is the right way.
Antony hatchkins
source share