I only just realized that I can set a routes.py file in the application
directory. Got it all set up using the examples contained in
applications/app/routes.example.py.
On Monday, February 17, 2014 8:31:58 PM UTC-8, HittingSmoke wrote:
I would like to change my 'index' function to 'page' so
I followed the pagination tutorial in the web2py book and I have the
following controller:
def index():
if len(request.args): page=int(request.args[0])
else: page=0
items_per_page=6
limitby=(page*items_per_page,(page+1)*items_per_page+1)
posts=db().select(db.post.ALL,
It was {{=P(post.date)}} but I've since changed it to prettydate. I'm still
curious what the solution is though.
On Monday, February 17, 2014 3:13:33 AM UTC-8, Niphlod wrote:
how is it called in the view ?
On Sunday, February 16, 2014 8:23:53 PM UTC+1, HittingSmoke wrote:
I have
This appears to be a bug.
You can recreate it by creating a user with auth then logging in with the
remember me box checked.
Then empty the user table in the database. Go to /user/register and you
will be redirected to /user/profile with an Object not found error.
Clearing cookies fixes the
I'm curious if there's any notable performance overhead with using helpers.
I have the following to list database entries on my home page:
ul class=thumbnails
{{for i,post in enumerate(posts):}}
{{if i==items_per_page: break}}
{{=LI(
DIV(
A(IMG(_src=URL('static', 'content', 'thumbs',
://stackoverflow.com/a/8095585/440323).
Anthony
On Monday, February 17, 2014 5:19:19 PM UTC-5, HittingSmoke wrote:
I'm curious if there's any notable performance overhead with using
helpers. I have the following to list database entries on my home page:
ul class=thumbnails
{{for i,post in enumerate
I would like to change my 'index' function to 'page' so that when someone
calls a specific page and the router doesn't remove the controller name
from the url it will say 'page/1' instead of 'index/1'.
I found this answer via a
search:
So with other helpers I can do things like P(db.table.field,
_class=text-centered) to center the text in a paragraph tag generated by
the P helper.
Is there any way to do the same with the MARKMIN helper? I
have {{=MARKMIN(post.caption)}} set for a photo blog app so I can easily
style my
I have the following in my model:
Field('date', 'date', default=datetime.date.today(), requires = IS_DATE(
format=('%B %-d, %Y')), writable=False,readable=False),
...and in the appadmin database entry form the date displays in the format
I've chosen. However when db.mytable.date is called
Pierro wrote:
def index():
form=SQLFORM(db.post).process()
if form.accepted: redirect(URL('download',args=form.vars.file))
return dict(form=form)
def download(): return response.download() # already in scaffolding app!
On Friday, 14 February 2014 18:08:25 UTC-6, HittingSmoke
I've found a few scripts around the web for this but all of them seem far
more complicated than needed and don't fit into my image upload script.
Here is what I'm trying:
def optimizeImage(rawImage):
import os, uuid
from PIL import Image
postImage =
I stramlined the upload script to:
def new():
form=SQLFORM(db.post).process()
if form.accepted:
from PIL import Image
rawImage = Image.open(db.post.file)
resImage = rawImage.resize((800,600),Image.ANTIALIAS)
resImage.save(db.post.file, quality=70)
I'm building my first public facing app with web2py using the basic image
blog example from the docs but I'm concerned about performance.
I'd like to have an upload form so I can post images to a blog with basic
captions. I don't need any security for viewing so I'd like to have them
served
I'm getting:
type 'exceptions.TypeError' not indexable
...when trying to disable my Welcome app from the admin interface.
Code listing:
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
return []
def keys(self):
Dictionary style keys() method.
if self.list is
.
Traceback (most recent call last):
File /home/hittingsmoke/web2py/gluon/restricted.py, line 217, in restricted
exec ccode in environment
File
/home/hittingsmoke/web2py/applications/Community_Deployment/models/menu.py
https://communitydeployment.com/admin/edit/Community_Deployment/models
Apologies. It is: 2.6.3-stable+timestamp.2013.09.15.17.01.20
On Wednesday, September 18, 2013 4:08:48 PM UTC-7, Massimo Di Pierro wrote:
Which version?
On Wednesday, 18 September 2013 15:56:28 UTC-5, HittingSmoke wrote:
I'm getting:
type 'exceptions.TypeError' not indexable
...when
Interesting. I'm not sure if it's is relevant, but I'm using a very
barebones nginx+uwsgi setup compiled from source. I may be misinterpreting
your comment but it sounds like you're saying it should work with
nginx+uwsgi. That's exactly what I'm using.
On Tuesday, August 20, 2013 11:19:52 PM
tracker.
Thanks.
On Wednesday, August 21, 2013 12:20:13 AM UTC-7, Niphlod wrote:
do you have that line in yout nginx config ?
On Wednesday, August 21, 2013 9:12:50 AM UTC+2, HittingSmoke wrote:
Interesting. I'm not sure if it's is relevant, but I'm using a very
barebones nginx+uwsgi setup
I've been going back over my configuration compared to various other
deployment recipes after realizing I was missing some non-critical uwsgi
related parameters. I noticed my static location block in nginx was
different than the one recommended in the web2py nginx+uwsgi setup script.
Here's
/default/chapter/29/13/deployment-recipes#Compress-static-files
On Wednesday, August 21, 2013 8:59:18 PM UTC+2, HittingSmoke wrote:
I've been going back over my configuration compared to various other
deployment recipes after realizing I was missing some non-critical uwsgi
related parameters
It looks like the zip_static_files.py script only gzips css and js files.
There's a lot more that can be compressed, such as web fonts and vector
graphics. I understand why jpg and png images are left out, but why only
css and js?
On Wednesday, August 21, 2013 11:59:18 AM UTC-7, HittingSmoke
Long ago web2py used to provide which python version it was running on in
the admin interface.
Now all I see is (Running on %s) in the admin console under the web2py
version.
How can I fix this to see which python version web2py is using?
--
---
You received this message because you are
Submitted. Thanks.
On Monday, August 19, 2013 11:26:08 PM UTC-7, Massimo Di Pierro wrote:
Good point. Please open a ticket about this.
On Tuesday, 20 August 2013 01:00:02 UTC-5, HittingSmoke wrote:
Long ago web2py used to provide which python version it was running on in
the admin
Bootstrap has gone to flat design for its default theme. This is generally
the direction web design is taking. It's more sleek and clean out of the
box. If people want a raised theme BS 3 offers themes to return to the
original design so the new version is more about choice and easier
is provided from the underlying server, but it's not
required. However I'll send a patch for having Running on unknown, Python
2.7.3 to leave out the %s.
On Tuesday, August 20, 2013 8:30:34 PM UTC+2, HittingSmoke wrote:
Submitted. Thanks.
On Monday, August 19, 2013 11:26:08 PM UTC-7, Massimo Di
I'm just glad to see this is being looked into. I think BS3 is an
improvement over 2. I know it's not just a simple flip of the switch but it
would be nice to see official support some time in the future.
On Monday, July 29, 2013 7:01:47 AM UTC-7, Niphlod wrote:
just to inform everybody that
I know chat has been beaten to death around here but IMO there hasn't been
any quality implementations or answers yet. There are dozens of blogs and
posts about it, most of which are solutions that no longer work or are
ridiculously overcomplicated solutions with duplicated code between python
I thought this would be simple but I can't seem to find the answer. I run
web2py on Webfaction via uWSGI and a shared Nginx instance. Web2py runs on
the default 2.6.6 python install which I have no control over. I would like
it to run on python 2.7 where I install my modules. I'm having issues
Pedroso wrote:
On Mon, May 13, 2013 at 9:18 PM, HittingSmoke
hittin...@gmail.comjavascript:
wrote:
I know chat has been beaten to death around here but IMO there hasn't
been
any quality implementations or answers yet. There are dozens of blogs
and
posts about it, most of which
I know web2py supports Janrain but they charge for what's basically an
inert layer of code between your app and the login system. It seems silly
to use it.
It would be nice to see these features baked into auth, where one could put
in an API key for the most popular social login services
January 2013 20:45:34 UTC-6, HittingSmoke wrote:
Yep, SQLITE. But I completely wiped the database from the disk in
web2py/applications/application/databases and let web2py write a completely
new one. Wouldn't I not need to alter anything if web2py has created a
fresh database with the proper
For instance, could I set a field in the database to be always rendered in
Markmin or sanitized HTML instead of in the view every time it's queried?
--
UTC+1, HittingSmoke wrote:
For instance, could I set a field in the database to be always rendered
in Markmin or sanitized HTML instead of in the view every time it's queried?
--
Can I use IS_EMPTY_OR to require a field is completely empty, basically
leaving out the OR part?
I'd like to make a hidden field in a form that is required to be empty to
help filter out spam bots on a form.
--
:39 PM UTC+1, HittingSmoke wrote:
Can I use IS_EMPTY_OR to require a field is completely empty, basically
leaving out the OR part?
I'd like to make a hidden field in a form that is required to be empty to
help filter out spam bots on a form.
--
I'm trying to get my comment page to show the comment author by first and
last name. Unfortunately I can't get it to display anything but user ID.
My db model:
db.define_table('comments',
Field('author', db.auth_user, default=auth.user_id, writeable=False),
Field('postedon', 'date',
I changed date to datetime in my comments database model and now after
submitting a comment I can't load the comment function.
I figured I just broke the database with the switch and tried to wipe it to
start over. That didn't work though. In appadmin if I go to the comments
table I get the
Yep, SQLITE. But I completely wiped the database from the disk in
web2py/applications/application/databases and let web2py write a completely
new one. Wouldn't I not need to alter anything if web2py has created a
fresh database with the proper field types?
On Sunday, January 6, 2013 6:37:48 PM
I have some experience with Boostrap and the associated javascript tools
it comes with. I just stumbled across the jQueryUI lines in layout.html
last night so I thought I'd look it up.
It would seem to me there's quite a bit of overlap in the functionality of
the two. I'm curious why jQueryUI
I've been seeing this over the past week or so since I
started separating my apps into subdomains using the parametric router. My
entries are simple:
routers = dict(
BASE = dict(
domains = {
'domain.com' : 'blog',
'chat.domain.com' : 'chat',
, December 31, 2012 11:00:19 AM UTC-8, Jonathan Lundell wrote:
On 31 Dec 2012, at 10:36 AM, HittingSmoke hittin...@gmail.comjavascript:
wrote:
I've been seeing this over the past week or so since I
started separating my apps into subdomains using the parametric router. My
entries
I was randomly tinkering around and discovered websocket_messaging.py
I've got that running and it appears to be receiving messages from the
sample functions but I can't seem to get them to actually display in the
browser. I was wondering if there was some sort of nice, canned websocket
of the parametric router so I was hoping it
would be possible there. Maybe it's something that could be added to the
newer router at some point.
On Friday, December 28, 2012 7:39:36 AM UTC-8, Jonathan Lundell wrote:
On 27 Dec 2012, at 10:31 PM, HittingSmoke hittin...@gmail.comjavascript:
wrote:
Pretty
.
On Thursday, December 27, 2012 10:31:01 PM UTC-8, HittingSmoke wrote:
Pretty straight forward question. Can I use the parametric routes.py
language to 301 redirect from www.domain.com to domain.com for proper
search engine crawling?
--
Pretty straight forward question. Can I use the parametric routes.py
language to 301 redirect from www.domain.com to domain.com for proper
search engine crawling?
--
Then, in my web2py/applications/[my_app]/ folder, I put a symbolic link
called static to the above folder. Seems to do the trick.
On Monday, December 17, 2012 7:17:35 PM UTC, HittingSmoke wrote:
Bah, I actually asked a Webfaction staff member if this were possible and
I was told
, HittingSmoke wrote:
I've been learning web2py on Webfaction off and on for a while now. The
web2py install script on the Webfaction wiki is quite outdated and runs on
an Apache instance that can barely stay within the default memory limits
without serious tweaking. Responsiveness with web2py
, 2012 7:17:35 PM UTC, HittingSmoke wrote:
Bah, I actually asked a Webfaction staff member if this were possible and
I was told no, that the frontend Nginx server could only be used on
static/PHP sites.
Now that I'm looking into it I'm seeing one major issue that without
proper configuration
How do you do this on Webfaction (use web2py/uwsgi with the native nginx
instance)? I've asked for this specifically and been told by Webfaction
staff that it's not actually possible to use a framework with the native
nginx instance, only with static and PHP apps.
Right now I'm using a custom
I've been learning web2py on Webfaction off and on for a while now. The
web2py install script on the Webfaction wiki is quite outdated and runs on
an Apache instance that can barely stay within the default memory limits
without serious tweaking. Responsiveness with web2py/apache out of the box
() to work? I am sure that I am missing something here, or there
is a bug in the way auth.wiki() is supposed to work.
Simon
On Saturday, 27 October 2012 04:18:09 UTC+1, HittingSmoke wrote:
Default is your controller. You're running auth.wiki under the index
function of the default controller
I feel like I read Massimo say somewhere that plugin_wiki will be
deprecated when auth.wiki is more complete and documented but don't quote
me on that.
On Friday, October 26, 2012 1:57:29 PM UTC-7, Niphlod wrote:
can't say if plugin_wiki is going to be updated further, but auth.wiki()
is
Default is your controller. You're running auth.wiki under the index
function of the default controller. Your auth.wiki pages are called with
auth.wiki so you need your index function which is where auth.wiki is.
You could hide the function part of the URL using routing if you want.
On Friday,
Sticky footers are not well supported in CSS. There are several popular
implementations and are all hacked together workarounds, most of which use
javascript and nearly all of which break very easily and have poor
cross-browser compatibility.
I wouldn't want to see something like this baked
I'm trying to get auth.navbar to display a username after Welcome instead
of trying to display first_name which does not exist in my auth table.
I'm not a python wiz, I'm learning it as I learn web2py. I see this in the
source code:
def
-4, HittingSmoke wrote:
I'm trying to get auth.navbar to display a username after Welcome instead
of trying to display first_name which does not exist in my auth table.
I'm not a python wiz, I'm learning it as I learn web2py. I see this in
the gluon.tools source code:
def
navbarhttp
I'm pretty sure you can do this with routes.py
routers = dict(
BASE = dict(
domains = {
'domain1.com' : 'app/contoller1',
'domain2.com' : 'app/controller2',
}
),
)
On Monday, October 22, 2012 10:48:19 AM UTC-7, Tito Garrido wrote:
Hi Folks!
Markmin includes the markup to display the title where you want it. I
believe the title being automatically displayed should be removed so we can
choose whether to include it using *#Markmin* or add a way to disable it,
such as MediaWiki's __NOTITLE__ flag.
--
see an option under the [wiki] menu that says manage pages.
On Friday, October 19, 2012 11:47:55 PM UTC-5, HittingSmoke wrote:
I can't find them in my database...
I'm trying to build a basic blog using auth.wiki but without
documentation and without database references I have no way
I was thinking more like a db call that would display previews of the ten
most recently submitted articles. Sorted by
db.wiki_page.created_on
On Sunday, October 21, 2012 4:06:26 PM UTC-7, Bill Thayer wrote:
Ok,
Actually i am just getting there myself on my application. There is a
cloud()
I was about to submit this as an issue but I figured since it's
experimental still I should ask if there's something more behind this
behavior that I'm not understanding.
I made a wiki page with tags. The tags start with a capital letter
(Youtube) because I'm anal about such things. When I
.
Massimo
On Saturday, 20 October 2012 19:25:44 UTC-5, HittingSmoke wrote:
I was about to submit this as an issue but I figured since it's
experimental still I should ask if there's something more behind this
behavior that I'm not understanding.
I made a wiki page with tags. The tags start
-5, HittingSmoke wrote:
I'd like to use auth with only a username instead of first and last
name. I defined my own tables without a first and last name but it
still causes issues throughout the app.
For instance, when I try to use appadmin to add a user to a new auth
group I get an error
I can't find them in my database...
--
This is a sort of two part question, the second part being conditional on
the answer to the first.
1. Is plugin_wiki deprecated for auth.wiki or am I misinterpreting what's
going on? I can find some documentation on plugin_wiki but most current
discussion seems to be on doing the same things
I'm trying to build a simple blog with web2py. I see auth.wiki and
plugin_wiki are two different entities which as far as I can tell fulfill
much the same functions.
Is there any advanced documentation on auth.wiki similar to the plugin_wiki
chapter in the book?
--
I tried installing plugin_wiki for a simple blog app and I can't get it to
work with subdomain routing.
I had routes.py setup to direct blog.domain.com to my app 'blog'. When I
installed plugin_wiki in the blog app I couldn't access it though. Whenever
I tried to load
On Wednesday, October 17, 2012 12:09:51 AM UTC-4, HittingSmoke wrote:
I set up my Webfaction hosting with a single web2py install that I intend
to use for a couple of subdomains pointing to separate apps using routes.py.
I pointed domain.com and blog.domain.com to my web2py app and through
I set up my Webfaction hosting with a single web2py install that I intend
to use for a couple of subdomains pointing to separate apps using routes.py.
I pointed domain.com and blog.domain.com to my web2py app and through
routes.py told web2py to point blog.domain.com to my blog app that I plan
Wow... I was really overthinking that. Still trying to transition from
Javascript to this.
Thanks!
On Mar 3, 12:25 am, Bruno Rocha rochacbr...@gmail.com wrote:
if form.process().accepted:
if request.vars.delete:
redirect(URL('index'))
On Sat, Mar 3, 2012 at 4:41 AM, HittingSmoke
...@gmail.com wrote:
if form.process().accepted:
if request.vars.delete:
redirect(URL('index'))
On Sat, Mar 3, 2012 at 4:41 AM, HittingSmoke hittingsm...@gmail.com wrote:
I created a very simple blog and when done editing a post, I am
redirected to the updated post.
This works great
)
if editBlog.process().accepted:
if request.vars.*delete_record:*
redirect(URL('index'))
else:
redirect(URL(f=view,
args=editBlog.vars.idhttp://editblog.vars.id/
))
return dict(editBlog=editBlog, post=post)
On Sat, Mar 3, 2012 at 4:35 PM, HittingSmoke
I'm learning Python and web2py together (I know, not recommended but
I'm having fun) by writing a small and simple blog.
I've run into a problem with 404s. When my app tries to pull up an
invalid blog ID I get a 'list index out of range' error ticket.
Ideally these should be 404 pages. Same goes
routes_on_error in routes.py:
http://web2py.com/books/default/chapter/29/4#Routes-on-error.
Anthony
On Saturday, March 3, 2012 4:04:05 PM UTC-5, HittingSmoke wrote:
I'm learning Python and web2py together (I know, not recommended but
I'm having fun) by writing a small and simple blog
if request.vars.delete_this_record works. If not, add
request.toolbar() to the page and inspect request.vars to see all the
variable names (don't do a redirect).
Anthony
On Saturday, March 3, 2012 3:52:50 PM UTC-5, HittingSmoke wrote:
Somehow it's still not catching it.
I edited the function a bit to make sure
I tried this change and it returns a new error: 'type
'exceptions.AttributeError' 'NoneType' object has no attribute 'title''. The
blow example fixed it up though. Thanks.
On Saturday, March 3, 2012 7:57:45 PM UTC-8, rochacbruno wrote:
On Sun, Mar 4, 2012 at 12:55 AM, HittingSmoke wrote
Thanks. The technical aspects go a bit above my head but this is a good
post for me to bookmark and use as a jumping off point for some reading.
After switching out .first() but before adding the 404 redirect I was
getting a 'type 'exceptions.AttributeError' 'NoneType' object has no
I created a very simple blog and when done editing a post, I am
redirected to the updated post.
This works great unless I'm deleting a post, in which case it spits
out an error because the post no longer exists.
How can I tell my controller to check the status of the deleted
checkbox before
Sorry if this is a dumb question. I'm working on a very basic blog and I'd
run into a hurdle which I thought would be very trivial. I've skimmed the
book looking for an answer but I can't seem to find one. Google searching
turns up nothing but dozens of unrelated results.
How do I get web2py
Thanks! At the moment this is just a personal blog that only I'm going to
be posting on so security isn't an issue. Once I start expanding it out
feature wise then I'll get more into security. I plan on eventually
branching it off as a forum app as well so it will be important eventually.
If you're just looking to add fields and not completely redefine your auth
table this is really simple. From the web2py book:
## after auth = Auth(db)
auth.settings.extra_fields['auth_user']= [
Field('address'),
Field('city'),
Field('zip'),
Field('phone')]
## before
Thank you. The issue has been submitted with a link back to this
thread.
On Jan 30, 6:51 am, Anthony abasta...@gmail.com wrote:
On Sunday, January 29, 2012 7:36:07 PM UTC-5, HittingSmoke wrote:
I'd like to use auth with only a username instead of first and last
name. I defined my own tables
I'd like to use auth with only a username instead of first and last
name. I defined my own tables without a first and last name but it
still causes issues throughout the app.
For instance, when I try to use appadmin to add a user to a new auth
group I get an error (type 'exceptions.KeyError'
Thanks, I'll use this for now.
+1 for Webfaction. It takes a bit of tweaking and configuration to get your
app running with the cheapest plan without hitting the RAM limit (which is
what I suspect some of the mentioned issues were) but once it's up and
running, it works great. I have my apps running on Lighttpd and couldn't
I'd like to remove the first and last name fields from auth but I
can't seem to find an easy way to do this. It would seem a more common
sense approach to me to keep the defaults to the basics (email,
password and username) and let the user decide what to include in
their app for optional fields.
Is there any way to run a standard PHP web app like vBulletin along
side web2py?
i.e. www.domain.com would load the web2py site and www.domain.com/vbulletin
would load the separate web app without web2py being involved?
So I would just use something like the code below in my httpd.conf
file? Would this work if I'm using a local IP address instead of a
domain as well?
NameVirtualHost *
VirtualHost *
ServerName www.domain.com
DocumentRoot /home/web2py
/VirtualHost
VirtualHost *
ServerName
88 matches
Mail list logo