1
00:00:01,260 --> 00:00:06,680
Well here we're going to talk about how to maintain your website and by maintaining your website

2
00:00:06,690 --> 00:00:12,270
I don't mean you have to go to your website every day to check your files and see if it's running

3
00:00:12,270 --> 00:00:12,800
or not.

4
00:00:12,990 --> 00:00:15,740
So that process is automatic.

5
00:00:15,900 --> 00:00:18,900
You don't have to do routine maintenance.

6
00:00:18,900 --> 00:00:24,030
But what I mean by maintaining your website I mean you know you may want to change something from your

7
00:00:24,030 --> 00:00:29,940
website, you may want to add a page or update a page or change the CSS styling or add another

8
00:00:29,940 --> 00:00:33,260
function to your Python script etc.

9
00:00:33,380 --> 00:00:41,040
Only in rare cases you build a website and you put it online and then you don't change anything. That doesn't

10
00:00:41,040 --> 00:00:43,450
happen very often.

11
00:00:43,650 --> 00:00:48,430
And yeah, so how do we go about updating something from our website.

12
00:00:48,740 --> 00:00:50,960
Well now our files are both

13
00:00:50,970 --> 00:00:54,380
in our local file system which is here.

14
00:00:54,460 --> 00:00:57,550
In this directory, but they are also on Heroku.

15
00:00:57,960 --> 00:01:03,760
So if you want to change something you'd first change that in the local directory.

16
00:01:03,870 --> 00:01:07,500
For instance let's say this is about dot HTML page.

17
00:01:07,830 --> 00:01:16,820
And what I would want to do is I want to add another line so I'll paste that and let's try something.

18
00:01:16,980 --> 00:01:21,780
This was added later.

19
00:01:21,810 --> 00:01:30,710
Now the middleman here is Git. So Git serves the role to connect to your local files to the Heroku server

20
00:01:31,770 --> 00:01:39,060
which means now that you made the change you can save your changes and then you can push the falls again

21
00:01:39,090 --> 00:01:40,080
to Heroku.

22
00:01:40,470 --> 00:01:48,090
And actually if you save the file now Control S, you'll see that in the Atom directory tree, the about dot HTML 

23
00:01:48,210 --> 00:01:50,630
file name was colored in orange.

24
00:01:50,880 --> 00:01:54,650
That means you have pushed the changes for that file.

25
00:01:55,260 --> 00:02:01,810
So in other words the file is different from the file that you have on Heroku at the moment.

26
00:02:02,160 --> 00:02:06,030
But if you test your website on local host now, you'll see this change.

27
00:02:06,030 --> 00:02:10,890
So let me do that and before I do that I would like to change something on the CSS file as well.

28
00:02:10,910 --> 00:02:11,290

29
00:02:11,630 --> 00:02:18,950
So the 060, you save that and you see that CSS is also colored in orange.

30
00:02:18,970 --> 00:02:22,830
So I'll save that and go to the Demo.

31
00:02:23,010 --> 00:02:25,020
Directory Shift right click.

32
00:02:26,620 --> 00:02:27,570
And I'll just go ahead and

33
00:02:32,850 --> 00:02:34,040
execute script1.py

34
00:02:34,110 --> 00:02:38,360
using my virtual Python so to say.

35
00:02:38,440 --> 00:02:46,450
Yeah, that is running so just go local host.

36
00:02:47,700 --> 00:02:54,410
And yeah, this is the web page so about.

37
00:02:54,540 --> 00:02:57,160
Yeah, we have two lines now. This was added later.

38
00:02:57,300 --> 00:03:01,590
You can also see the change that I did in the CSS file.

39
00:03:01,590 --> 00:03:04,440
So now the text color is green.

40
00:03:04,560 --> 00:03:10,050
Sometimes you may not see the change, the changes right away, the changes that you do to your CSS file.

41
00:03:10,060 --> 00:03:10,540

42
00:03:11,070 --> 00:03:17,430
In that case you want to press CTR R to clear a case when we reload a web page.

43
00:03:17,730 --> 00:03:20,030
So we're talking about local host now.

44
00:03:20,050 --> 00:03:23,330
Yeah, once you see that.

45
00:03:23,320 --> 00:03:27,190
So the Web site is working well on local host.

46
00:03:27,330 --> 00:03:30,950
So make sure your website is working perfectly.

47
00:03:31,020 --> 00:03:35,240
Then you upload the files to your live server.

48
00:03:35,460 --> 00:03:36,690
So you test things first

