|
Written by Administrator
|
|
Wednesday, 18 March 2009 |
|
Web2py is a Python web framework. - Install Python 2.5 or 2.6
- Install setuptools
- Run easy_install Flup
- Download and extract web2py
- Run python web2py.py to create the necessary framework files
- Create a file dispatch.fcgi at the root of web2py directory with the following content:
#!/home/youruserhere/run/bin/python import sys from flup.server.fcgi_fork import WSGIServer import gluon.main application=gluon.main.wsgibase ## or # application=gluon.main.wsgibase_with_logging WSGIServer(application).run()
- make this file executable by typing
-
- create or add the following lines to .htaccess:
RewriteEngine On RewriteBase / RewriteRule ^dispatch\.fcgi/ - [L] RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]
Try and access the domain on your browser and work! Example: application "MD5 decode "
|
|
Last Updated ( Wednesday, 18 March 2009 )
|
|
Read more...
|
|
|
Written by Administrator
|
|
Thursday, 19 March 2009 |
|
Dreamhost default python 2.4 :( All Python CGI scripts on dreamhost MUST... - end in ".py" (NOTE: ".cgi" works as well)
- have #!/usr/bin/python in the very first line of the file (NOTE: #!/usr/bin/python2.x or #!/usr/bin/env python2.x will work as well)
- be marked as executable: chmod 755
- use UNIX style newlines, not Windows
- If you want to view printed output from your Python code, you must print print "Content-type: text/html\n\n" as the first line of output.
- If you don't want .py files to be executed by Apache add "RemoveHandler .py" command to your .htaccess file
Installation a custom version of Python wget http://python.org/ftp/python/VERSION/Python-2.5.2.tgz tar -xzvf Python-VERSION.tgz cd Python-VERSION ./configure --prefix=$HOME make make install |
|
Last Updated ( Thursday, 19 March 2009 )
|
|
Read more...
|
|
|
Written by Administrator
|
|
Wednesday, 18 March 2009 |
|
We’ll need to configure your Dreamhost account for use with Django. DreamHost have FastCGI support. - Log into your DreamHost Web Admin Panel
- Click on Domains / Manage Domains
- Click Edit under the Web Hosting column for the domain that you wish to use with Django "mydomain.com"
- Ensure that the FastCGI Support option is enabled. If not, click the box to enable it and then click Change "fully hosted settings now!"
- Enable SSH access and request the default bash shell
For Windows (ssh client): - Free: WinSCP is an open source free SFTP client for Windows using SSH
Need to setup a MySQL database to use with Django. Follow these steps: - In the Dreamhost administration panel, choose “manage MySQL” under the Goodies menu.
- Enter a database name for your new database. I’ve chosen django_db and will be using that name in the tutorial.
- Enter a hostname for your database server.
- Enter a username and password for your database.
- Click the “Add new database now!” button.
- SSH into your Dreamhost server.
- Go your $HOME directory
- Make a new directory for Django: mkdir django
- Change into your new directory: cd django
- Create directories for templates and projects: mkdir django_templates and mkdir django_projects
- Create a directory to store your media files (css, images, javascript, etc.).
|
|
Last Updated ( Wednesday, 18 March 2009 )
|
|
Read more...
|
|
|
|
<< Start < Prev 1 2 3 Next > End >>
|
| Results 1 - 4 of 10 |