Category: Django

Docker – uwsgi – nginx – Django

 1. Assume – Docker is already installed [Link] – Django & it’s project is ready [Link] – Postgres or MySQL is ready [Link] – Python3 – CentOS 7   2. Install Packages yum install uwsgi yum install nginx  3. Create Uwsgi conf file – Location : doesn’t matter , where you want.. – Name : […]

Read more

Apache – Django

A. Install packages [python 2.7] yum install httpd yum install httpd-devel yum install python-pip pip install django yum install mod_wsgi # case of python 2.7 [python 3.X] yum install pcre-devel wget http://mirrors.koehn.com/apache//httpd/httpd-2.4.23.tar.gz tar xvzf httpd-2.4.23.tar.gz  configure make install download site : https://github.com/GrahamDumpleton/mod_wsgi/releases wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.7.tar.gz tar xvzf 4.5.7.tar.gz cd /<extract path> ./configure –with-apxs=/usr/local/apache2/bin/apxs make install B. Create Django Project django-admin […]

Read more

Django reset migration

If you want to remove all database migration settings and start from zero base you can use “migrate –fake”. Follow the bellow process will helps you to reset your jango database env. [delete migration file] go to your app folder then you will see folder name “migration” delete all the contents inside that folder except […]

Read more

DJango – templates & static

가. 시작하기 장고에서 뷰를 개발하려고 하면 통상적으로 필요한 것이  html, js, css, img 정도가 될 것이다. 그럼 장고에서는 이러한 파일들을 어떻게 관리하고 개발하는지 세팅 부분까지만 정리하고자 한다 나. template 정의하기 [setting.py] DIRS 부분에 templates 폴더의 위치를 지정해 준다. TEMPLATES = [ { ‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’, ‘DIRS’: [os.path.join(BASE_DIR, ‘tfmsaview/templates/’)], ‘APP_DIRS’: True, ‘OPTIONS’: { ‘context_processors’: [ ‘django.template.context_processors.debug’, ‘django.template.context_processors.request’, […]

Read more

Python – postgresql – Django – REST – TensorFlow 서비스 개발(2)

가. 지금까지 완료 된 것 – 1부 링크  : http://wp.me/p7xrpI-9h – Anaconda 설치 – TensorFlow 설치 – Pycharm 설치 – postgresql 설치 – Django 설치 – Django Service 생성 – snippets APP 생성 완료 – Snippet Model 생성 – postgresql  동기화 완료 나.  Serializer 우리가 위에서 정의한  Snippet 데이터 클레스를 받아서  JSON 데이터로 변환하거나 , […]

Read more

Python – postgresql – Django – REST – TensorFlow 서비스 개발(1)

Anaconda , Django, Djangorestframework, Tensorflow, postgres 환경에서 REST API 호출을 통해  간단한 Tensorflow 예제를 실행하고 결과를 리턴하는 것까지 설명하고자 한다. Spark 연동 및 Tensorflow Serving 을 연동하는 부분은 따로 설명하겠다 [링크] Anaconda – PyCharm – Tensorflow  환경 구성 : http://wp.me/p7xrpI-8Q 가. Anaconda sub Library Install virtualenv 설정은 사용하지 않고 바로 설치하고 진행 [Django 설치] conda […]

Read more