Start a Django project from scratch : Hello World

Meraj al Maksud
1 min readSep 9, 2022

--

  1. Install prerequisites
$ sudo apt update
$ sudo apt install python3 python3-pip python3-venv

2. Create project directory

$ mkdir myDjangoProject

3. Create a virtual environment

$ cd myDjangoProject
$ python -m venv venv

4. Activate the environment

$ source venv/bin/activate
(myDjangoProject) $

Note: Deactivate the environment

(myDjangoProject) $ deactivate

5. Install Django

$ pip install django

6. Start a new project

$ django-admin startproject project1

7. Run the new project

$ cd project1
$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
December 17, 2022 - 10:14:44
Django version 4.1.4, using settings 'project1.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

8. Enter the url http://localhost:8000/ from any browser. Following page should appear:

Next: https://merajmasuk.medium.com/ready-database-for-django-2e6e4680c32c

--

--

Meraj al Maksud
Meraj al Maksud

Written by Meraj al Maksud

Student of Computer Science & Engineering at Jahangirnagar University

No responses yet