Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
DRF Deployment

Hi there, I am fairly new to Django and DRF, I have never deployed a django project but have built small development APIs to learn.

I'm trying to deploy a project with gunicorn and nginx (if there is a better alternative, please let me know)

#PROBLEM
I keep running into an issue where my django admin panel hangs frequently, or takes up to 4s to load the page. Check Chrome tools it's usually jsi18n which takes the most time. My apis calls also have a tendency to hang and ends up timing out. I'm using AWD RDS postgres db.

#TRIED
- Upgrading DB
- Checking my SQL queries (at most 500ms)
- Increasing gunicorn workers
- Changed nginx configuration

#INFO
- I have 2 custom models, an altered base user model and a password otp model
- I'm using simple_jwt
- The hanging or long loading can happen on any call or any django admin page (except login page)

If there is any more information, code examples, please let me know.

I'm really struggling to find modern Deployment techniques for DRF, atm my setup is Docker, gunicorn and nginx. If anyone has any up to date resources for better deployment, I would be incredibly grateful.

/r/django
https://redd.it/1jgku8k