I haven't programmed at work or at home recently, so I felt a little crisis, so I couldn't study or rehabilitate. I decided to give Django a try.
It was done by referring to Django's Documentation.
Installation is completed by executing the following command.
dos
python -m pip install Django
Check once the installation is complete. Execute the following on the python command line.
pythoncmd
>>> import django
>>> print(django.get_version())
3.0.1
If the result of print (django.get_version ())
shows the version of Django such as 3.0.1
, it's OK.
At the command prompt, change to the directory where you want to create the app. Then execute the following command.
cmd
django-admin startproject <app name>
Enter any app name for <app name>
.
At the command prompt, a directory with <app name>
will be created in the current directory, so move to that directory.
After moving, execute the following command.
cmd
python manage.py runserver
Then the server will start, so open a browser and access http://127.0.0.1:8000
.
Success if you can access it safely.
The screen shown below is displayed.
The command prompt looks like the figure below.
that's all.
By the way, this server is prepared for development, so it seems that it should not be used in production operation. (Document talk)
I created a demo app, but I didn't code it because I didn't change anything from the automatically created code. I'm going to do it now, I'll heal. : rolling_eyes:
The article is messy because the time is a little late. I have to make it a little easier to understand. : weary: → 2019/12/28 I added a screen because the operation check part was rough. : muscle:
Recommended Posts