Easy-to-understand explanation of Python Web application (Django) even for beginners (1) [Environment construction]

Composition of commentary articles

No. title
1 Easy-to-understand explanation of Python Web application (Django) even for beginners (1) [Environment construction]
2 Easy-to-understand explanation of Python Web application (Django) even for beginners (2) [Project creation]
3 Easy-to-understand explanation of Python Web application (Django) even for beginners (3) [Application creation / DB setting]
4 Easy-to-understand explanation of Python web application (Django) even for beginners (4) [Routing settings / Introduction to MTV design patterns]
5 Easy-to-understand explanation of Python Web application (Django) even for beginners (5) [Introduction to DB operation with Django shell]
6 Easy-to-understand explanation of Python web application (Django) even for beginners (6) [MTV design pattern completion]

Introduction

logo_horizontal.png

This article is for those who have already touched programming languages such as Python and Ruby, but have never created a web application or have touched Django.

When I look at web applications, PHP and Ruby often come up, but I feel that Python is still superior when performing complex mathematical operations such as machine learning. I used to write an application with Ruby on Rails and incorporate the mathematical calculation part in R language, but it took some time to build a pipe connecting the languages. In that respect, Python is recommended when creating web applications that include various mathematical tricks.

However, when compared to PHP and Ruby web applications, Python web applications seem to lack references. I will explain how to create a web application in Python from the beginning to the end easily and not too long.

This time, we'll use Django as the framework for our web application. In addition to Django, there are lightweight and simple frameworks such as Bottle and Flask, but I want it to be a web framework that can withstand practical applications like Ruby on Rails, so Python for Ruby on Rails I chose the version (I think) of Django. Learn more about Django's strengths. [Understanding in 5 minutes] What is Python and the WEB framework "Django"

If you can use Django, it will be easier to learn Bottle and Flask, but the opposite is probably difficult. I think that easy for beginners is not so easy to explain, but to know a standard that is easy to absorb various things in future use, so in that respect Django is a framework for Python web applications. Isn't it perfect?

Please be assured that the explanation part will be summarized as easily as possible on this side.

Thank you for your cooperation!

If you find this article helpful, I would be grateful if you could like this article.

About the author

02.jpg

I am ** Kikagaku Co., Ltd. ** Representative Director ** Ryosuke Yoshizaki ** My name is. Currently, "** Machine Learning / Artificial Intelligence De-Black Box Seminar **" and "** Machine Learning Online Tutor ** ”is operated.

Biography

