django_deploy Flashcards

1
Q

What is WSGI in the context of Django deployment?

A

WSGI stands for Web Server Gateway Interface. It is a standard for communication between web servers and Python web applications, supporting synchronous code only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the wsgi.py file do in a Django project?

A

The wsgi.py file declares an application callable, which is used by WSGI servers as an entry point to communicate with the Django app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name some popular WSGI web servers for Django apps.

A

Popular WSGI web servers for Django apps include Gunicorn, uWSGI, Apache, and mod_wsgi.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is ASGI and how does it differ from WSGI?

A

ASGI stands for Asynchronous Server Gateway Interface and supports asynchronous code, whereas WSGI supports only synchronous code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the asgi.py file do in a Django project?

A

The asgi.py file declares an application callable for ASGI servers to communicate with the Django app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name some popular ASGI web servers for Django apps.

A

Popular ASGI web servers for Django apps include Daphne, Hypercorn, and Uvicorn.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some hosting options for running a Django app on the cloud?

A

Hosting options for running a Django app on the cloud include using a virtual machine (VM), platform-as-a-service (PaaS) like Heroku, and containerization with Docker and Kubernetes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which databases are officially supported by Django?

A

Django officially supports PostgreSQL, MariaDB, MySQL, Oracle, and SQLite.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why should you avoid using SQLite in production?

A

SQLite is not designed for high concurrency or heavy traffic, making it unsuitable for production environments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How should you handle database credentials in a Django app?

A

Database credentials and other sensitive information should be stored in environment variables and never hard-coded in the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why is it important to use HTTPS for your Django app in production?

A

HTTPS ensures secure communication between the server, the hosted Django app, and clients, protecting data from interception and tampering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the recommended way to serve static and media files in production?

A

Use a cloud storage service or content delivery network (CDN) to efficiently serve static files and user-uploaded media files, reducing server load.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the role of a load balancer in a Django deployment?

A

A load balancer distributes incoming traffic across multiple instances of the Django app, ensuring high performance and availability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does horizontal scaling involve in the context of a Django app?

A

Horizontal scaling involves adding more instances or containers of the Django app as traffic increases, enhancing scalability and performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is monitoring and logging important for a Django app in production?

A

Monitoring and logging services help track and diagnose issues, ensuring the reliability and smooth operation of the Django app in production.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly