Creating First Django Project - Django Complete Course #02

 Introduction:

    In this post, i created my first Django project. In order to develop websites in Django we have to create a project so that we will save our code for website in the project folder.

1. Creating Project:

    Creating a project in Django is very simple. We have to create a folder and open cmd or powershell in that folder and issue the following command:

django-admin startproject projectname

write your project name in place of "projectname" in above command

I will issue the following command:

django-admin startproject mysite

Now Django will automatically write some code for us. We will modify this code according to our need.

Django will create some folders and files in project folder.

2. Launching Project with Server:

    Now we will launch our website by using in-built server in Django. Open cmd or powershell in folder where file manage.py is created and issue the following command:


python manage.py runserver

Now open your browser and type url that is provided in cmd when you issue the above command. In my case the url is http://127.0.0.1:8000. Now we will see Congratulations page that means we have successfully created our project in Django. Now we will create a website by using this project.

That's it for now

Happy Coding 


Comments

Popular Posts