Django - Environment

Django development setting consists of putting in and putting in place Python, Django, and a information System. Since Django deals with net application, it's value mentioning that you just would want an internet server setup similarly.

Step one – putting in Python
Django is written in 100% pure Python code, thus you'll have to put in Python on your system. Latest Django version needs Python two.6.5 or higher

If you are on one amongst the most recent Linux or mack OS X distribution, you most likely have already got Python put in. you'll be able to verify it by typewriting python command at a electronic communication. If you see one thing like this, then Python is put in.

$ python
Python 2.7.5 (default, Jun seventeen 2014, 18:11:42)
[GCC 4.8.2 two0140120 (Red Hat four.8.2-16)] on linux2
Otherwise, you'll be able to transfer and install the most recent version of Python from the link http://www.python.org/download.

Step two - putting in Django
Installing Django is incredibly straightforward, however the steps needed for its installation depends on your OS. Since Python could be a platform-independent language, Django has one package that works all over no matter your OS.

You can transfer the most recent version of Django from the link http://www.djangoproject.com/download.

UNIX/Linux and mack OS X Installation
You have 2 ways in which of putting in Django if you're running Linux or mack OS system −

You can use the package manager of your OS, or use easy_install or pip if put in.

Install it manually victimisation the official archive you downloaded before.

We will cowl the second possibility because the initial one depends on your OS distribution. If you've got determined to follow the primary possibility, simply watch out concerning the version of Django you're putting in.

Let's say you bought your archive from the link on top of, it ought to be one thing like Django-x.xx.tar.gz:

Extract and install.

$ tar xzvf Django-x.xx.tar.gz
$ cd Django-x.xx
$ sudo python setup.py install
You can check your installation by running this command −

$ django-admin.py --version
If you see this version of Django written on the screen, then everything is about.

Note − for a few version of Django it'll be django-admin the ".py" is removed.

Windows Installation
We assume you've got your Django archive and python put in on your laptop.

First, PATH verification.

On some version of windows (windows 7) you would possibly have to be compelled to make certain the trail system variable has the trail the subsequent C:\Python34\;C:\Python34\Lib\site-packages\django\bin\ in it, after all counting on your Python version.

Then, extract and install Django.

c:\>cd c:\Django-x.xx
Next, install Django by running the subsequent command that you'll want body privileges in windows shell "cmd" −

c:\Django-x.xx>python setup.py install
To test your installation, open a electronic communication and kind the subsequent command −

c:\>python -c "import django; print(django.get_version())"
If you see this version of Django written on screen, then everything is about.

OR

Launch a "cmd" prompt and kind python then −

c:\> python
>>> import django
>>> django.VERSION
Step three – information Setup
Django supports many major information engines and you'll be able to started any of them supported your comfort.

MySQL (http://www.mysql.com/)
PostgreSQL (http://www.postgresql.org/)
SQLite three (http://www.sqlite.org/)
Oracle (http://www.oracle.com/)
MongoDb (https://django-mongodb-engine.readthedocs.org)
GoogleAppEngine Datastore (https://cloud.google.com/appengine/articles/django-nonrel)
You can confer with various documentation to putting in and configuring a information of your selection.

Note − range five and half-dozen square measure NoSQL databases.

Step four – net Server
Django comes with a light-weight net server for developing and testing applications. This server is pre-configured to figure with Django, and additional significantly, it restarts whenever you modify the code.

However, Django will support Apache and alternative well-liked net servers like Lighttpd. we are going to discuss each the approaches in coming back chapters whereas operating with completely different examples.

Post a Comment

Thanks for comment.

Previous Post Next Post