'Python'에 해당되는 글 2건

  1. 2020.11.18 Linux/ubuntu/python3.7 설치
  2. 2020.07.13 Django/static files 경로 작성하기

tecadmin.net/install-python-3-7-on-ubuntu-linuxmint/

 

How To Install Python 3.7 on Ubuntu, Debian & LinuxMint - TecAdmin

How to Install Python 3.7.4 on Ubuntu & LinuxMint. Step by Step instructions to install Python 3.7 on Ubuntu, Debian, and LinuxMint Systems.

tecadmin.net

 

$ sudo apt update && sudo apt upgrade

$ cd /usr/src
$ sudo wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz

$ sudo tar xzf Python-3.7.9.tgz

$ cd Python-3.7.9

$ sudo ./configure --enable-optimizations

$ sudo make altinstall

$ python3.7 -V

 

 

이제 python 치면 설치한 파이썬이 실행 하도록 링크를 설정합니다.

$ sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/python

 

'Documents > 개발 노트' 카테고리의 다른 글

Linux/Ubuntu 18.04 LTS 설치 [Raspberray Pi 4]  (0) 2020.11.18
Linux/백그라운드 실행  (0) 2020.10.07
Ubuntu/nvidia-docker 설치  (0) 2020.08.31
Ubuntu/Nvidia version 확인  (2) 2020.08.31
Ubuntu/Docker 설치  (0) 2020.08.25
Posted by 치킨놈
:

개발 환경

OS : macOS Catalina

python ver : 3.7.8

django ver : 3.0.8

Terminal env.


project/settings.py

STATICFILES_DIRS = (
	os.path.join(BASE_DIR, "static"),
	'/var/www/static',
)

static file(css,js,이미지,영상 등)을 한 폴더에 관리하기 위한 설정입니다.

static폴더에 없을시 '/var/www/static' 폴더에서 찾게 됩니다.

-

templates/base.html

{% load static %}
<!DOCTYPE html>

<html>
	<head>
		<meta name...>
		<link rel="stylesheet" href="{% static 'css/style.css' %}">
	</head>
    .
    .
    .

templates의 첫줄에 static을 불러오고

link할때 경로를 지정합니다.

-

'Documents > 개발 노트' 카테고리의 다른 글

Ubuntu/nvidia-docker 설치  (0) 2020.08.31
Ubuntu/Nvidia version 확인  (2) 2020.08.31
Ubuntu/Docker 설치  (0) 2020.08.25
Linux/SSH/MobaXterm 접속하기  (0) 2020.08.25
Django/Http 404 error 발생시키기  (0) 2020.08.07
Posted by 치킨놈
: