I started to learn Django, I don't know python very well, so please forgive me, if the question is quite stupid).
from . import views
what is "." in this statement? Module's name?
shortcuts import render from django. http import HttpResponse def index(request): return HttpResponse("Hello World!") Now, you can create another app, in your Django project, called my_second_app and you should repeat the above steps for that app too.
It means from the current directory import views.py module.
From the Views panel, click Manage. Select a view and click the Import option from the horizontal ellipsis next to the Add option. Browse to select the Virtual Machines Distribution content definition XML file and click Import.
Django views are a key component of applications built with the framework. At their simplest they are a Python function or class that takes a web request and return a web response. Views are used to do things like fetch objects from the database, modify those objects if needed, render forms, return HTML, and much more.
The single dot is a convention from command line applications. It means the current directory. In terms of Django it stands for the directory/module the current file is on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With