web2py & pycharm...

724 views
Skip to first unread message

memilanuk

unread,
Sep 29, 2013, 4:35:52 PM9/29/13
to web...@googlegroups.com
Hello there,

The framework support for things like Flask and web2py finally sold me
and I purchased a new license for 3.0 the other day. Last night I
thought I'd try creating a new web2py project just to play with, and was
kind of disappointed when a brand new project already shows a bunch of
errors flagged in default.py for unresolved references for basic web2py
infrastructure like 'auth', 'crud', 'db', etc.

Am I missing something here? Seems kind of odd for a framework that is
supposed to be 'supported'...

Thanks,

Monte

Massimo Di Pierro

unread,
Sep 29, 2013, 5:56:38 PM9/29/13
to web...@googlegroups.com
I do not know. I am not aware that they contacted any of us for testing or support.

Tim Richardson

unread,
Sep 30, 2013, 3:28:30 AM9/30/13
to web...@googlegroups.com
This isn't my experience. 
First, try creating a new project via web2py admin, and then open the web2py directory in pycharm (not your application directory).
This should be fine, at least it is for me (so far I've used it on OS X, archlinux and Windows). 

I have just now created a new web2py project from within web2py, using the option "local web2py folder" on the second step of the new project creation (on OS X, maybe that's why it says folder) which looked ok, although the couple of new apps I've created and actually worked with have been via the admin app.

Arnon Marcus

unread,
Sep 30, 2013, 3:41:51 AM9/30/13
to web...@googlegroups.com
Works for me. All variables declared in files within an application's /models are available in autocompletion and inspection within controller files - as well as all web2py globals - they really did a surprisingly good job. Also variables declared in a controller-actions are available in it's respective view file - and jumping between them also works with the special icons that appear.
PyCharm 3.0 is awsome - though it seems pretty rough around the edges still. For example, the entire web2py support for a project (as mentioned above) is pretty fragile and demanding - the web2py folder itself "must" be called "web2py" - anything else, and the support for it brakes - even if the project was initially created as a "web2py project"... Also, you must create a new project for the support to apply - you cant just add an existing web2py folder and expect it to work - even if it is named correctly. You have to create a new project and in the wizard choose an existing web2py folder - PyCharm will still create a new project folder, but then copy-in the entier web2py folder from the path you gave it... It's no ideal, but it works.

Tim Richardson

unread,
Sep 30, 2013, 3:48:12 AM9/30/13
to web...@googlegroups.com
The problem with root folders named other than web2py will be fixed soon, so they say. The workaround is to open that root directory in pycharm and navigate to the app from there. This works. 

memilanuk

unread,
Sep 30, 2013, 7:20:17 AM9/30/13
to web...@googlegroups.com
On 09/29/2013 02:56 PM, Massimo Di Pierro wrote:
> I do not know. I am not aware that they contacted any of us for testing
> or support.
>

I never meant to imply that the *web2py* project supported PyCharm in
that way... rather that they claim web2py project as something their
product supports.


memilanuk

unread,
Sep 30, 2013, 7:59:07 AM9/30/13
to web...@googlegroups.com
On 09/30/2013 12:28 AM, Tim Richardson wrote:
> This isn't my experience.
> First, try creating a new project via web2py admin, and then open the
> web2py directory in pycharm (not your application directory).
> This should be fine, at least it is for me (so far I've used it on OS X,
> archlinux and Windows).
>
> I have just now created a new web2py project from within web2py, using
> the option "local web2py folder" on the second step of the new project
> creation (on OS X, maybe that's why it says folder) which looked ok,
> although the couple of new apps I've created and actually worked with
> have been via the admin app

I'm half-wondering if it was an artifact of possibly having another
(Flask) project open when I created the web2py one.

Later when I closed pycharm and deleted the entire directory that I had
the web2py project in, then opened pycharm and created a new project
from the start, that seems to not have all the 'unresolved reference'
errors. Or, if I start from scratch and just browse into an existing
web2py install, I get no errors.

Weird.


Tim Richardson

unread,
Sep 30, 2013, 3:34:57 PM9/30/13
to web...@googlegroups.com
I deleted existing .idea directories before using pycharm 3 with web2py apps.

Richard Vézina

unread,
Sep 30, 2013, 8:29:49 PM9/30/13
to web2py-users
This suppose to be solve :
http://youtrack.jetbrains.com/issue/PY-10810

I had issue with EAP version before the official release. Didnt try the release yet. But the issue was occuring for me when I set pycharm project at the app level :

web2py/applications/app/.idea

If project was setup like this :

pycharm_project/
    .idea
    web2py/applications/app

of like this :

web2py/
    .idea
    applications/app

I was working correct, no unresolved reference except for modules/module_filename.py where there was still some unresolved reference... I open a issue about that though.

Richard


On Mon, Sep 30, 2013 at 3:34 PM, Tim Richardson <t...@tim-richardson.net> wrote:
I deleted existing .idea directories before using pycharm 3 with web2py apps.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Paolo Valleri

unread,
Nov 14, 2013, 3:13:56 AM11/14/13
to web...@googlegroups.com
hi,
I've just tried the 'community edition' and I got many Unresolved references for request, response and so on. Have you found a way to fix ?

Paolo

Arnon Marcus

unread,
Nov 14, 2013, 3:35:50 AM11/14/13
to web...@googlegroups.com
The community edition does not support web2py.

Tim Richardson

unread,
Nov 14, 2013, 4:38:05 AM11/14/13
to web...@googlegroups.com
The book has some tips in using IDEs with web2py.
You can go a long way by adding in false imports
if false:
    import ...

see chapter "other recipes"

pycharm pro edition has built-in web2py support which means out of the box integrated debugger support and support for the all the includes. But with the tips in the book, you get pretty close. 

Those tips apply to any standard Python IDE. Personally, I don't think pycharm is particularly more awesome than eclipse+pydev (which is taking strides at the moment, development is motoring along after a hiatus), but PyCharm pro's built-in web2py support is good.



--
Tim Richardson

Richard Vézina

unread,
Nov 14, 2013, 9:54:13 AM11/14/13
to web2py-users
Paolo, I don't think the community version has the support for web2py included. Sadly, I think you have to pay for the professionnal version to get it...

Richard
Reply all
Reply to author
Forward
0 new messages