1. What is Django?

Django is a high-level Python web framework that enables rapid development of secure and maintainable websites.

2. Who developed Django?

Django was developed by Adrian Holovaty and Simon Willison.

3. Why is Django called a high-level framework?

Because it provides built-in features like ORM, authentication, and admin panel, reducing development effort.

4. What architecture does Django follow?

Django follows MVT (Model-View-Template) architecture.

5. What is MVT?

MVT stands for Model (data), View (logic), Template (UI).

6. What language is Django written in?

Django is written in Python.

7. What are the advantages of Django?

Fast development, security, scalability, built-in admin, ORM.

8. What is a framework?

A framework is a collection of tools and libraries that helps developers build applications faster.

9. What is Django used for?

Web applications like e-commerce, blogs, APIs, and enterprise apps.

10. What companies use Django?

Instagram, Pinterest, Mozilla, and Disqus.

11. How to install Django?

Using pip command: pip install django

12. How to check Django version?

django-admin --version

13. What is pip?

Pip is a Python package manager used to install libraries.

14. What is virtual environment?

A virtual environment isolates project dependencies.

15. How to create virtual environment?

python -m venv env

16. How to activate virtual environment?

Windows: env\Scripts\activate

17. What is django-admin?

A command-line tool to manage Django projects.

18. How to create Django project?

django-admin startproject projectname

19. What is manage.py?

A command-line utility to interact with Django project.

20. How to run server?

python manage.py runserver

21. What is default port of Django?

8000

22. How to change port?

python manage.py runserver 8080

23. What is project structure?

It includes settings.py, urls.py, wsgi.py, asgi.py.

24. What is settings.py?

Main configuration file of Django project.

25. What is urls.py?

Defines URL routing.

26. What is wsgi.py?

Entry point for WSGI-compatible web servers.

27. What is asgi.py?

Entry point for async servers.

28. What is DEBUG mode?

Shows detailed errors during development.

29. Why disable DEBUG in production?

For security reasons.

30. What is SECRET_KEY?

A secret key used for cryptographic signing.

31. What is an app in Django?

A module that handles specific functionality.

32. How to create app?

python manage.py startapp appname

33. Difference between project and app?

Project is entire application, app is a component.

34. How to register app?

Add it in INSTALLED_APPS in settings.py.

35. What is INSTALLED_APPS?

A list of apps used in project.

36. What is BASE_DIR?

Represents base directory path.

37. What is ALLOWED_HOSTS?

Defines allowed domains.

38. What is middleware?

Functions that process requests and responses.

39. What is ROOT_URLCONF?

Points to main URL configuration.

40. What is TEMPLATES setting?

Defines template configuration.

41. What is STATIC_URL?

URL for static files.

42. What are static files?

CSS, JS, images.

43. What is MEDIA_URL?

URL for user uploaded files.

44. What is database configuration?

Defined in settings.py.

45. Default database?

SQLite

46. What is migration?

Database schema changes.

47. Command for migrations?

python manage.py migrate

48. What is makemigrations?

Creates migration files.

49. What is superuser?

Admin user with full access.

50. Command to create superuser?

python manage.py createsuperuser

51. What is Django admin?

A built-in admin interface.

52. How to access admin?

/admin URL

53. What is runserver?

Starts development server.

54. What is Django shell?

Interactive Python shell.

55. Command for shell?

python manage.py shell

56. What is URL dispatcher?

Routes URLs to views.

57. What is HttpRequest?

Represents client request.

58. What is HttpResponse?

Response returned to client.

59. What is DEBUG=True?

Enables debug mode.

60. What is production mode?

Live deployment environment.

61. What are environment variables in Django?

Environment variables are external values used to store sensitive data like SECRET_KEY, database credentials, and API keys securely.

62. Why use environment variables?

To keep sensitive information secure and avoid hardcoding it in the source code.

63. How to set environment variables?

Using OS settings or tools like python-decouple or dotenv.

64. What is python-decouple?

A library used to separate configuration from code.

65. What is .env file?

A file used to store environment variables locally.

66. Should .env file be committed to Git?

No, it should be added to .gitignore for security.

67. What is Django settings modularization?

Splitting settings.py into multiple files like base.py, dev.py, prod.py.

68. Why split settings?

To manage different environments efficiently.

69. What is production server?

A server where the application is deployed for real users.

70. Difference between development and production?

Development is for testing, production is for live usage with high security and performance.

71. What is WSGI server?

WSGI (Web Server Gateway Interface) is used to connect Django with web servers like Gunicorn.

72. What is ASGI server?

ASGI supports asynchronous communication and is used for real-time apps.

73. Example of WSGI servers?

Gunicorn, uWSGI.

74. Example of ASGI servers?

Daphne, Uvicorn.

75. What is Gunicorn?

A Python WSGI HTTP server for UNIX.

76. What is Nginx?

A web server used as reverse proxy and load balancer.

77. Why use Nginx with Django?

To handle static files and improve performance.

78. What is reverse proxy?

A server that forwards client requests to backend servers.

79. What is load balancing?

Distributing traffic across multiple servers.

80. What is deployment?

Process of making application live on a server.

81. What is Django logging?

A system to record errors and events in the application.

82. Why logging is important?

To debug issues and monitor application behavior.

83. What is Django security?

Features that protect apps from attacks like CSRF, XSS, SQL injection.

84. What is CSRF?

Cross-Site Request Forgery attack protection.

85. What is XSS?

Cross-Site Scripting attack where malicious scripts are injected.

86. What is SQL Injection?

Attack where SQL queries are manipulated.

87. How Django prevents SQL injection?

Using ORM which escapes queries automatically.

88. What is DEBUG=False?

Disables debug mode in production.

89. What is ALLOWED_HOSTS in production?

List of domains allowed to access the app.

90. What is HTTPS?

Secure version of HTTP using encryption.

91. What is version control?

A system to track code changes.

92. Which tool is used for version control?

Git.

93. Why use Git with Django?

To manage code versions and collaborate with teams.

94. What is GitHub?

A platform to host Git repositories.

95. What is requirements.txt?

A file listing all project dependencies.

96. How to create requirements.txt?

pip freeze > requirements.txt

97. How to install dependencies?

pip install -r requirements.txt

98. What is Django project best practice?

Use virtual environment, modular settings, proper folder structure, and secure configs.

99. What is scalability in Django?

Ability to handle increasing traffic and data efficiently.

100. How to improve Django performance?

Use caching, optimize queries, use CDN, and efficient database design.

📢 Join Our WhatsApp Channel

💼 Get Daily IT Job Updates, Interview Preparation Tips & Instant Alerts directly on WhatsApp.

👉 Join WhatsApp Now

📢 Join Our Telegram Channel

💼 Get Daily IT Job Updates, Interview Tips & Exclusive Alerts directly on Telegram!

👉 Join Telegram

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2022 - 2025 itfreesource.com

Enable Notifications OK No thanks