I challenged a simple voting WEB application tutorial using django, which is one of the WEB application frameworks that is interested in WEB applications and can be easily created.
--python is premised on installation --Install pip --Install Django --Install virtualenv
――Pip is a tool that makes it easy to install various packages. --Download pip (executed at command prompt, cmd below)
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Get-pip.py is stored in the directory where the command is executed. * By default, it is under the user
--Installing pip
python get-pip.py
If "Successfully installed ..." is displayed, the installation is complete.
--Virtualenv is software for running virtual environment. This time I'll run Django in a virtual environment. --Install virtualenv
pip install virtualenv
--Create a virtual environment
It can be anywhere, but prepare a "Python" folder in advance. This time, create it directly under the C drive. After creating, move to the directory with cmd.
cd C:\Python
Once moved, create a virtual environment.
virtualenv env1
When the creation is complete, change to the "env1" directory.
cd env1
Once moved, activate the virtual environment.
Scripts/activate
Once enabled, you should see something like this:
(env1) C:\Python\env1>
--Install Django.
Make sure that the virtual environment is enabled before executing.
pip install django
If "Successfully installed ..." is displayed, the installation is complete.
--Confirm that Django is installed successfully
pip freeze
The version of Django and other related software will be output as shown below.
asgiref==3.2.10
Django==3.1
pytz==2020.1
sqlparse==0.3.1
--Exit the command prompt After confirming the above, exit the command prompt once.
Disable the virtual environment.
deactivate
Exit the command prompt.
exit
--Confirmation that it works normally (implemented with cmd)
Change to the directory.
cd C:\Python\env1
Once moved, activate the virtual environment. Scripts/activate
Once enabled, put it in interactive mode (interpreter).
python
Once launched, import Django. Type the following commands, and then press Enter line by line.
>import django
>print(django.get_version())
If the Django version is displayed as shown below, the operation check is complete.
3.1
I will use VScode from the next time. WEB application development using django-development 1- ** >>> **
Recommended Posts