A decentralized library for people who read paper books.
Terminology
User Journey Maps
Wireframes
python manage.py runserver
This command monitors the scss
folder for changes and compiles it to css.
python manage.py sass app/static/app/scss/ app/static/app/css/ --watch
python manage.py test
I reccomend using pyenv virtualenv to manage your python version and environment. This project
learn more about pyenv virtualenv
Install python build requirements.
instructions Install the packages.
Install pyenv with homebrew
brew update
brew install pyenv
Add pyenv init to your shell to enable shims and autocompletion. Please make sure eval "$(pyenv init -)"
is placed toward the end of the shell configuration file since it manipulates PATH during the initialization.
# zsh
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc
Restart your shell so the path changes take effect. You can now begin using pyenv.
exec "$SHELL"
Install Python versions into $(pyenv root)/versions
. For example, to download and install Python 2.7.8, run:
pyenv install 3.8.0
Troubleshooting |
---|
Mac os System Version: macOS 11.2.3 (20D91) has experienced build problems with this version of Python. These instructions have been helpful. |
Create you python environemnt with the correct version.
pyenv virtualenv 3.8.0 books
Activate your virtual environment.
pyenv activate books
Install the project requirements.
pip install -r requirements.txt
run the migrations
python manage.py migrate
Export GOOGLE_APPLICATION_CREDENTIALS
for google cloud vision API.
In a bash console...
export GOOGLE_APPLICATION_CREDENTIALS="/PATH/TO/YOUR/PROJECT/google_credentials.json"
SMS These environment variables are required to configure the SMS client for text message notifications.
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=
TEST_PHONE= # Receives SMS during tests.
Ask Mav if you need them as they are currently associated with a personal account.
Environment Variables
ENV=development # production, development, TODO: staging
BASE_URL=http://127.0.0.1:8000 # You do not want a trailing slash
SECRET_KEY= # Get from mav
SMS_VERIFICATION=True # Requires users to confirm SMS for their account
TEST_SMS= # Send SMS to TEST_PHONE during tests
DEBUG= # Always False for production
SMS
from app.sms import SMS
# As a one off message
SMS.send('<TO_PHONE_NUMBER>', '<MESSAGE>')
# Extending the client for a particular app
class AccountSMS(SMS):
@classmethod
def send_book_return_reminder(cls, account):
message = "This is my message for this text"
cls.send(account.phone_number, message)
account = Account.objects.get(email="jeffers@gmail.com")
AccountSMS.send_book_return_reminder(account)
Migrations
Screen Shot 2021-04-03 at 1.05.08 PM.png
make sure your migrations are up to date.
python manage.py migrate