Posts

Showing posts from January, 2011

Django Authentication Information

function is_authenticated() -> doesn't imply any permission, group or user active. It's just indicate user has provide valid name and user. --- function authenticate() -> authenticate a given username and password (or something) and return user object if password is valid for the given username, return None if not. --- function login() -> to log user to view. It takes an HttpRequest object and user object and save user's id in the session, using django's session framework and session middleware. --- more issues you can use custom authentication module with modified authenticate function, which can authenticate with other credential (not just username, password)

List for news group chat

freenode#django-lfs -> for information from django-lfs freenode#django-cms

Components for setup PIL

sudo apititude install - build-essential - libpng-dev - libjpeg-dev - libpq-dev - python-dev This's all for ubuntu machine

Something about #!/usr/bin/env python

This '#!/usr/bin/env python' will get you a python run by >./yourfile.py instead >python yourfile.py but you can '#!/usr/local/bin/python ' its use a specific python path So it's different from first paragraph and make your decision between 2 way :)

Tip and Hidden features of PyCharm

http://stackoverflow.com/questions/2555726/hidden-features-of-pycharm

More SVN with svn propedit

Yeah, when you use >>> svn propset svn:externals xxxxxxxxx . then you relocate your external, and you wanna let other which use this external follow the move you go to that app and >>> svn propedit svn:externals . # don't forget full stop!!! that's it!, you can edit!!!

svn external property !!!! Interesting!!!

DO... svn propset svn:externals 'akismet http://plugins.svn.wordpress.org/akismet/trunk' . property 'svn:externals' set on '.' THEN .. svn ci ref from: http://beerpla.net/2009/06/20/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/ http://old.nabble.com/svn:externals-example-td16552909.html

Virtualbox command line

Aha I'm back. This is about openning virbox instance by commandline. So if you have it(Virtualbox) installed in your machine then >>> VBoxManage list (it show your instance's list) and then >>>VBoxManage startvm your-instance-name or your-instance-uid

Quick sent mail with python.

import smtplib s = smtplib.SMTP(host, port) s.set_debuglevel(True) # for your appriciate s.starttls() # if server need s.sendmail(your email, [ your friend email ], message)

Something more about vimrc (python)

" Kelvin's handy VIM config file " " Use spaces instead of tabs set tabstop=4 set shiftwidth=4 " Use shiftwidth setting when at beginning of file set smarttab " When I press TAB actually insert spaces set expandtab " Fix backspace to delete the spaces youre using set softtabstop=4 " Autoindenting makes life easier for Python programmers set autoindent " Some syntax coloring syntax on " Set line numbering so you know where you are set number set ruler " Add another tab to the next line after the colon im : : thank for kevin (http://www.kelvinwong.ca/2008/09/11/my-vim-config-file-for-python/)