Affiliation Department / Department research content Punishment
Maizuru National College of Technology Department of Electronic Control Engineering Study image processing (AR)
Maizuru National College of Technology Department of Electrical and Control Systems Engineering Research on robotics, system control, and optimization
Kyoto University Graduate School Graduate School of Informatics (Kano Lab Appliedresearchonmachinelearningforthemanufacturingindustry ADCHEM2016BestPaperAward,ChemicalEngineeringSocietyTechnologyAward
SHIFT Inc. President's office Research on software test automation by artificial intelligence CEDEC 2016 stage
Carat Co., Ltd. Director and COO Optimal itinerary proposal app (natural language processing / optimization)
Kikagaku Co., Ltd. PresidentandCEO Machinelearning/artificialintelligenceseminarOrOnlinetutor

Kikagaku Co., Ltd.

logo_horizontal.png

Providing educational services for machine learning and artificial intelligence

** Machine Learning / Artificial Intelligence De-Black Box Seminar ** slide1-1.png

** Machine learning online tutor ** slide2.png

We look forward to your follow-up

We provide information on machine learning and artificial intelligence from a business perspective and recommended reference books.

President and CEO Ryosuke Yoshizaki Twitter:@yoshizaki_kkgk Facebook:@ryosuke.yoshizaki Blog: Blog of Kikagaku representative

Development environment

We will proceed on the premise of a Mac environment.

Check the Python version as follows.

$ python3 --version
Python 3.5.2

I don't think there is a big difference depending on the minor version, but at least make sure to use Python 3 series.

Building a virtual environment

There are system settings for each web application, and if you set various web application settings on one PC, it may be affected by the settings of other applications. Therefore, Python introduces a virtual environment so that each application has an independent setting. If you know Ruby on Rails, this area is a natural feeling.

Creating a directory

First, create a folder for the web application in the current directory (folder in Windows).

Move after creating directory for application


$ mkdir sample_app
$ cd sample_app

Create a virtualenv called `` `myvenv``` in this directory.

Create a virtual environment


$ python3 -m venv myvenv

If this command passes, you should have created a directory named `` `myenv``` in the directory.

Confirm that the virtual environment has been created


$ ls
myvenv
スクリーンショット 2016-11-09 1.58.40.png

Is this kind of directory structure created?

By the way, I use the command `` `tree``` to output this directory structure, and it can be easily installed via Homebrew. I will.

installation of tree


$ brew install tree

The tree displays the contents of the directory. See the Qiita: tree command for tree options.

Check the directory contents with tree


$ tree -L 1 myvenv
myvenv
  ├── bin
  ├── include
  ├── lib
  └── pyvenv.cfg

Virtual environment settings

Before you start setting up the virtual environment, move to the directory of the virtual environment you created.

Directory move


$ cd myenv
$ ls
bin   include   lib   pyvenv.cfg

This time, I'll use version 1.8 for the tutorial on Django Girls.

Django installation


$ pip3 install django==1.8
Collecting django==1.8
  Downloading Django-1.8-py2.py3-none-any.whl (6.2MB)
    100% |████████████████████████████████| 6.2MB 111kB/s
Installing collected packages: django
      Successfully uninstalled Django-1.9.1
Successfully installed django-1.8

This completes the virtual environment settings. It's very easy.

Next commentary article

Explanation of Python Web application (Django) in an easy-to-understand manner even for beginners (2) [Project creation]

References

in conclusion

If you feel that "** that difficult mathematical formulas and programming are difficult by self-study **" when learning machine learning, we are waiting for you at our seminar or online tutor.

** Machine Learning / Artificial Intelligence De-Black Box Seminar ** slide1-1.png

** Machine learning online tutor ** slide2.png

We look forward to your follow-up

We provide information on machine learning and artificial intelligence from a business perspective and recommended reference books.

President and CEO Ryosuke Yoshizaki Twitter:@yoshizaki_kkgk Facebook:@ryosuke.yoshizaki Blog: Blog of Kikagaku representative

Until the end Thank you for reading.

Recommended Posts

Easy-to-understand explanation of Python Web application (Django) even for beginners (1) [Environment construction]
Easy-to-understand explanation of Python Web application (Django) even for beginners (2) [Project creation]
Easy-to-understand explanation of Python Web application (Django) even for beginners (3) [Application creation / DB setting]
Easy-to-understand explanation of Python web application (Django) even for beginners (6) [MTV design pattern completion]
Easy-to-understand explanation of Python Web application (Django) even for beginners (5) [Introduction to DB operation with Django shell]
Easy-to-understand explanation of Python web application (Django) even for beginners (4) [Routing settings / Introduction to MTV design patterns]
Python3 environment construction (for beginners)
Web application made with Python3.4 + Django (Part.1 Environment construction)
[For beginners] Django -Development environment construction-
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
Python environment construction For Mac
Environment construction of python2 & 3 (OSX)
[For beginners] Summary of standard input in Python (with explanation)
Environment construction of python and opencv
Environment construction of python3.8 on mac
Python3 TensorFlow for Mac environment construction
Beginners use Python for web scraping (1)
Beginners use Python for web scraping (4) ―― 1
Web application created with Python + Flask (using VScode) # 1-Virtual environment construction-
[Python] Minutes of study meeting for beginners (7/15)
Python project environment construction procedure (for windows)
WEB application development using django-Development environment construction-
[Python] Web application design for machine learning
[Python] Web application from 0! Hands-on (0) -Environmental construction-
[For beginners] Try web scraping with Python
Procedure from AWS CDK (Python) development to AWS resource construction * For beginners of development
Explanation of creating an application for displaying images and drawing with Python
Automatic posting of web design gary site with python + selenium (1) Environment construction
Learning history for participating in team application development in Python ~ Supplement of basic items and construction of jupyterLab environment ~
Django environment construction
Python environment construction
Environment construction (python)
django environment construction
Cloud9 environment construction for developing serverless web applications
Installation of Python3 and Flask [Environment construction summary]
[Python] Web application from 0! Hands-on (1) -Design, DB construction-
Poetry-virtualenv environment construction with python of centos-sclo-rh ~ Notes
python environment construction
Python --Environment construction
Python environment construction
[Django3] Environment construction and various settings summary [Python3]
Try creating a web application with Vue.js and Django (Mac)-(1) Environment construction, application creation
python environment construction
[Python] Beginners troubleshoot while studying Django web applications
Basic story of inheritance in Python (for beginners)
[Cloud9] Try to build an environment with django 1.11 of Python 3.4 without understanding even 1 mm
(Python) Try to develop a web application using Django
Summary of python environment settings for myself [mac] [ubuntu]
Summary of pre-processing practices for Python beginners (Pandas dataframe)
Memorandum of understanding for environment construction of AutoML library PyCaret
Building a Python environment for programming beginners (Mac OS)
Explanation of NoReverseMatch error in "python django super introduction"
Beginners use Python for web scraping (4) --2 Scraping on Cloud Shell
Django python web framework
Django project environment construction
Unification of Python environment
homebrew python environment construction
Python development environment construction
python textbook for beginners
python2.7 development environment construction
Mac environment construction Python