my frist django project Error

123 views
Skip to first unread message

morning yao

unread,
Jul 9, 2011, 4:21:01 PM7/9/11
to Django users
so ,here is the Error Traceback,i need your help,thanks!
_______________________________________________________
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 1.3
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
get_response
101. request.path_info)
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
resolve
250. for pattern in self.url_patterns:
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
_get_url_patterns
279. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in
_get_urlconf_module
274. self._urlconf_module =
import_module(self.urlconf_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py" in
import_module
35. __import__(name)
File "C:\Python27\Lib\site-packages\django\dinette\..\dinette\urls.py"
in <module>
4. from dinette.views import
LatestTopicsByCategory,LatestRepliesOfTopic
File "C:\Python27\Lib\site-packages\django\dinette\..\dinette
\views.py" in <module>
19. from dinette.models import Ftopics ,
SuperCategory ,Category ,Reply, DinetteUserProfile
File "C:\Python27\Lib\site-packages\django\dinette\..\dinette
\models.py" in <module>
18.
logging.config.fileConfig(settings.LOG_FILE_NAME,defaults=dict(log_path=settings.LOG_FILE_PATH))
File "C:\Python27\lib\site-packages\django\utils\functional.py" in
__getattr__
277. return getattr(self._wrapped, name)

Exception Type: AttributeError at /
Exception Value: 'Settings' object has no attribute 'LOG_FILE_NAME'

Shawn Milochik

unread,
Jul 9, 2011, 4:33:38 PM7/9/11
to django...@googlegroups.com
On 07/09/2011 04:21 PM, morning yao wrote:
> so ,here is the Error Traceback,i need your help,thanks!
> _______________________________________________________
> Environment:
>
Did you read the traceback you posted?

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 9, 2011, 4:49:50 PM7/9/11
to django...@googlegroups.com
Question, have you ever used Python before?

If no, then I suggest you learn Python before jumping into Django.

If yes, then you need to learn more about Python.

Cal


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


Malcolm Box

unread,
Jul 10, 2011, 2:42:17 PM7/10/11
to django...@googlegroups.com
Cal,

You are contributing a lot to the django users group, but this response isnt in the best spirit of the group. 

Yes, the op could work out from the traceback what the error was, but we were all beginners once. If you compare this post to the how to post FAQ its not too bad - at least there's a traceback. 

Telling someone they need to learn more python isn't helpful - tell them that theres a setting missing and how the traceback makes that clear. 

Sorry to pull you up on this but the helpfulness of this list is important both to me and the health of the django community. 

Malcolm


Sent from my iPhone, please excuse any typos

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 10, 2011, 3:13:37 PM7/10/11
to django...@googlegroups.com
On Sun, Jul 10, 2011 at 7:42 PM, Malcolm Box <malco...@gmail.com> wrote:
Cal,

You are contributing a lot to the django users group, but this response isnt in the best spirit of the group. 

Yes, the op could work out from the traceback what the error was, but we were all beginners once. If you compare this post to the how to post FAQ its not too bad - at least there's a traceback. 

Telling someone they need to learn more python isn't helpful - tell them that theres a setting missing and how the traceback makes that clear.

That's a fair point tbh.

I'll make sure to use a more friendly approach for future threads like this. :)

Kenneth Gonsalves

unread,
Jul 10, 2011, 11:37:32 PM7/10/11
to django...@googlegroups.com
On Sun, 2011-07-10 at 20:13 +0100, Cal Leeming [Simplicity Media Ltd]
wrote:

> > Telling someone they need to learn more python isn't helpful - tell
> them
> > that theres a setting missing and how the traceback makes that
> clear.
> >
>
> That's a fair point tbh.
>
> I'll make sure to use a more friendly approach for future threads like
> this.
> :)

looks like we need to add a section on how to answer questions also.
--
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

Gour-Gadadhara Dasa

unread,
Jul 11, 2011, 1:42:58 AM7/11/11
to django...@googlegroups.com
On Sun, 10 Jul 2011 19:42:17 +0100
Malcolm Box <malco...@gmail.com> wrote:

> Cal,
>
> You are contributing a lot to the django users group, but this
> response isnt in the best spirit of the group.
>
> Yes, the op could work out from the traceback what the error was, but
> we were all beginners once. If you compare this post to the how to
> post FAQ its not too bad - at least there's a traceback.
>
> Telling someone they need to learn more python isn't helpful - tell
> them that theres a setting missing and how the traceback makes that
> clear.
>
> Sorry to pull you up on this but the helpfulness of this list is
> important both to me and the health of the django community.

+1


Sincerely,
Gour

--
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc

bruno desthuilliers

unread,
Jul 11, 2011, 3:28:41 AM7/11/11
to Django users
On Jul 9, 10:21 pm, morning yao <yitai...@gmail.com> wrote:
> so ,here is the Error Traceback,i need your help,thanks!
(...)
> File "C:\Python27\Lib\site-packages\django\dinette\..\dinette
> \models.py" in <module>
>   18.
> logging.config.fileConfig(settings.LOG_FILE_NAME,defaults=dict(log_path=settings.LOG_FILE_PATH))
> File "C:\Python27\lib\site-packages\django\utils\functional.py" in
> __getattr__
>   277.         return getattr(self._wrapped, name)
>
> Exception Type: AttributeError at /
> Exception Value: 'Settings' object has no attribute 'LOG_FILE_NAME'

As the traceback kindly explain, the dinette.models module is trying
to access non-existing attributes of the settings module. You'd need
to define LOG_FILE_NAME and LOG_FILE_PATH in your settings or use
getattr(setting, "ATTRIBUTE_NAME", default_value) instead (cf Python's
doc for getattr).

As a side note, configuring the logging module in a models module is
definitly *not* a good idea. If you're using django 1.3+, there are
better ways, please refer to the relevant doc.

HTH

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 11, 2011, 5:40:24 AM7/11/11
to django...@googlegroups.com


On 11 Jul 2011 04:39, "Kenneth Gonsalves" <law...@thenilgiris.com> wrote:
>
> On Sun, 2011-07-10 at 20:13 +0100, Cal Leeming [Simplicity Media Ltd]
> wrote:
> > > Telling someone they need to learn more python isn't helpful - tell
> > them
> > > that theres a setting missing and how the traceback makes that
> > clear.
> > >
> >
> > That's a fair point tbh.
> >
> > I'll make sure to use a more friendly approach for future threads like
> > this.
> > :)
>
> looks like we need to add a section on how to answer questions also.

+1 on this.

> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>

Kenneth Gonsalves

unread,
Jul 11, 2011, 6:19:18 AM7/11/11
to django...@googlegroups.com
On Mon, 2011-07-11 at 10:40 +0100, Cal Leeming [Simplicity Media Ltd]
wrote:
> >

> > looks like we need to add a section on how to answer questions also.
>
> +1 on this.

started:
https://code.djangoproject.com/wiki/UsingTheMailingList#Howtoanswerquestionsonthelist

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 11, 2011, 6:58:13 AM7/11/11
to django...@googlegroups.com
Look good (i've added 1 line). 

Nice work on adding the TOC, didn't know about that.

Cal

Reply all
Reply to author
Forward
0 new messages