Serverless Restful Architecture with Zappa
- Python 3.8.6
- Django 3.1.4
- Django Rest Framework 3.12.2
- Zappa 0.52.0
https://wkdtjsgur100.github.io/zappa-mysql-django/
- Integrated services for python serverless restful api
- Swagger(for API Docs)
- zappa(for python Serverless)
- django rest framework(for restful api)
- Mysql(for relational database)
- Divided settings(base, local, production)
- Input credential information into
~/.aws/credentials
file from AWS IAM (or if aws cli is installed, runaws configure
)[zappa] aws_access_key_id = <AWS access key id> aws_secret_access_key = <AWS secret access key>
- Make database and get endpoint(local, production)
- Make S3 bucket for static files and allow public access (or use cloud front for cdn)
git clone https://github.com/wkdtjsgur100/zappa-drf-mysql.git
# activate virtualenv based on python 3.8.6 if you want
pip install -r requirements.txt
zappa init
python ./setup.py
zappa deploy <my-zappa-stage>
zappa manage <my-zappa-stage> "collectstatic --noinput"
zappa undeploy <my-zappa-stage>
zappa update <my-zappa-stage>
zappa manage dev migrate
zappa manage <my-zappa-stage> create_admin_user <nickname> <email> <password>
- swagger endpoint: http://localhost:8000/swagger/
- More info: https://drf-yasg.readthedocs.io/en/stable/
MIT License