-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
467 lines (286 loc) · 22.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" >
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="JunGi Park">
<title>JunGi Park</title>
<meta name="author" content="JunGi Park">
<link rel="alternate" type="application/atom+xml" title="RSS" href="/atom.xml">
<meta name="description">
<meta property="og:type" content="blog">
<meta property="og:title" content="JunGi Park">
<meta property="og:url" content="https://jungipark.github.com/index.html">
<meta property="og:site_name" content="JunGi Park">
<meta property="og:description">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="JunGi Park">
<meta name="twitter:description">
<!--STYLES-->
<link rel="stylesheet" href="/assets/css/style-quwccsthbllipo6252snb2tfkddvrsp1eczkytpz3vmxpsb6nwodixemlkux.min.css">
<!--STYLES END-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-74367013-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="blog">
<!-- Define author's picture -->
<header id="header" data-behavior="1">
<i id="btn-open-sidebar" class="fa fa-lg fa-bars"></i>
<h1 class="header-title">
<a class="header-title-link" href="/ ">JunGi Park</a>
</h1>
<a class="header-right-picture "
href="#about">
</a>
</header>
<!-- Define author's picture -->
<nav id="sidebar" data-behavior="1">
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link "
href="/ "
>
<i class="sidebar-button-icon fa fa-lg fa-home"></i>
<span class="sidebar-button-desc">Home</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link "
href="/all-categories"
>
<i class="sidebar-button-icon fa fa-lg fa-bookmark"></i>
<span class="sidebar-button-desc">Categories</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link "
href="/all-tags"
>
<i class="sidebar-button-icon fa fa-lg fa-tags"></i>
<span class="sidebar-button-desc">Tags</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link "
href="/all-archives"
>
<i class="sidebar-button-icon fa fa-lg fa-archive"></i>
<span class="sidebar-button-desc">Archives</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link "
href="#about"
>
<i class="sidebar-button-icon fa fa-lg fa-question"></i>
<span class="sidebar-button-desc">About</span>
</a>
</li>
</ul>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://github.com/jungipark" target="_blank">
<i class="sidebar-button-icon fa fa-lg fa-github"></i>
<span class="sidebar-button-desc">GitHub</span>
</a>
</li>
<li class="sidebar-button">
<a class="sidebar-button-link " href="https://facebook.com/vins103" target="_blank">
<i class="sidebar-button-icon fa fa-lg fa-facebook"></i>
<span class="sidebar-button-desc">Facebook</span>
</a>
</li>
</ul>
<ul class="sidebar-buttons">
<li class="sidebar-button">
<a class="sidebar-button-link "
href="/atom.xml"
>
<i class="sidebar-button-icon fa fa-lg fa-rss"></i>
<span class="sidebar-button-desc">RSS</span>
</a>
</li>
</ul>
</nav>
<div id="main" data-behavior="1"
class="
hasCoverMetaIn
">
<section class="postShorten-group main-content-wrap">
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="/2016/08/05/flask-example-structure/">
python flask의 기본 구조
</a>
</h1>
<div class="postShorten-meta">
<time itemprop="datePublished" content="Fri Aug 05 2016 00:00:00 GMT+0900">
Aug 05, 2016
</time>
<span>in </span>
<a class="category-link" href="/categories/flask/">flask</a>
</div>
</div>
<div class="postShorten-content" itemprop="articleBody">
<h3 id="Python-Web-Framework-Flask"><a href="#Python-Web-Framework-Flask" class="headerlink" title="Python Web Framework Flask"></a>Python Web Framework Flask</h3><p><a href="http://flask.pocoo.org/" target="_blank" rel="external">flask</a>는 파이썬의 web framework입니다.<br>flask는 Django와 함께 대표적인 python web framework 입니다. 파이썬 framework의 경우 Django가<br>유명하지만, Django와 flask의 경우 다른 철학을 가지고 만들어진 framework 입니다.</p>
<p>두 framkwork에 대한 비교는 인터넷에 많이 나와 있으니, 원래 주제인 flask의 기본 구조에 대해서 이야기<br>하겠습니다.</p>
<p>flask는 micro framework이기 때문에 자유로운 구조를 가지고 있습니다. 하지만 flask를 이용한<br>프로젝트가 어느정도 커지기 시작하면, flask 프로젝트 구조의 best practice는 무엇인가에 대한 고민이<br>생깁니다.</p>
<p>그런 고민들 하던중, 몇 가지 프로젝트를 참고하여 지금 사용하고 있는 구조 입니다.</p>
<p>project-example<br> |<br> — app<br> |<br> — api<br> — auth<br> — common<br> — db<br> — static<br> — templates<br> — view<br> — __init__.py<br> — app.py<br> — config.py<br> — project-example.wsgi<br> — manager.py</p>
<p>위와 같은 구조를 가지고 있습니다.</p>
<p>추후 계속…….ㅎㅎ</p>
<p>
<a href="/2016/08/05/flask-example-structure/#post-footer" class="postShorten-excerpt_link link">
Comment and share
</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="/2016/08/04/2016-08-04-letsEncryptNginxSSL/">
Let's Encrypt 를 이용한 무료 ssl 인증서
</a>
</h1>
<div class="postShorten-meta">
<time itemprop="datePublished" content="Thu Aug 04 2016 15:25:05 GMT+0900">
Aug 04, 2016
</time>
<span>in </span>
<a class="category-link" href="/categories/server/">server</a>
</div>
</div>
<div class="postShorten-content" itemprop="articleBody">
<p>Les’t Encrypt를 이용하면 ssl을 무료로 적용할 수 있습니다.</p>
<p>3개월이라는 짧은 주기로 갱신해줘야 하는 불편함이 있지만, 편리한 tools을 이용한 명령어 한줄로 간단하게 갱신할 수 있기 때문에 단점보다 장점이 많은 것 같습니다.</p>
<p>또한, multi-subdomain ssl 인증서를 사용하려면 최소 일년에 60불 정도는 지출 되는데, Les’t Encrypt를 이용하면 무료로 원하는 sub domain를 이용할 수 있습니다.</p>
<script src="//gist.github.com/2f1263a8678a3b7704b8c7ca90db424e.js"></script>
<p>위의 코드를 통해서 간단하게, ssl를 인증서를 다운 받고 적용할 수 있습니다.</p>
<p>참고 사이트<br><a href="https://letsencrypt.org/" target="_blank" rel="external">Let’s Encrypt</a> : 공식 사이트<br><a href="https://certbot.eff.org/" target="_blank" rel="external">certbot</a> : Let’s Encrypt를 간편하게 사용할 수 있는 tools(공식 사이트에서도 이것으로 안내함)</p>
<p>한국어 참고 자료<br><a href="https://okdevtv.com/mib/letsencrypt" target="_blank" rel="external">https://okdevtv.com/mib/letsencrypt</a><br><a href="https://blog.outsider.ne.kr/1178" target="_blank" rel="external">https://blog.outsider.ne.kr/1178</a></p>
<p>
<a href="/2016/08/04/2016-08-04-letsEncryptNginxSSL/#post-footer" class="postShorten-excerpt_link link">
Comment and share
</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="/2016/04/04/2016-04-04-windows-pip-userbase import error/">
windows7 pip user_base import error
</a>
</h1>
<div class="postShorten-meta">
<time itemprop="datePublished" content="Mon Apr 04 2016 00:00:00 GMT+0900">
Apr 04, 2016
</time>
<span>in </span>
<a class="category-link" href="/categories/python/">python</a>
</div>
</div>
<div class="postShorten-content" itemprop="articleBody">
<p>windows python pip import user_base error </p>
<p>윈도우랑 파이썬이랑 상당히 조합이 안좋다..<br>하지만 회사처럼 꼭 써야하는 환경에서는 고쳐서 사용해야합니다.<br>저는 systempath 문제로 상당히 고생을 했습니다.</p>
<p>처음에 깔면 잘 잡히던 path가 어느순간 갑자기 안잡히면서 pip 부터 site-packages를 인식하지 못해 못 쓰게 되었습니다.<br>import user_base error</p>
<h3 id="anaconda2사용"><a href="#anaconda2사용" class="headerlink" title="anaconda2사용"></a>anaconda2사용</h3><p>저는 anaconda2를 사용했습니다.</p>
<p>설치위치<br><figure class="highlight less"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">D</span>:\anacoda2;</span><br></pre></td></tr></table></figure></p>
<h4 id="user-variables-설정"><a href="#user-variables-설정" class="headerlink" title="user variables 설정"></a>user variables 설정</h4><h5 id="1-사용자-환경변수에서-아래와-같이-설정을-해준다"><a href="#1-사용자-환경변수에서-아래와-같이-설정을-해준다" class="headerlink" title="1. 사용자 환경변수에서 아래와 같이 설정을 해준다."></a>1. 사용자 환경변수에서 아래와 같이 설정을 해준다.</h5><figure class="highlight less"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">변수 : <span class="selector-tag">PATH</span>에 추가(없으면 생성)</span><br><span class="line">값 : <span class="selector-tag">D</span>:\<span class="selector-tag">anacoda2</span>; <span class="attribute">D</span>:\anacoda2\Scripts;</span><br></pre></td></tr></table></figure>
<h4 id="system-variable-설정"><a href="#system-variable-설정" class="headerlink" title="system variable 설정"></a>system variable 설정</h4><h5 id="2-PYTHONPATH-설정"><a href="#2-PYTHONPATH-설정" class="headerlink" title="2. PYTHONPATH 설정"></a>2. PYTHONPATH 설정</h5><figure class="highlight tex"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">변수 : PYTHONPATH(생성)</span><br><span class="line">값 : D:<span class="tag">\<span class="name">anacoda</span></span>2<span class="tag">\<span class="name">Lib</span></span><span class="tag">\<span class="name">site</span></span>-packages;D:<span class="tag">\<span class="name">anacoda</span></span>2<span class="tag">\<span class="name">Lib</span></span><span class="tag">\<span class="name">site</span></span>-packages<span class="tag">\<span class="name">Pythonwin</span></span>;D:<span class="tag">\<span class="name">anacoda</span></span>2<span class="tag">\<span class="name">Lib</span></span><span class="tag">\<span class="name">site</span></span>-packages<span class="tag">\<span class="name">Sphinx</span></span>-1.3.5-py2.7.egg;D:<span class="tag">\<span class="name">anacoda</span></span>2<span class="tag">\<span class="name">Lib</span></span><span class="tag">\<span class="name">site</span></span>-packages<span class="tag">\<span class="name">setuptools</span></span>-20.3-py2.7;D:<span class="tag">\<span class="name">anacoda</span></span>2<span class="tag">\<span class="name">Lib</span></span><span class="tag">\<span class="name">site</span></span>-packages<span class="tag">\<span class="name">win</span></span>32;D:<span class="tag">\<span class="name">anacoda</span></span>2<span class="tag">\<span class="name">Lib</span></span><span class="tag">\<span class="name">site</span></span>-packages<span class="tag">\<span class="name">win</span></span>32<span class="tag">\<span class="name">lib</span></span>;</span><br></pre></td></tr></table></figure>
<p>을 넣어준다. (이것은 anaconda2를 깔면 잡히는 기본적인 세팅입니다.)</p>
<h5 id="3-PYTHONUSERBASE-설정"><a href="#3-PYTHONUSERBASE-설정" class="headerlink" title="3. PYTHONUSERBASE 설정"></a>3. PYTHONUSERBASE 설정</h5><p>cmd 에서 python -m site 명령을 실행했을때, 아래 부분 USER_BASE, USER_SITE 부분에서 에러가 난다면 이 부분을 고쳐야 합니다.<br><figure class="highlight aspectj"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">변수 : PYTHONUSERBASE(생성)</span><br><span class="line">값 : D:\anacoda2</span><br></pre></td></tr></table></figure></p>
<h5 id="4-PYTHONUSERSITE-설정"><a href="#4-PYTHONUSERSITE-설정" class="headerlink" title="4. PYTHONUSERSITE 설정"></a>4. PYTHONUSERSITE 설정</h5><p>이부분은 위와 같은 환경 변수를 설정하고 나면 USER_SITE 주소는 D:\anacoda2\python27\site-packages 처럼 이상하게 잡힐것입니다.<br>그런경우에는 python\lib\site.py (나의경우 D:\anacoda2\Lib\site.py )<br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">255</span> <span class="comment">#USER_SITE = get_path('purelib', '%s_user' % os.name) //주석처리</span></span><br><span class="line"><span class="number">256</span> USER_SITE = <span class="string">'D:\\anacoda2\Lib\site-packages'</span> //site-packages 주소를 입력</span><br><span class="line"><span class="number">257</span> <span class="keyword">return</span> USER_SITE</span><br></pre></td></tr></table></figure></p>
<p>위의 방법으로 하면 pip path가 D:\anacoda2\Lib\site-packages 으로 잡히고, pip를 다시 사용할수 있을 것입니다.</p>
<p>
<a href="/2016/04/04/2016-04-04-windows-pip-userbase import error/#post-footer" class="postShorten-excerpt_link link">
Comment and share
</a>
</p>
</div>
</div>
</article>
<article class="postShorten postShorten--thumbnailimg-bottom" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
<a class="link-unstyled" href="/2016/03/25/2016-03-25-python-liux-screenshot/">
리눅스에서 파이썬으로 스크린샷 찍기
</a>
</h1>
<div class="postShorten-meta">
<time itemprop="datePublished" content="Fri Mar 25 2016 00:00:00 GMT+0900">
Mar 25, 2016
</time>
<span>in </span>
<a class="category-link" href="/categories/python/">python</a>
</div>
</div>
<div class="postShorten-content" itemprop="articleBody">
<p>리눅스에서 주기적으로 어떤 화면에 대한 스크린샷을 찍을때</p>
<h3 id="필요한-라이브러리"><a href="#필요한-라이브러리" class="headerlink" title="필요한 라이브러리"></a>필요한 라이브러리</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo yum install firefox Xvfb libXfont Xorg</span><br><span class="line">pip install pyvirtualdisplay</span><br><span class="line">pip install selenium</span><br></pre></td></tr></table></figure>
<h2 id="예제코드"><a href="#예제코드" class="headerlink" title="예제코드"></a>예제코드</h2><script src="//gist.github.com/89c8ea48a28524c8574ad1c7f17c1fe4.js"></script>
<p>이 스크립트를 crontab을 이용해서 실행.</p>
<p>
<a href="/2016/03/25/2016-03-25-python-liux-screenshot/#post-footer" class="postShorten-excerpt_link link">
Comment and share
</a>
</p>
</div>
</div>
</article>
<div class="pagination-bar">
<ul class="pagination">
<li class="pagination-number">page 1 of 1</li>
</ul>
</div>
</section>
<footer id="footer" class="main-content-wrap">
<span class="copyrights">
Copyrights © 2016 JunGi Park. All Rights Reserved.
</span>
</footer>
</div>
</div>
<div id="about">
<div id="about-card">
<div id="about-btn-close">
<i class="fa fa-remove"></i>
</div>
<h4 id="about-card-name">JunGi Park</h4>
<h5 id="about-card-bio"><p>author.bio</p>
</h5>
<h5 id="about-card-job">
<i class="fa fa-briefcase"></i>
<br/>
<p>Sofeware Enginner</p>
</h5>
<h5 id="about-card-location">
<i class="fa fa-map-marker"></i>
<br/>
Seoul, Korea
</h5>
</div>
</div>
<div id="cover" style="background-image:url('/assets/images/cover.jpg');"></div>
</body>
<!--SCRIPTS-->
<script src="/assets/js/scrip-rjanlllosg30d03qrddpwrs6wqf4k3v0bbo68hiifuvthyhqfefx2htcagu0.min.js"></script>
<!--SCRIPTS END-->
</html>