views:

455

answers:

8

I need to write a basic website on Dreamhost. It needs to be done in Python. I discovered Dreamhost permits me to write .py files, and read them.

Example:

#!/usr/bin/python
print "Content-type: text/html\n\n"
print "hello world"

So now I am looking for a basic framework, or a set of files that has already programmed the whole registration to be able to kick-off the project in a simple way. By registration I mean the files to register a new account, log in, check the email (sending a mail), and edit the user information. All this possibly using MySQL.

+1  A: 

You can try starting with django-registration.

EDIT: You can probably hack something up on your own faster than learning Django. However, learning a framework will serve you better. You'll be able to easily ask a large community when you have problems, and build on work that's already been done. And of course, if you're doing something new in the future, your knowledge of the framework can be more easily reapplied.

Matthew Flaschen
Thank you, I have no experience of using Django: The first problem is that although Dreamhost is listed as a Django friend host, does not officially support Django ( http://wiki.dreamhost.com/index.php/Django ). Would it take me less to learn Django than to just write the files from scratch?
Pietro Speroni
+1  A: 

django framework

lyrae
Thanks, I am considering it. The first problem is that although Dreamhost is listed as a Django friend host, does not officially support Django ( http://wiki.dreamhost.com/index.php/Django ). Second, you think it would take me less to learn Django than to just write the files from scratch? Maybe you are right, I have no experience of using Django.
Pietro Speroni
+4  A: 

Let me share my own experience with django. My prerequisits:

  • average knowledge of python

  • very weak idea of how web works (no js skills, just a bit of css)

  • my day job is filled with coding in C and I just wanted to try something different, so there certainly was a passion to learn (I think this is the most important one)

Why I've chosen django:

  • I've already knew bits and pieces of python

  • django has excelent documentation, including tutorial, which explained everything in very clear and simple manner

It is worth to read complete manual first (it took me two or three weekends. I remember I could not remember/understand everything at first pass, but it helped me to learn where the information can be found when needed. There is also another source of documentaion called djangobook. Djangobook contains same information as manual, but things are explained more in detail. It's worth to read it also, it helps to catch up with MVC concept, if you have not tried that before.

And finally to answer your question best: there are already also OpenId modules ready for you. I'm considering to use django-authopenid for my new project. It supports OpenId, while providing fallback to locally managed users.

There is certain learning curve if you are going learn django. The more you know about the web and python the steeper the curve is. I had to also learn bits and pieces of javascript and it took me also some time. If you are able to spend full time learning django, then you can expect you'll be able to deliver first results within 4-6 weeks. It took me 6 months, since I was doing my django studies in free time.

SashaN
+1  A: 

Django is the way to go. You can try it locally on your PC and see do you like it. It is very nice framework and allows you to quickly build your applications.

If you want to give Django quick go to see how it feels you can download Portable Python where everything is preinstalled and ready to use.

You can also do what you are trying to do with apache module mod_python (which is also used to run Django) but it would require more coding. Your code snippet would work with mod_python (http://www.modpython.org/) right away. I think mod_python comes pre-installed on Dreamhost so you can try it.

Perica Zivkovic
+1  A: 

For a more complete basic setup (with lots of preprogrammed features) I would point you at Pinax which is a web site on top of Django (which I praise of course, see the dedicated page on dreamhost Wiki at http://wiki.dreamhost.com/Django)

The introduction on the project's web site (pinaxproject.com) :

Pinax is an open-source platform built on the Django Web Framework.

By integrating numerous reusable Django apps to take care of the things that many sites have in common, it lets you focus on what makes your site different.

There you will have a complete web site to customize and add features to.

makapuf
This sounds very interesting, thanks. What is not clear is if Pinax would run on Dreamhost. DO we know of anyone who succesfully made it run? Regards, Pietro
Pietro Speroni
dunno, but since it runs as Django applications, I'd guess that once you've setup django there should be no install problems
makapuf
A: 

Another voice to the choir.

Go for django. It's very good and easy to use.

Stefano Borini
+2  A: 

There are several blog entries &c pointing out some problems with Python on Dreamhost and how to work around them to run several web frameworks that could suit you. (Most of the posts are over a year old so it may be that dreamhost has fixed some of the issues since then, of course, but the only way to really find out is to try!-).

Start with this page, dreamhost's own wikipage about Python -- at least you know it's quite current (was last updated earlier today!-). It gives instructions on using virtual env, building a custom Python &c if you absolutely need that, and running WSGI apps -- WSGI is the common underpinning of all modern Python web frameworks, including Django which everybody's recommending but also Pylons &c.

Some notes on running Pylons on Dreamhost are here (but it does look like Dreamhost has since fixed some issues, e.g. flup is now the dreamhost-recommended FCGI layer for WSGI as you'll see at the previously mentioned URL) and links therefrom. If you do go with Pylons, here is the best place to start considering how best to do auth (authentication and authorization) with it. I'm trying to play devil's advocate since everybody else's recommending django, but for a beginner django may in fact be better than pylons (still, spending a day or so lightly researching each main alternative, before you commit to one, is a good investment of your time!-).

For Django, again there's an official dreamhost wiki page and it's pretty thorough -- be sure to read through it and briefly to the other URLs it points to. The contributed auth module is no doubt the best way to do authentication and authorization if you do decide to go with Django.

And, whichever way you do choose -- best of luck!

Alex Martelli
+1  A: 

I've noticed that a lot of people recommend Django. If you're running on a shared host on Dreamhost, the performance will not be satisfactory.

This is a known issue with Dreamhost shared hosting. I have installed web2py on my Dreamhost shared account and it seems to work okay; search the google groups for an install FAQ.

Later edit: google Dreamhost Django performance for an idea of what I mean.

rpg