Dec 20, 2017 - Python 3 is the most current version of the language and is considered to. Sudo apt-get install build-essential libssl-dev libffi-dev python-dev.
Install Apache and modwsgi If you just want to experiment with Django, skip ahead to the next section; Django includes a lightweight web server you can use for testing, so you won’t need to set up Apache until you’re ready to deploy Django in production. If you want to use Django on a production site, use with. Modwsgi operates in one of two modes: embedded mode or daemon mode. In embedded mode, modwsgi is similar to modperl – it embeds Python within Apache and loads Python code into memory when the server starts. Code stays in memory throughout the life of an Apache process, which leads to significant performance gains over other server arrangements.
In daemon mode, modwsgi spawns an independent daemon process that handles requests. The daemon process can run as a different user than the Web server, possibly leading to improved security. The daemon process can be restarted without restarting the entire Apache Web server, possibly making refreshing your codebase more seamless. Consult the modwsgi documentation to determine which mode is right for your setup. Make sure you have Apache installed with the modwsgi module activated. Django will work with any version of Apache that supports modwsgi. See for information on how to configure modwsgi once you have it installed.
If you can’t use modwsgi for some reason, fear not: Django supports many other deployment options. One is; it works very well with. Additionally, Django follows the WSGI spec ( ), which allows it to run on a variety of server platforms. Get your database running If you plan to use Django’s database API functionality, you’ll need to make sure a database server is running. Django supports many different database servers and is officially supported with,. If you are developing a simple project or something you don’t plan to deploy in a production environment, SQLite is generally the simplest option as it doesn’t require running a separate server. However, SQLite has many differences from other databases, so if you are working on something substantial, it’s recommended to develop with the same database that you plan on using in production.
In addition to the officially supported databases, there are that allow you to use other databases with Django. In addition to a database backend, you’ll need to make sure your Python database bindings are installed. If you’re using PostgreSQL, you’ll need the package.
Refer to the for further details. If you’re using MySQL, you’ll need a like mysqlclient. See for details.
If you’re using SQLite you might want to read the. If you’re using Oracle, you’ll need a copy of, but please read the for details regarding supported versions of both Oracle and cxOracle. If you’re using an unofficial 3rd party backend, please consult the documentation provided for any additional requirements. If you plan to use Django’s manage.py migrate command to automatically create database tables for your models (after first installing Django and creating a project), you’ll need to ensure that Django has permission to create and alter tables in the database you’re using; if you plan to manually create the tables, you can simply grant Django SELECT, INSERT, UPDATE and DELETE permissions.
After creating a database user with these permissions, you’ll specify the details in your project’s settings file, see for details. If you’re using Django’s to test database queries, Django will need permission to create a test database. Installing an official release with pip This is the recommended way to install Django. The easiest is to use the. If your distribution already has pip installed, you might need to update it if it’s outdated. If it’s outdated, you’ll know because installation won’t work. Take a look at.
These tools provide isolated Python environments, which are more practical than installing packages systemwide. They also allow installing packages without administrator privileges. The walks through how to create a virtualenv. After you’ve created and activated a virtual environment, enter the command pip install Django at the shell prompt. Tracking Django development If you decide to use the latest development version of Django, you’ll want to pay close attention to, and you’ll want to keep an eye on the. This will help you stay on top of any new features you might want to use, as well as any changes you’ll need to make to your code when updating your copy of Django.
(For stable releases, any necessary changes are documented in the release notes.) If you’d like to be able to update your Django code occasionally with the latest bug fixes and improvements, follow these instructions:. Make sure that you have installed and that you can run its commands from a shell. (Enter git help at a shell prompt to test this.).
Check out Django’s main development branch like so. Contents. Browse. Prev:.
Next:. You are here:.
How to install Django Getting help Try the FAQ — it's got answers to many common questions., or Handy when looking for specific information. Search for information in the archives of the django-users mailing list, or post a question. Ask a question in the #django IRC channel, or search the IRC logs to see if it’s been asked before. Report bugs with Django or Django documentation in our ticket tracker. Download: Offline (Django 2.1): Provided.
Downloading Python Before you start, you will need Python on your computer, but you may not need to download it. First of all check that you don't already have Python installed by entering python in a command line window. If you see a response from a Python interpreter it will include a version number in its initial display.
Generally any recent version will do, as Python makes every attempt to maintain backwards compatibility. If you need to install Python, you may as well download the most recent stable version.
This is the one with the highest number that isn't marked as an alpha or beta release. Please see the page for the most up to date versions of Python 2 and Python 3. They are available via the yellow download buttons on that page. For advice on choosing between Python 2 and Python 3 see. If you're running Windows: the most stable Windows downloads are available from the page.
If you're running Windows XP: a complete guide to installing is at. Has for downloading, installing and getting started with Python on a Windows XP machine - this series talks you through the Python, and distributions. If you are using a Mac, see the page. MacOS 10.2 (Jaguar), 10.3 (Panther), 10.4 (Tiger) and 10.5 (Leopard) already include various versions of Python.
For Red Hat, install the python2 and python2-devel packages. For Debian or Ubuntu, install the python2.x and python2.x-dev packages.
For Gentoo, install the '=python-2.x.' ebuild (you may have to unmask it first).
For other systems, or if you want to install from source, see the. BeginnersGuide/Download (last edited 2014-05-20 08:03:09 by ).