Django
|
Size: 1227
Comment:
|
Size: 1353
Comment: fix capitalizations
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| In django, first you define your database models, which generate SQL for the database and allow django to know about the data. This is essential for the DRY concept. Next, the views are defined, this is where any buisness logic, interactions with the database and the like go. Then, the urls are defined as regular expression the map to views. Finally, templates are written, which are html (or anything composed of text) with data and simple data control sprinkled throughout. | In Django, first you define your database models, which generate SQL for the database and allow Django to know about the data. This is essential for the DRY concept. Next, the views are defined, this is where any business logic, interactions with the database and the like go. Then, the URLs are defined as regular expression the map to views. Finally, templates are written, which are HTML(or anything composed of text) with data and simple data control sprinkled throughout. Also see http://www.djangobook.com/ If you are interested in lighttpd you can have a watch to this: http://www.djangoproject.com/documentation/fastcgi/ |
| Line 6: | Line 9: |
| Also see http://www.djangobook.com/ Django on Apache using mod_python |
== Django on Apache using mod_python == |
| Line 11: | Line 12: |
| {{{sudo apt-get install libapache2-mod-python python-django | {{{ sudo apt-get install libapache2-mod-python python-django |
| Line 23: | Line 25: |
| {{{sudo a2dissite default | {{{ sudo a2dissite default |
Django is a python based web-framework. It can be found at http://www.djangoproject.com/.
In Django, first you define your database models, which generate SQL for the database and allow Django to know about the data. This is essential for the DRY concept. Next, the views are defined, this is where any business logic, interactions with the database and the like go. Then, the URLs are defined as regular expression the map to views. Finally, templates are written, which are HTML(or anything composed of text) with data and simple data control sprinkled throughout.
Also see http://www.djangobook.com/ If you are interested in lighttpd you can have a watch to this: http://www.djangoproject.com/documentation/fastcgi/
Django on Apache using mod_python
Install Ubuntu-Server
sudo apt-get install libapache2-mod-python python-django sudo vim /etc/apache2/sites-available/django-example
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonDebug On
PythonPath "['/usr/share/doc/python-django'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE examples.settings
</Location>sudo a2dissite default sudo a2ensite django-example sudo /etc/init.d/apache2 reload
Hit the box with a browser, and you should see "Django examples" and some links.
Django (last edited 2012-04-26 13:38:07 by ww2)