49
00:03:36,690 --> 00:03:44,910
in the development environment which is my local computer and then you push those changes to production.

50
00:03:45,570 --> 00:03:47,540
So yeah, I can go ahead and close this.

51
00:03:48,180 --> 00:03:50,860
Let's go ahead and apply the changes to Heroku.

52
00:03:51,060 --> 00:03:58,080
So to do that again you would open a command line in the root directory which is Demo in my case.

53
00:03:58,210 --> 00:04:02,880
That's the directory where my Python file is located.

54
00:04:02,960 --> 00:04:04,600
So you need to log in again.

55
00:04:04,640 --> 00:04:08,780
Heroku login. Enter your credentials.

56
00:04:11,910 --> 00:04:15,940

57
00:04:16,890 --> 00:04:20,150
Alright, so logged in successfully.

58
00:04:20,550 --> 00:04:23,990
And then, you know to make sure that you're connected to the appropriate

59
00:04:24,360 --> 00:04:33,930
Heroku app, you could try Heroku info and that would return Ardit for my case. We suggest that Heroku knows what

60
00:04:34,020 --> 00:04:35,780
app you're pointing to.

61
00:04:35,790 --> 00:04:43,020
So if you don't get any information on this, if Heroku, if you get a message saying that you haven't specified

62
00:04:43,020 --> 00:04:51,390
an app then you know you go ahead and write the command that we used in the last lecture which was Heroku

63
00:04:52,620 --> 00:05:02,070
Git remote and you specify the app flag and then you pass the flag, the app name, sorry. Like that. You execute that 

64
00:05:02,130 --> 00:05:06,320
and than you're connected to the Ardit app in my case.

65
00:05:06,580 --> 00:05:10,330
In your case should be your name that you have specified.

66
00:05:10,710 --> 00:05:16,410
Once you do that then you could try again Heroku info to make sure you get the credentials for that app.

67
00:05:17,010 --> 00:05:17,810

68
00:05:18,050 --> 00:05:21,550
And then you go ahead and add the changes to the Git repository.

69
00:05:21,630 --> 00:05:32,250
So that would be Git add and a dot like that. Execute and you need to commit the changes with Git commit

70
00:05:33,270 --> 00:05:40,350
N flank and then you write something here a note. You know you could say normaly you write in the current

71
00:05:40,380 --> 00:05:54,750
tense which should be add text to about.html. And the other change that we did was change heading color.

72
00:05:54,930 --> 00:05:59,700
So that's the two changes that we made. Execut that.

73
00:06:00,020 --> 00:06:06,510
And yeah, you should see a message here saying that's two files were changed, so we changed the about.html

74
00:06:06,510 --> 00:06:06,530
and the main.css file.

75
00:06:06,540 --> 00:06:12,550
And we inserted two pieces of information.

76
00:06:12,570 --> 00:06:15,640
So the first one was this paragraph line here.

77
00:06:15,660 --> 00:06:17,490
This was added later.

78
00:06:17,970 --> 00:06:25,680
And the next one was 060 that we added in the CSS file. And also deleted something which was 444.

79
00:06:25,920 --> 00:06:26,700

80
00:06:26,730 --> 00:06:33,690
So the previous color that we had for the heading and yeah once you commit the changes you want to push them.

81
00:06:34,710 --> 00:06:37,250
get foolish.

82
00:06:37,830 --> 00:06:38,220
Git push Heroku master.

83
00:06:42,200 --> 00:06:47,690
Alright that was successful so now you can go ahead and open your website.

84
00:06:48,000 --> 00:06:53,370
Yeah, your website should pop up and then you can see that the new changes have been applied.

85
00:06:53,370 --> 00:06:58,500
So we have this dark green color there and the about page

86
00:06:58,570 --> 00:07:00,860
Should also have two pieces of text here.

87
00:07:00,870 --> 00:07:04,440
So two lines and yeah that's about it.

88
00:07:04,870 --> 00:07:08,200
I hope I was clear in explaining this.

89
00:07:08,250 --> 00:07:11,520
It's quite a safe method to apply changes.

90
00:07:11,640 --> 00:07:14,350
I hope you enjoyed this section of the course.

91
00:07:14,450 --> 00:07:17,710
We'll move on. We have more applications to build.

92
00:07:18,030 --> 00:07:22,950
And you have quite a lot of things to learn by building them.

93
00:07:23,520 --> 00:07:25,850
And yeah, I'll see you in the next lectures.

94
00:07:25,950 --> 00:07:26,280
Thanks.

