Category Archives: CODEX

samba start error

smbd: relocation error: /lib/libsamba-credentials.so.0: symbol GSS_KRB5_CRED_NO_CI_FLAGS_X, version gssapi_krb5_2_MIT not defined in file libgssapi_krb5.so.2 with link time reference
Package krb5-libs-1.13.2-11.fc23.i686 is already installed
should update krb5-libs-1.13.2 to krb5-libs-1.14.1
so: sudo dnf install krb5-libs-1.14.1-*
other words,  security should be set as share
or smbd would not start properly (error exit)
DONE

django:DateTimeField如何自动设置为当前时间并且能被修改

创建django的model时,有DateTimeField、DateField和TimeField三种类型可以用来创建日期字段,其值分别 对应着datetime()、date()、time()三中对象。这三个field有着相同的参数auto_now和auto_now_add,表面上 看起来很easy,但实际使用中很容易出错,下面是一些注意点。 Continue reading django:DateTimeField如何自动设置为当前时间并且能被修改

django admin You don't have permission to edit anything ?

1, 在urls.py 文件中加入一行 admin.autodiscover()
admin.autodiscover() 是什么作用呢?
查看源码 分析到作用是把 settings.INSTALLED_APPS这个节点中的配置动态的加入到程序中来。
2,在models.py文件中将数据表注册到admin里,
from django.contrib import admin

admin.site.register(modelname)
 

Install setuptools for django

settools在https://pypi.python.org/pypi/setuptools/
  1. wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
  2. tar zxvf setuptools-0.6c11.tar.gz
  3. cd setuptools-0.6c11
  4. sudo python setup.py build
  5. sudo python setup.py install