Как я настраиваю веб-сайт Django на хостинге Amazon EC2?

Я хочу, чтобы кнопка говорила «DELIVER ME» до тех пор, пока вы не нажмете ее, а затем, как только вы нажмете на нее, кнопка выдаст «GTFO»

Для этой кнопки:

<input type="button" id="myButton" value="DELIVER ME">

Вы можете сделать это следующим образом:

const myButton = document.getElementById("myButton");
myButton.addEventListener("click", function() {
  this.value = "G.T.F.O."
});

Или, если кнопка выглядит так:

<button id="myButton">DELIVER ME</button>

Вы бы сделали:

const myButton = document.getElementById("myButton");
myButton.addEventListener("click", function() {
  this.innerText = "G.T.F.O."
});
48
задан Boann 24 July 2019 в 14:43
поделиться

2 ответа

It certainly is possible, but it sounds like EC2 is not the best option for you. For examples of people doing it, see for example this or this.

In a very oversimplified sense, EC2 is just a server you can rent by the hour. You can have it run Windows or Linux, and then install Python and Django like you normally would. In fact there is probably an image that has Django preconfigured already.

You should understand that there are all different types of hosting out there. At one extreme, you can pay for your very own physical server, install your own operating system (like Windows or Linux), install your own Python, you own web server like Apache or IIS, your own Django libraries, your own database (like MySQL) etc, and then upload your web site to that. At the other extreme you can pay for an account on a shared hosting service, where someone else has done all the setup of the OS, Python, the web server, etc, and all you need to do is upload your web site code. EC2 is a lot closer to the first extreme, and is probably overkill for you. I think in your case you should be looking for a more managed solution.
I would check out this web page, which lists a bunch of different Django hosting companies: Django hosting

32
ответ дан 26 November 2019 в 19:03
поделиться

Последние дни, я пытался найти самые лучшие способы разместить сайты Django на облачных серверах. Я нашел, что это - лучшее решение до сих пор, и я уменьшил Вашу работу также путем записи сценария Python. Сценарий автоматизирует процесс немного, я надеюсь, что он сэкономит Вам время и сложность хостинга сайтов Django на облачных серверах.

Вот сценарий и учебное руководство - https://bitbucket.org/soceton/control-panel/src/master /

, Это работает на меня, если необходимо изменить что-то, не стесняйтесь обновлять код. Заранее спасибо!

-2
ответ дан 22 September 2019 в 21:53
поделиться
Другие вопросы по тегам:

Похожие вопросы: