Django - ArchWiki

# Django

Django is a high-level Python Web framework which follows the model–view–controller (MVC) architectural pattern.

## Installation

Two packages of Django are currently available in the official repositories. They can be installed with the following packages:

- python-django - Latest python support, with documentation in the django-docs package from AUR.
- python2-django - Python 2 legacy support

## Usage

If you wish to start a Django project, use `django-admin` command

    $ django-admin startproject mysite

This will create a mysite directory in your current directory. It will also create a manage.py script, which will let you interact with your project.

More information you will find in the official Django tutorial and Django documentation.

## eric-IDE Tips & Tricks

This article or section is being considered for deletion.

Reason: Irrelevant information. Why do we need this section here? If someone is interested in this IDE, we should move it to the seperate page. (Discuss)

Eric is a good IDE for Django. It has Highlighting, Autocompletion, CVS & Subversion, Debugger, and Breakpoints.

eric can be installed from the official repositories.

To start a new Django Project.

First click on the "Project/new." Then under "Project Type" select Django. After your new django project has been created, Right-click on the "Project Viewer", to the Left, and select "Configure", and in the configuration window set "Project type" to Django.

After that, in eric4's "Settings/Preferences" select Django, from the left, and add this change to the "Console Command."

If KDE,

    konsole --workdir `pwd` -e
    konsole --workdir `pwd` --noclose -e

This will solve the problem...

    /usr/bin/python2: can't open file 'manage.py': [Errno 2] No such file or directory

Note the "Django" menu next to "Project" and "Extras". There you will find Django tools to runserver and sync database.

Now, just play around with it a little. All your Python code will be Added to the first tab of the "Project-Viewer" and your html templates will be opened in the second tab.

Category:

- Development