Thursday, February 16, 2012

Re: import problem

DrBloodmoney I not sure what you mean by circular imports. datetime
is the only import I have in this file.

Yes Furbeenator it is a 'datetime' is not defined error.

I'll post the entire error message tonight when I get home.

My website directory is mn and my app directory is hcp. I'm trying to
do the import on a file in the hcp app directory. The imports of my
classes (ie from mn.hcp import something) work just fine. The issue
seems to be with python specific imports.

Thanks.

On Wed, Feb 15, 2012 at 11:11 PM, Furbee <Furbeenator@gmail.com> wrote:
> Can you reply with the actual NameError Exception? Like: NameError: global
> name 'datetime' is not defined, or whatever it is. From the module that is
> throwing this error are you importing anything else that is importing an
> overridden date method or datetime object?
>
> You can also try this (instead of "import datetime"):
>
> from datetime import date
>
> On Wed, Feb 15, 2012 at 7:48 PM, Scott <hacktorious@gmail.com> wrote:
>>
>> Hello,
>> I'm having a strange issue and have already spent an hour trying to
>> figure it out.
>>
>> I created a python app called mn.  Then I setup all my models and
>> stuff to work under mn.hcp.  Everything has been working fine until I
>> tried to use date time in a py file in the hcp directory.
>>
>> I've imported datetime, with import date time at the top of my py
>> file.  Then within the file I have a class with an internal method
>> trying to use some date functions.
>>
>> datetime.date(2003,11,11)
>>
>> For some reason I am getting a NameError on the datetime object.  I
>> don't understand why this is happening after I've imported datetime.
>> Any help would be appreciated.  Thanks.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

--
Scott A. Macri
www.ScottMacri.com
(571) 234-1581

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate