>> If we were inspecting this code, we wouldn't know whether or not
>> get_cat() comes from CatApp A or B, which makes troubleshooting more
>> difficult, especially if both apps (or modules) define a get_cat()
>> function. It would be much better to say:
>>
>> from CatAppA import get_cat
>> from Ca
On 06/19/2015 11:41 PM, James Schneider wrote:
> This is strictly a Python question, nothing Django-specific, but I've
> found this site to be helpful in explaining the different ways to import
> things:
>
> http://effbot.org/zone/import-confusion.htm
This is good as far as it goes, but it is a
Hi,
On 06/19/2015 08:32 PM, Peith Vergil wrote:
> It depends on how your project files are structured. If you have a file
> structure that looks like this:
>
> app/
> __init__.py
> models.py
> views.py
> urls.py
>
> Then, you can simply use relative imports.
>
> In views.py:
> f
Thank you for the very detailed explanations everyone!
On Saturday, June 20, 2015 at 3:11:34 AM UTC+2, jorr...@gmail.com wrote:
>
> This is mostly a cosmetic question, and I could be completely wrong
> because I'm fairly new to Django, or it could be that there is a perfectly
> logical explanat
This is strictly a Python question, nothing Django-specific, but I've found
this site to be helpful in explaining the different ways to import things:
http://effbot.org/zone/import-confusion.htm
In general, using 'from blah import *' is frowned upon except in very
specific cases. While it is easi
It depends on how your project files are structured. If you have a file
structure that looks like this:
app/
__init__.py
models.py
views.py
urls.py
Then, you can simply use relative imports.
In views.py:
from models import *
In urls.py:
from views import *
If, for example, your
On 20/06/2015 11:01 AM, jorrit...@gmail.com wrote:
This is mostly a cosmetic question, and I could be completely wrong
because I'm fairly new to Django, or it could be that there is a
perfectly logical explanation for this, but here goes:
It seems the code required to import views in urls.py and
This is mostly a cosmetic question, and I could be completely wrong because
I'm fairly new to Django, or it could be that there is a perfectly logical
explanation for this, but here goes:
It seems the code required to import views in urls.py and models in
views.py is inconsistent (and in the ca
8 matches
Mail list logo