This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create new project | |
django-admin startproject learndjango | |
cd learndjango | |
# migrate db | |
python3 manage.py migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Final choice: | |
https://medium.com/@marek_94752/how-to-start-with-vue-or-any-other-framework-lib-in-django-in-few-minutes-b34fd4291f7 | |
https://pascalw.me/blog/2020/04/19/webpack-django.html | |
Others Reference: | |
https://dev.to/tkainrad/using-vuejs-alongside-django-29ka | |
https://www.youtube.com/watch?v=Yx_dJ3CoTRk | |
https://djangowaves.com/tutorial/how-to-use-vue-and-django/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install nvm | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash | |
# reload terminal | |
# check version | |
nvm --version | |
# install node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reset db for dev | |
rm db.sqlite3 | |
poetry run plum manage reset_db | |
poetry run plum manage migrate | |
poetry run plum seed-data --user_password=123 | |
# reset password for dev | |
u = Member.objects.get(id=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd pythondev | |
# create env | |
python3 -m venv env1 | |
# activate env | |
source env1/bin/activate | |
# serve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Internal::ActivitiesController < InternalController | |
def index | |
activities = PublicActivity::Activity | |
unless params[:category].blank? | |
category_key = get_category_key(params[:category]) | |
activities = activities.where("key LIKE ?", "%" + category_key + "%") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI | |
Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate_name | |
if @worker_name.blank? | |
@errors.push({:code => -10, :message => 'Worker Name is empty'}) | |
return | |
end | |
if @worker_name.length > 50 | |
@errors.push({:code => -11, :message => 'Worker Name must not more than 50 characters'}) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div id="video_consult" class="video_consult"> | |
<video-consult-component></video-consult-component> | |
</div> | |
<div id="chat_consult" class="chat_consult"> | |
<chat-consult-component></chat-consult-component> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew list | grep php | |
-- | |
php71 | |
[email protected] |