[PYTHON] Getting Started with Django with PyCharm

I haven't touched Python so much and am quite a beginner, but I will study it little by little.

Django Tutorial

I will proceed while referring to.

Development environment

Project creation

We will proceed on the assumption that Python is already installed.

Start Pycharm> New Project> Select Django

After deciding "Location" and "Interpreter", the project will be created with the "Create" button.

At this time, even if Django is not installed, it will be installed automatically.

The project you just created in PyCharm should look like the following if it is named "mysite".

I won't explain each file in Creating your first Django app, part 1.

Start development server

Launching from PyCharm is simple, just click the "Run" button in the upper right corner of the editor to launch the server.

Starting from Terminal

C: /.../mysite/manage.py runserver port number

But you can.

Then

.
.
Django version 1.10, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/

You'll see something like this, and when you access it, you'll see a page that says "It worked!". The development server is now up and running.

Application creation

Now let's create an application from PyCharm using the mange.py task.

Tools > Run mange.py Task...(Ctrl+Alt+R)

You will see something like a mange.py task command tool under the editor.

manage.py@mysite>

This is the same as doing the python manage.py command in Terminal, and remembering the shortcuts will save you from having to type python manage.py every time in Terminal.

Then the command to automatically generate the application "polls" is

manage.py@mysite>startapp polls

Now in the same directory as manage.py

Is made.

Summary

This makes it easier to develop your Django project with PyCharm.

Subsequent view creation etc. should work if you follow the tutorial.

Recommended Posts

Getting Started with Django with PyCharm
Getting Started with Django 1
Getting Started with Django 2
Getting Started with Python Django (1)
Getting Started with Python Django (4)
Getting Started with Python Django (3)
Getting Started with Python Django (6)
Getting Started with Python Django (5)
Django 1.11 started with Python3.6
Getting started with Android!
1.1 Getting Started with Python
Getting Started with Golang 2
Getting started with apache2
Getting Started with Golang 1
Getting Started with Python
Getting Started with Optimization
Getting Started with Golang 3
Getting Started with Numpy
Getting started with Spark
Getting Started with Python
Getting Started with Pydantic
Getting Started with Golang 4
Getting Started with Jython
Django Getting Started Part 2 with eclipse Plugin (PyDev)
Translate Getting Started With TensorFlow
Getting Started with Python Functions
Getting Started with Tkinter 2: Buttons
Get started with Django! ~ Tutorial ⑤ ~
Getting Started with Go Assembly
Getting Started with PKI with Golang ―― 4
Django Getting Started: 2_ Project Creation
Django Getting Started: 1_Environment Building
Django Getting Started: 4_MySQL Integration
Django Getting Started: 3_Apache integration
Get started with Django! ~ Tutorial ⑥ ~
Python3 | Getting Started with numpy
Getting Started with Git (1) History Storage
Getting started with Sphinx. Generate docstring with Sphinx
Getting Started with Python for PHPer-Classes
Getting Started with Julia for Pythonista
Getting Started with Python Basics of Python
How to get started with Django
Getting Started with Cisco Spark REST-API
Getting started with USD on Windows
Getting Started with Python Genetic Algorithms
Getting started with Python 3.8 on Windows
Getting Started with Python for PHPer-Functions
Getting Started with CPU Steal Time
Getting Started with Heroku-Viewing Hello World in Python Django with Raspberry PI 3
Getting Started with Flask with Azure Web Apps
Getting Started with Python Web Scraping Practice
Internationalization with django
Getting Started with Python for PHPer-Super Basics
Getting Started with Python Web Scraping Practice
Getting started with Dynamo from Python boto
CRUD with Django
Getting Started with Lisp for Pythonista: Supplement
Getting Started with Heroku, Deploying Flask App
Getting Started with TDD with Cyber-dojo at MobPro
Grails getting started
Getting started with Python with 100 knocks on language processing