본문 바로가기

web/Django

(52)
python2.7 Django1.6.x admin site template filed path for mac python2.7 Django1.6.x admin site template filed pathfor mac /Library/Python/2.7/site-packages/django/contrib/admin/templates/admin
setting.py 의 변수 사용하기 (setting.py get custom value) in setting.py CUSTOM_VALUE = "value" in view.py from APPNAME import settings print settings. CUSTOM_VALUE
구글플러스 로그인시 토스트창/팝업창 없애기 / Stop to google+ toast/notification sign-in popping up the message if you sign_in gogole+ You can see the notification to the bottom. The source of the notification If you want to stop thisadd in *.css iframe[src^="https://apis.google.com/u/0/_/widget/oauthflow/toast"] {display: none;}
Accessor for field 'FIELDNAME' clashes with related field 'MODEL.FIELDNAME'. Add a related_name argument to the definition for 'FIELDNAME' if you see an error APPNAME.MODELNAME : Accessor for field 'FIELDNAME' clashes with related field 'MODEL.FIELDNAME'. Add a related_name argument to the definition for 'FIELDNAME' This error is your model have two FK. so The name overlaps. Do not know ORM relateed field my model is as follows: after: add related_name="FIELDNAME" and you use the related_name in views.py code ex)It's error code.$ U..
django templatetags error "template libarary not fount, tried django.templatetags.." if you have as error templatesyntaxerror is not a valid tag library: template libarary not fount, tried django.templatetags, ........ in settings.py, you should never name the project 'myproj' explicitely. In INSTALLED_APPS, just use 'myapp'. Also, you should have this : TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'django.te..
south error south_migrationhistory doesn't exist if you see an error 'south error south_migrationhistory doesn't exist' $python ./manage.py syncdb --migrate then syncdb create 'master id' and $python ./manage.py migrate APPNAME It's worked!!
south error freeze or set south_auto_freeze_app = true in your settings.py If you ignore the existing DB and if the migration againThe error occurs. The usage is$ python ./manage.py schemamigration --freeze (APPNAME) (APPNAME) freeze --empty Then Migration is made. and you can work to migrate!!
django db 한글 에러 일때 (python 2.7.x django 1.6.5 버전 임) __init_.py 파일에 추가 아래 코드 추가 import sys reload(sys)sys.setdefaultencoding("utf-8") 테이블 생성시 해당 테이블/컬럼을 utf-8 로 설정 (끝!)