Django Installation and Quickstart and PyCharm Setup

Steven Wang
1 min readOct 9, 2020

--

Installation

Create an environment

Create a project folder and a venv folder within:

$ mkdir myproject
$ cd myproject
$ python3 -m venv venv

Activate the environment

Before you work on your project, activate the corresponding environment:

$ . venv/bin/activate

Install Django

$ python3 -m pip install Django

Check 是否安裝完成

python
>>>import django
>>>print(django.get_version())

Quickstart

Creating a project

$ django-admin startproject mysite

The development server

python manage.py runserver

安裝PyCharm

Terminal內啟動venv

安裝新版Python
PyCharm>Perference>Project:project_name>Python Interpreter>選Python新版

設定Edit Configrations

Configrations可以設定python3 manage.py runserver使用

--

--

Steven Wang
Steven Wang

No responses yet