자주 묻는 질문: 관리자¶
로그인을 할 수가 없습니다. 유효한 아이디와 패스워드를 입력해도 다시 로그인 페이지가 나옵니다. 아무런 에러 메세지 없이요.¶
로그인 쿠키가 재대로 설정되어 있지 않습니다. Django가 전송한 도메인의 쿠키가 브라우저의 도메인과 일치하지 않기 때문입니다. SESSION_COOKIE_DOMAIN
설정을 당신의 도메인과 맞게 설정해 주십시오. 만약 브라우저에서 가려고 하는 페이지가 "https://www.example.com/admin/" 이라면 "SESSION_COOKIE_DOMAIN = 'www.example.com'" 과 같이 설정해야 합니다.
로그인을 할 수 없습니다. 유효한 아이디와 패스워드를 입력해도 다시 로그인 페이지가 나오면서 "올바른 아이디와 패스워드를 입력해주세요" 에러가 나타납니다.¶
만약 입력하신 아이디와 패스워드가 확실히 올바르다면, 당신의 사용자 계정이 is_active
속성과 is_staff
속성이 True로 설정돼있는지 확인하십시오. 관리자 사이트는 두 필드가 모두 True인 유저에게만 접근을 허가합니다.
어떻게 자동으로 필드값을 관리자모드에서 마지막으로 대상을 편집한 이용자로 세팅하나요?¶
The ModelAdmin
class provides customization hooks
that allow you to transform an object as it saved, using details from the
request. By extracting the current user from the request, and customizing the
save_model()
hook, you can update an
object to reflect the user that edited it. See the documentation on
ModelAdmin methods for an example.
대상을 작성한 이용자만이 그것을 편집할 수 있도록 하기위해 어떻게 관리자 접근을 제한하나요?¶
The ModelAdmin
class also provides customization
hooks that allow you to control the visibility and editability of objects in the
admin. Using the same trick of extracting the user from the request, the
get_queryset()
and
has_change_permission()
can be used to
control the visibility and editability of objects in the admin.
내 관리자 사이트의 CSS와 이미지들이 개발 서버에서는 잘 보여지지만 mod_wsgi를 이용할 때는 재대로 보여지지 않습니다.¶
See serving the admin files in the "How to use Django with mod_wsgi" documentation.
저의 "list_filter"가 ManyToManyField를 가지고 있습니다. 그런데 필터에서 나타나지 않습니다.¶
Django는 관련된 개체가 2개보다 적으면 ManyToManyField에 대한 필터를 나타내지 않습니다.
예를들어, attr:'~django.contrib.admin.ModelAdmin.list_filter'가 :dic:`sites</ref/contrib/sites>'를 포함하고 있고 여러분의 데이터베이스에 오직 하나의 사이트만 있다면, 'Site'필터를 표시하지 않을 것 입니다. 이러한 경우에 site로 필터링하는 것은 의미가 없습니다.
몇몇 개체가 관리자 페이지에서 표시되지 않습니다.¶
Inconsistent row counts may be caused by missing foreign key values or a
foreign key field incorrectly set to null=False
. If you have a record with a
ForeignKey
pointing to a non-existent object and
that foreign key is included is
list_display
, the record will not be
shown in the admin changelist because the Django model is declaring an
integrity constraint that is not implemented at the database level.
어떻게 관리 인터페이스의 기능을 커스터마이즈 할 수 있습니까?¶
여러분은 여러 옵션을 가지고 있습니다. 만약 여러분이 Django가 자동적으로 만드는 추가/변경 폼에 업혀가고 싶다면 임의의 자바스크립트 모듈을 모델의 클래스 Admin :ref:`js parameter<modeladmin-asset-definitions>`를 통해서 페이지에 추가할 수 있습니다. 그 파라미터는 문자열인 URL 목록이고 <script>태그를 통한 관리자 폼에 추가될 자바스크립트 모듈을 가리키고 있습니다.
If you want more flexibility than simply tweaking the auto-generated forms, feel free to write custom views for the admin. The admin is powered by Django itself, and you can write custom views that hook into the authentication system, check permissions and do whatever else they need to do.
만약 관리자 인터페이스의 룩앤필을 커스터마이징 하기를 원한다면, 다음 질문을 읽으세요.
동적 관리자 사이트가 못 생겼어요. 어떻게 변경을 할 수 있나요?¶
우리는 좋아하지만, 당신은 그렇지 않다면 CSS 그리고/또는 연관된 이미지 파일들을 수정하여서 관리자 사이트의 모습을 변경할 수 있습니다. 관리자 사이트는 시맨틱 HTML 그리고 다수의 CSS 훅들로 만들어져 있어 스타일시트를 수정하여 원하는 변경사항을 적용할 수 있을 것입니다.
관리자 사이트는 어떤 브라우저들을 지원하나요?¶
The admin provides a fully-functional experience to YUI's A-grade browsers, with the notable exception of IE6, which is not supported.
There may be minor stylistic differences between supported browsers—for example, some browsers may not support rounded corners. These are considered acceptable variations in rendering.