Yeah, that's what I was getting at. That makes sense. Can I use web.py
to code the install script and do the database updates and such if
it's not going to be served through the web server? Would I just not
do the app.run and code all the necessary updates procedurally?
Like, instead of of if __name__ == "__main__": app.run().... if
__name__ == "__main__": db.insert('users'....)
On Jun 8, 3:44 am, Branko Vukelic <[email protected]> wrote:
> 2009/6/8 大郎 <[email protected]>:
>
> > On Sun, Jun 7, 2009 at 3:37 AM, dbstraight <[email protected]> wrote:
>
> >> How would I make a web.py app so that the first time you run it, it
> >> does installation work (like creating an admin account), but then this
> >> process can never be run again (so someone can't create a second admin
> >> account). In PHP, I would always just have an install script that
> >> would be deleted out after used, but deleting a page in web.py
> >> requires modifying code.py, so it's not as simple.
>
> > webpy has not include an admin module, do it your self.
> > and, you can look at it in Django.
>
> I don't think the OP meant the admin app as in Django.
>
> To answer the OP's question, I don't think you need to physically
> remove install.py. You just need to change permissions on config.py or
> database.py where you write database connection info, and code
> install.py script so that it inserts some column in the database to
> mark that it has already been run once. Make sure it checks for the
> column before it runs.
>
> Now, as for whether install.py makes sense in general or not, I think
> it doesn't. web.py is hosted a bit differently than PHP, so a script
> that is run via browser doesn't make much sense to me. I think it'd be
> much better to have a script that is set up via ssh and not accessible
> through http. Then you leave the option of changing the admin
> password. That's how Django works, for instance.
>
> Best regards,
>
> --
> Branko
>
> eml: [email protected]
> alt: [email protected]
> blg1:http://sudologic.blogspot.com/
> blg2:http://brankovukelic.blogspot.com/
> img:http://picasaweb.google.com/bg.branko
> twt:http://www.twitter.com/foxbunny/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---