2012-10-11 5 views
15

마지막 질문 인 Error: No module named psycopg2.extensions에서 Mac OS를 Mountain Lion으로 업데이트하고 Xcode를 설치했습니다. 나는 또한 'sudo port install py27-psycopg2'를 사용하여 psycopg2를 설치했다. 지금은 '파이썬 manage.py의의 runserver'를 실행하려고하지만이 오류AttributeError : 'Settings'객체에 'ROOT_URLCONF'속성이 없습니다.

AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF' 

에게이 문제를 해결하고 내 로컬 호스트 실행하는 방법에 어떤 도움을 받고 있어요? 장고 docs에서

답변

9

: 귀하의 답변에 대한

A Django settings file contains all the configuration of your Django installation. When you use Django, you have to tell it which settings you're using. Do this by using an environment variable, DJANGO_SETTINGS_MODULE .

The value of DJANGO_SETTINGS_MODULE should be in Python path syntax, e.g. mysite.settings . Note that the settings module should be on the Python import search path.

그리고

ROOT_URLCONF

Default: Not defined

A string representing the full Python import path to your root URLconf. For example: "mydjangoapps.urls". Can be overridden on a per-request basis by setting the attribute urlconf on the incoming HttpRequest object. See How Django processes a request for details.

+1

감사합니다. DJANGO_SETTINGS_MODULE을 이미 mysite.settings로 설정하고 문서를 따라했지만 오류가 계속 발생합니다. 그래서 나는 무엇이 잘못 될지 확신하지 못합니다. – Jess

+0

'settings' 파일에'ROOT_URLCONF'에 대한 정의가 없을 가능성이 큽니다. 이 설정은 필수이며 응용 프로그램의 URL을 정의하는 파일을 가리켜 야합니다. – defuz

+1

내 설정 파일에 ROOT_URLCONF = 'mysite.urls'이 (가) 있습니다. 그 맞습니까? 이것이 정말로 간단한 문제라면 미안 해요. - 이것에 대한 나의 첫 경험입니다. 나는 모든 것이 올바르게 설정되어 있다고 믿는다.하지만 위에 게시 한 오류를보고 있는데 localhost에 가면 '서버 오류가 발생했습니다.'라는 오류가 있습니다. 관리자에게 문의하십시오. ' 도와 줘서 고마워. – Jess

관련 문제