Skip to content

Commit

Permalink
Redoing installation instructions, to emphasize Uni-form or jQuery ar…
Browse files Browse the repository at this point in the history
…e not compulsory requirements anymore.
  • Loading branch information
maraujop committed Aug 8, 2011
1 parent eed2eee commit 57194e9
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions docs/install.rst
Expand Up @@ -2,19 +2,14 @@
Installation
============

Dependencies
~~~~~~~~~~~~

* JQuery

Installing django-uni-form
~~~~~~~~~~~~~~~~~~~~~~~~~~

Install into your python path using pip or easy_install::

pip install django-uni-form
pip install -U django-uni-form

Or if you are running earlier than Django_ 1.2 and/or Python 2.6::
Or if you are running earlier than Django_ 1.2 and/or Python 2.5::

pip install django-uni-form==0.7.0
Expand All @@ -24,20 +19,24 @@ Add `uni_form` to your INSTALLED_APPS in settings.py::
...
'uni_form',
)
Depending on your setup, you may need to copy the static files to your local
static folder::
Dependencies
~~~~~~~~~~~~

Django-uni-form is a Django application that lets you build Django forms in a DRY programmatic way. By default the different components available, have been designed to be used in conjuction with `Uni-form`_, a CSS framework for form markup. You should understand that this has been done with the best intention. However, you are actually free to use default components as they are, without attaching `Uni-form`_ media files or you can customize templates from those components (ref).

If you want to use `Uni-form`_ with django-uni-form, depending on your setup, you may need to copy the static files to your local static folder::

cp -r <location-of-django-uni-form>/uni_form/static/uni_form <directory-for-my-project's-static-files>

Displaying the static files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~

First, make sure you're linking to a copy of jQuery. It's recommended that you use the version hosted on Google's servers since the user's browser might already have it cached. (You can get the url for the latest version of jQuery at http://scriptsrc.net/.) But there are some cases in which you'll want to host jQuery yourself, such as if you're doing development offline::
If you are using `Uni-form`_, it is recommended that you link a copy of jQuery, this will give some extra goodies. Preferably you should use a version hosted on Google's CDN servers since the user's browser might already have it cached. (You can get the url for the latest version of jQuery at http://scriptsrc.net/.) But there are some cases in which you'll want to host jQuery yourself, such as if you're doing development offline::

<script src="{{ STATIC_URL }}js/jquery.js" type="text/javascript"></script>

Beyond jQuery, django-uni-form requires three static files. You can see how we call them by looking in the templates/includes.html file. You can call those files in several ways.
Beyond jQuery, `Uni-form`_ requires three static files. You can see how we call them by looking in the `templates/uni_form/includes.html` file. You can call those files in several ways.

1. The best way is probably to copy this HTML into your templates. This allows you to make use of the CSS compressors that have been created by the Django community (http://www.djangopackages.com/grids/g/asset-managers/). Here's the HTML::

Expand All @@ -54,7 +53,7 @@ Beyond jQuery, django-uni-form requires three static files. You can see how we

{% uni_form_setup %}

If you want to take advantage of the uni_form_setup tag, then you'll need to make sure '*django.core.context_processors.request*' is in the TEMPLATE_CONTEXT_PROCESSORS tuple in your settings.py file::
If you want to take advantage of the `{% uni_form_setup %}` tag, then you'll need to make sure `django.core.context_processors.request` is in the TEMPLATE_CONTEXT_PROCESSORS tuple in your settings.py file::

TEMPLATE_CONTEXT_PROCESSORS = (
...
Expand Down

0 comments on commit 57194e9

Please sign in to comment.