PyCharm > Preferences > Project > Project interpreter
choose the python interpreter which contains django

PyCharm > Preferences > Languages & Frameworks > Django
check the Enable Django Support
Django project root: project root path
Settings: project settings.py path
Manage script: manage.py

Comment and share

git指令筆記

in git

基本

上一版本:HEAD^, 上兩版本HEAD~2, 上三版本HEAD~3…etc

1
2
3
4
git add [file]
git add -A
git commit -m [comment]
git push

Continue reading

Github筆記

in git

Github New Repository

  1. 申請github帳號
  2. create a empty public repository
  3. 在欲上傳的folder執行以下指令

    1
    2
    3
    4
    5
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/cwza/gms.git
    git push -u origin master
  4. .gitignore筆記參考

  5. git筆記參考

  6. fetch remote branch and checkout it

    1
    2
    git fetch <remote> <rbranch>:<lbranch>
    git checkout <lbranch>

Update Github forked repository

1
2
3
4
5
6
7
git remote -v
git remote add upstream https://github.com/otheruser/repo.git
git fetch upstream
git branch -va
git checkout master
git merge upstream/master
git push

Comment and share

.gitignore筆記

in git

可將gitignore設定在以下三個地方,各代表不同意思

  • .gitignore

放在跟.git資料夾同一層
設定在這邊的代表此project需要忽略的,且此檔案會commit到git上,所以個人相關的不要放在這(ex: IDE產生的考慮放到下面那兩個)

.gitignore
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# If you need to exclude files such as those generated by an IDE, use
# $GIT_DIR/info/exclude or the core.excludesFile configuration variable as
# described in https://git-scm.com/docs/gitignore
*.egg-info
*.pot
*.py[co]
__pycache__
MANIFEST
dist/
docs/_build/
docs/locale/
node_modules/
tests/coverage_html/
tests/.coverage
build/
tests/report/

  • $GIT_DIR/info/exclude
    $GIT_DIR通常就是.git folder
    設定在這邊的代表此project需要忽略的,不會被commit到git,專用來放個人相關的忽略

  • core.excludesFile
    全域忽略,所有project相關,在~/.gitconfig有此變數可設定

Comment and share

remove eclipse folder and folowings:
~/.eclipse (folder);
~/Library/Saved Application/org.eclipse.eclipse.savedState;
~/Library/Preferences/org.eclipse.eclipse.plist;
~/Library/Caches/org.eclipse.eclipse;
… and of course the eclipse install folder

Comment and share

1
2
3
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

Comment and share

git submodule指令筆記

in git

add submodule

1
2
3
git submodule add http://github.com/tpope/vim-fugitive.git bundle/fugitive
git add .
git commit -m "Install Fugitive.vim bundle as a submodule."

remove submodule

  1. Delete the relevant section from the .gitmodules file.
  2. Stage the .gitmodules changes git add .gitmodules
  3. Delete the relevant section from .git/config.
  4. Run git rm –cached path_to_submodule (no trailing slash).
  5. Run rm -rf .git/modules/path_to_submodule
  6. commit git commit -m “Removed (submodule name)”
  7. Delete the now untracked submodule files rm -rf path_to_submodule
  8. git submodule sync

clone a project with git submodule

1
2
3
git clone <project>
git submodule init
git submodule update

Comment and share

pip指令筆記

in python

python 3rd library通常會撞到:python_path/lib/python3.4/site-packages

以安裝ipython為例

1
2
3
4
5
6
7
8
9
10
11
12
#安裝/反安裝package
pip install ipython
pip uninstall ipython
#找出ipython安裝在哪
pip show --files ipython
#更新package
pip install --upgrade ipython
#列出哪些package需要更新
pip list --outdated

Comment and share

Cwza

Hello everyone.
I’m cwza.
Welcome to my blog.


Software Engineer


Taiwan/Taipei