For marketers
who love technology
Home » , » Discovering django on debian: part 1 installing django and setting up a project

Discovering django on debian: part 1 installing django and setting up a project


In this tutorial, we will see how to install Django and to set up a first Django project.

Let's consider that you have already installed python and pip, and have activated a virtual environment (if not, please see my virtualenv tutorial) in which you want to start playing with django.

First things first, let's install django and check the installed version:
pip install django
python -c "import django; print(django.get_version())"

Now, we will follow the official django tutorial

mkdir djangoProj_1
cd djangoProj_1
django-admin.py startproject mysite
ls -alh mysite

As a result of these commands, django has initialized the project "mysite", which means that it has created a folder name "mysite" and put a bunch of python files in it. For python, mysite is a package, and it contains a few modules.

Django comes with a built-in server, to test your implementations:

python my_site/manage.py runserver
firefox http://127.0.0.1:8000/

You should see a django powered webpage saying 'it worked !'.

SHARE

About Gilles

0 comments :

Post a Comment