For more information on PTVS, see here.
Create a Django project in Visual stadio 2015. Comment out home in Views.py and write a program that calls test.html instead.
Views.py
from django.template import RequestContext
from datetime import datetime
def home(request):
assert isinstance(request, HttpRequest)
return render(request,'app/test.html')
"""
def home(request):
assert isinstance(request, HttpRequest)
return render(
request,
'app/index.html',
context_instance = RequestContext(request,
{
'title':'Home Page',
'year':datetime.now().year,
})
)
“""
Try creating a new test.html. [Templates] ➡️ [app] ➡️ [test.html (create new with Add / New Item)]
test.html
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>test</title>
</head>
<body>
<div>My Name is saiyuki1919</div>
Can you ?
</body>
</html>
** Run ** will display as below
Right-click on the project you are creating and select [** Pubulish **]
Now select Microsoft Azure Web Apps and press ** Publish **
Now press ** New ** to create a new one.
*** Web App name: Optional *** *** App Service plan: New *** *** Database server: Select No database *** *** Other: Appropriate and OK ***
After confirming it properly, select ** Publish ** and the deployment will start. (Basically it can be left as it is)
At the management portal [App Service] ➡️ [Web App] ➡️ [Overview] ➡️ [URL]
If you click on the URL and look at it in your web browser, you can see the Django Web App you created earlier as shown below.
Recommended Posts