আগামী ৩০ সেপ্টেম্বর থেকে Professional web Design and Development with HTML, CSS, JAVASCRIPT, PHP, MySQL, JQUERY and AJAX কোর্স এর ৯৪ তম ব্যাচ এবং ২৭ সেপ্টেম্বর থেকে Zend (PHP 7.1) Certified PHP Engineering (ZCPE) কোর্স এর ৪৪ তম ব্যাচ শুরু হতে যাচ্ছে। সীমিত সংখ্যক আসন বাকি আছে। আগ্রহীদেরকে অতিসত্বর মাসুদ আলম স্যার এর সাথে যোগাযোগ করার জন্য অনুরোধ করা যাচ্ছে। স্যার এর মোবাইল নম্বর : ০১৭২২ ৮১ ৭৫ ৯১


This tutorial will be relatively short. We will see only the installation part of Django. Now the question is, what is Django?


What is Django?
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

First install Django from your command prompt. Open your command prompt and run the following command:

$ pip install django
Downloading/unpacking django==1.8
Installing collected packages: django
Successfully installed django
Cleaning up...

Let’s create a new folder called “django” anywhere you want. And go to that folder with your console. Run the following command. Don’t forget give the dot(.).

$ django-admin startproject blog .

The following files have created inside django folder.

1 blog setup

manage.py: is a script that helps with management of the site. With it we will be able to start a web server on our computer without installing anything else, amongst other things.

settings.py: file contains the configuration of your website.

urls.py: file contains a list of patterns used by urlresolver.

Now open settings.py with your IDE. Add the STATIC_ROOT just after the STATIC_URL.

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

The following lines contain the database configuration. We are using sqlite3 for our database. db.sqlite3 is our first database and the location will be our project directory.

    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),

Now run the following command to create our database and tables.

$ python manage.py migrate

If everything is OK, you should see something like the following –

2 django_migrate

You may see the following changes happened in your installation directory.

3 blog_db_sqlite3

Yes. db.sqlite3 has created, right! But it contains? Right..

Firefox has a wonderful add-on for SQLite called, “SQLite Manager”. You can download it from https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/

Add it to your Firefox and open db.sqlite3 –

4 sqlite_manager

Total 11 tables are created for user and admin control.

Till now we don’t have any user. Let’s create a super user first.

Run the following command from the console –

$ python manage.py createsuperuser

5 create_superuser

This command has created a admin user with given email and password.

Now check your database again – to get the idea about the created user. One user has created named admin and his password is hashed.

6 created_admin_user

Now let’s run our server from command prompt –

$ python manage.py runserver

Open your web browser and go to –


7 django_admin_web

What you see? A full-featured admin dashboard has created. Play with it and see what it can do.

Happy coding… 🙂


Leave a Reply

Your email address will not be published.