Posts Tagged with 'Django'
Python Print String N times
Python | Print String N times >>> s = 'Python' >>> n = 5 >>> print(s * n) PythonPythonPythonPythonPython
python return multiple values from functions
Python | Return multiple values from functions >>> def A(): return 2, 3, 4 >>> a, b, c = A() >>> print(a, b, c) 2 3 4
Python join all items of a list to convert into a single string
Python | Join all items of a list to convert into a single string >>> x = ["Python", "Online", "Training"] >>> print(" ".join(x)) Python Online Training
Reversing a String in Python
Python | Reversing a String >>> x = 'PythonWorld' >>> print(x[: : -1]) dlroWnohtyP
Python In-place swapping of two numbers
Python | In-place swapping of two numbers >>> a, b = 10, 20 >>> print(a, b) 10 20 >>> a, b = b, a >>> print(a, b) 20 10
What are static files in Django? And how can you set them?
In Django, static files are the files that serve the purpose of additional purposes such as images, CSS, or JavaScript files. Static files managed by “django.contrib.staticfiles”. There are three main things to set up static …
Explain Django's code reusability.
Compared to other frameworks, Django offers more code reusability. As Django is a combination of apps, copying those apps from one directory to another with some tweaks to the settings.py file won't need much time …
What architecture does Django use?
Django follows a Model-View -Template (MVT) architecture which is a variant of the MVC architecture. Model: Logical data structure behind the entire app and signified by a database. A model is used in Django to …
how you can set up the Database in Django
Django | Set up Database We need to edit the setting.py file present in the project, which contains all the settings related to the project. By default Django comes with an SQLite database; The SQLite database …
List the inheritance styles in Django?
List the inheritance styles in Django There are three possible inheritance styles in Django, and they are: Abstract Base Classes: This is used when we want to make the parent class hold the information which …
Set up environment variables in Django
Django | Set up environment variables in Django 1. Install Django Environ In your terminal, inside the project directory, type: $ pip install django-environ 2. Import environ in settings.py import environ 3. Initialise environ …
Name some companies that use Django?
Some of the more well-known companies that make use of Django are:’ Instagram Mozilla Firefox Reddit YouTube Disqus Bitbucket Spotify NASA Pinterest Eventbrite, etc.
what are the features available in Django?
Django | Features Features available in Django are Optimized for SEO Extremely fast A loaded framework that features authentications, content administrations and RSS feeds Exceptionally scalable to meet the heaviest traffic demand Highly secure Versatility, …
Explain Django’s Request/Response Cycle.
Django | Request/Response Cycle Whenever a request is received by the Django server. The Request is processed by various middlewares and is passed to the URL Router. Then, the server looks for a matching URL in the urlpatterns …
What is a Meta Class in Django?
Django | Meta Class A Meta class is simply an inner class that provides metadata about the outer class in Django. It defines such things as available permissions, associated database table name, singular and plural versions …