Installation

django-quotes is extremely easy to get working.

Before installing django-quotes, you’ll need to have a copy of Django already installed. For the 0.4 release, Django 1.0 or newer is required.

For further information, consult the Django download page, which offers convenient packaged downloads and installation instructions.

Installing django-quotes

There are several ways to install django-quotes:

  • Automatically, via a package manager.
  • Manually, by downloading a dopy of the release package and installing it yourself.
  • Manually, by performing a git clone of the latest code.

Note

The preferred way to install django-quotes is via pip, a popular python package manager.

It is also highly recommended that you use virtualenv for development and deployment of your software.

virtualenv provides isolated Python environments into which collections of python packages may be installed, without cluttering your system’s python path. This lets you maintain specific software dependencies without worring about breaking production code when performing OS updates.

If you do not want to use virtualenv, you should skip to Automatic Installation via a Package Manager.

Configuring virtualenv

If you’d like to install django-quotes using best practices, to avoid future software version conflicts and upgrade issues–it is recommended that you use virtualenv.

If you are not familiar with virtualenv, please see their website for installation and usage instructions.

If you need to create a new virtual environment for your project, you will need to run:

rdegges@solitude:~$ cd ~/your_project/
rdegges@solitude:~/your_project$ virtualenv --no-site-packages env
New python executable in env/bin/python
Installing setuptools............done.
rdegges@solitude:~/your_project$ . env/bin/activate
(env)rdegges@solitude:~/your_project$

The above command line example will create a new virtual environment, stored in the sub-directory env, and then activate it. Once the virtual environment has been activated, any python packages installed will be available only in the virtual environment, and not system wide.

If you’ve already got a virtual environment created for your project, simply run the activate script inside of it (bin/activate) in order to activate your environment.

Automatic Installation via a Package Manager

Several automatic package installation tools are available for python; the most popular are easy_install and pip. Either can be used to install django-quotes.

Using easy_install, simply run:

easy_install django-quotes

Using pip, run:

pip install django-quotes

Note

If you are upgrading django-quotes from a previous release, and you’re using pip, you can run: pip install -U django-quotes to upgrade your installation.

Manual Installation From Source

If you prefer not to use an automated package installer, you can download a copy of django-quotes and install it manually. The latest release package can be downloaded from django-quote’s Github project page.

Once you’ve downloaded the package, unpack it. If you’re using linux, you can typicall run the following command: tar zxvf django-quotes-0.4.tar.gz. This will create the directory django-quotes-0.4, which contains the setup.py installation script. From the command line in that directory, run the following commands to install django-quotes:

python setup.py install

Note

On some systems, if you’re installing django-quotes site wide (so that it’s available for all users on the system), you’ll need to execute this command with admin privileges: sudo python setup.py install.

Manual Installation From Git

If you’re a developer, or just like to get your hands dirty with the latest development code, you can obtain it from the django-quotes Git repository, hosted at Github.

To obtain the latest code, you can run:

rdegges@solitude:~$ git clone git://github.com/comradeb14ck/django-quotes.git
Cloning into django-quotes...
remote: Counting objects: 443, done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 443 (delta 263), reused 107 (delta 65)
Receiving objects: 100% (443/443), 53.91 KiB | 19 KiB/s, done.
Resolving deltas: 100% (263/263), done.
rdegges@solitude:~$ cd django-quotes/
rdegges@solitude:~/django-quotes$ git fetch origin develop:develop
From git://github.com/comradeb14ck/django-quotes
 * [new branch]      develop    -> develop
rdegges@solitude:~/django-quotes$ git checkout develop
Switched to branch 'develop'
rdegges@solitude:~/django-quotes$

Then, to install the code, simply run python setup.py install (or sudo python setup.py install if you’re installing site wide).

Note

Do NOT install the latest development code on a production system. It may be broken, buggy, or worse.

Required Settings

Begin by adding quotes to the INSTALLED_APPS setting of your Django project. For example, you may have the following in your Django settings file:

INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        'django.contrib.messages',
        'django.contrib.admin',
        'django.contrib.admindocs',
        'quotes',
        # ... other installed applications ...
)

Note

If you want to be able to create, edit, and remove, and search Quote s using the Django admin panel, you’ll need to have 'django.contrib.admin' enabled in your INSTALLED_APPS.

Once you’ve configured your settings.py, create the necessary database tables using the command:

python manage.py syncdb

Setting up URLs

If you want to use the Django admin panel to create, edit, remove, and search Quote s, then you’ll need to enable the admin in your project’s urls.py file.

To start, add the following to the top of urls.py:

from django.contrib import admin
admin.autodiscover()

Next, add the following to your urlpatterns:

(r'^admin/', include(admin.site.urls)),

Once those have been done, you should be able to access /admin/ on your site.