#1 Setting up
django and running the server.
Django is a python project that
enables you to write and make web apps in python. Python is probably the
easiest programming language for writing web application. If you haven’t still
learned python you can first search for a tutorial for python before you
proceed to learn django because django
is written in python.
First we will start by installing
django. Make sure you have installed the latest python from python.org and pip.
 |
pip install django |
Run the pip install command. If you
haven’t installed pip you can go to python’s official website and read on how
to install pip in your machine. After the install is finished you can confirm that
by using the version command.
 |
getting django version |
The version will be displayed if it
is properly installed.
Next we will create our django
project. We will use the start project command to create our django project.
In the *projectName* tag you will
write your project name.
So we will create a project called DjangoTutorial. After
creating the project a folder with project name will show up in your directory.
The folder will contain another folder of your project name
and a manage.py python file.
 |
DjangoTutorial folder |
When you open the DjangoTutorial
folder *or as you named* you should see the files below.
These files are pretty important but
i will first show you how to run your server where your project’s output will
be displayed.
 |
running the server |
You will first have to get into the
folder we created to access the manage.py file.
So get into the folder we created and
run the runserver command.
So
this results show that our server is running. You will go to a browser and
insert the url 127.0.0.1:8000/. This will open the server and a django success
page will be displayed.
When you see this page it means your
server is up and running and that’s it. You have finished the first step of
creating a web application.
Comments
Post a Comment