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.
If you find this article helpful, I would be grateful if you could like this article.
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.
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 |
Providing educational services for machine learning and artificial intelligence
・ ** Machine Learning / Artificial Intelligence De-Black Box Seminar **
・ ** Machine learning online tutor **
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
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.
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.
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
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
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.
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 **
・ ** Machine learning online tutor **
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