librelist archives

« back to archive

Running minitwit on Windows

Running minitwit on Windows

From:
austin aigbe
Date:
2014-10-01 @ 15:31
Hi,

Please how do I run the minitwit example on Windows?
https://github.com/mitsuhiko/flask/tree/master/examples/minitwit

I keep getting the following error message: AttributeError: 'Flask' object
has no attribute 'command'.

(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python
Python 2.7.7 (default, Jun  1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)]
on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
>>> flask.__version__
'0.10.1'
>>> exit()

(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python minitwit.py
flask -
-app=minitwit initdb
Traceback (most recent call last):
  File "minitwit.py", line 60, in <module>
    @app.command('initdb')
AttributeError: 'Flask' object has no attribute 'command'

(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>

Thanks.

Austin

Re: [flask] Running minitwit on Windows

From:
Leandro Poblet
Date:
2014-10-01 @ 15:45
I think that's part of the Flask-Script plugin, not Flask's core.

http://flask-script.readthedocs.org/en/latest/

Try with pip install flask-script and then running it again.

2014-10-01 12:31 GMT-03:00 austin aigbe <eshikafe@gmail.com>:

> Hi,
>
> Please how do I run the minitwit example on Windows?
> https://github.com/mitsuhiko/flask/tree/master/examples/minitwit
>
> I keep getting the following error message: AttributeError: 'Flask' object
> has no attribute 'command'.
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python
> Python 2.7.7 (default, Jun  1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)]
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import flask
> >>> flask.__version__
> '0.10.1'
> >>> exit()
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python minitwit.py
> flask -
> -app=minitwit initdb
> Traceback (most recent call last):
>   File "minitwit.py", line 60, in <module>
>     @app.command('initdb')
> AttributeError: 'Flask' object has no attribute 'command'
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>
>
> Thanks.
>
> Austin
>

Re: [flask] Running minitwit on Windows

From:
austin aigbe
Date:
2014-10-01 @ 18:39
@Leandro: I already have flask-script installed. Please see the print out:
(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>pip install
flask-script
Requirement already satisfied (use --upgrade to upgrade): flask-script in
c:\cyg
win\home\eausaig\saas\myproject\venv\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): Flask in
c:\cygwin\hom
e\eausaig\saas\myproject\venv\lib\site-packages (from flask-script)
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in
c:\cy
gwin\home\eausaig\saas\myproject\venv\lib\site-packages (from
Flask->flask-scrip
t)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
c:\cygw
in\home\eausaig\saas\myproject\venv\lib\site-packages (from
Flask->flask-script)

Requirement already satisfied (use --upgrade to upgrade):
itsdangerous>=0.21 in
c:\cygwin\home\eausaig\saas\myproject\venv\lib\site-packages (from
Flask->flask-
script)
Requirement already satisfied (use --upgrade to upgrade): markupsafe in
c:\cygwi
n\home\eausaig\saas\myproject\venv\lib\site-packages (from
Jinja2>=2.4->Flask->f
lask-script)
Cleaning up...

(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>


@Dorian: It has the .cli in line 60.

Have you tried running minitwit on Windows 7? If yes, what version of flask
did you use.

Thanks


On Wed, Oct 1, 2014 at 4:45 PM, Leandro Poblet <leandrodrhouse@gmail.com>
wrote:

> I think that's part of the Flask-Script plugin, not Flask's core.
>
> http://flask-script.readthedocs.org/en/latest/
>
> Try with pip install flask-script and then running it again.
>
> 2014-10-01 12:31 GMT-03:00 austin aigbe <eshikafe@gmail.com>:
>
> Hi,
>>
>> Please how do I run the minitwit example on Windows?
>> https://github.com/mitsuhiko/flask/tree/master/examples/minitwit
>>
>> I keep getting the following error message: AttributeError: 'Flask'
>> object has no attribute 'command'.
>>
>> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python
>> Python 2.7.7 (default, Jun  1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)]
>> on win
>> 32
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import flask
>> >>> flask.__version__
>> '0.10.1'
>> >>> exit()
>>
>> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python minitwit.py
>> flask -
>> -app=minitwit initdb
>> Traceback (most recent call last):
>>   File "minitwit.py", line 60, in <module>
>>     @app.command('initdb')
>> AttributeError: 'Flask' object has no attribute 'command'
>>
>> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>
>>
>> Thanks.
>>
>> Austin
>>
>
>

Re: [flask] Running minitwit on Windows

From:
austin aigbe
Date:
2014-10-01 @ 18:58
I finally found the problem - it was with the version of minitwit that I
was using. I was using the development version (
https://github.com/mitsuhiko/flask/tree/master/examples/minitwit) of
minitwit with version 0.10 of flask.

I downloaded the 0.10 version of minitwit (
https://github.com/mitsuhiko/flask/releases/tag/0.10.1) and it worked.

Flask 0.10 does not support .cli. It is only supported in the development
version (i.e from version 1.0)


C:\cygwin\home\eausaig\saas\myproject>venv\Scripts\activate
(venv) C:\cygwin\home\eausaig\saas\myproject>cd minitwit

(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python
Python 2.7.7 (default, Jun  1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)]
on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from minitwit import init_db; init_db()
>>> exit()

(venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python minitwit.py
 * Running on http://127.0.0.1:5000/
 * Restarting with reloader
127.0.0.1 - - [01/Oct/2014 19:49:17] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [01/Oct/2014 19:49:18] "GET /public HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:49:19] "GET /static/style.css HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:49:25] "GET /login HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:49:43] "POST /login HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:49:49] "GET /register HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:50:04] "POST /register HTTP/1.1" 302 -
127.0.0.1 - - [01/Oct/2014 19:50:04] "GET /login HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:50:19] "POST /login HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:50:24] "POST /login HTTP/1.1" 302 -
127.0.0.1 - - [01/Oct/2014 19:50:24] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [01/Oct/2014 19:50:37] "POST /add_message HTTP/1.1" 302 -
127.0.0.1 - - [01/Oct/2014 19:50:37] "GET / HTTP/1.1" 200 -


On Wed, Oct 1, 2014 at 7:39 PM, austin aigbe <eshikafe@gmail.com> wrote:

> @Leandro: I already have flask-script installed. Please see the print out:
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>pip install
> flask-script
> Requirement already satisfied (use --upgrade to upgrade): flask-script in
> c:\cyg
> win\home\eausaig\saas\myproject\venv\lib\site-packages
> Requirement already satisfied (use --upgrade to upgrade): Flask in
> c:\cygwin\hom
> e\eausaig\saas\myproject\venv\lib\site-packages (from flask-script)
> Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in
> c:\cy
> gwin\home\eausaig\saas\myproject\venv\lib\site-packages (from
> Flask->flask-scrip
> t)
> Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
> c:\cygw
> in\home\eausaig\saas\myproject\venv\lib\site-packages (from
> Flask->flask-script)
>
> Requirement already satisfied (use --upgrade to upgrade):
> itsdangerous>=0.21 in
> c:\cygwin\home\eausaig\saas\myproject\venv\lib\site-packages (from
> Flask->flask-
> script)
> Requirement already satisfied (use --upgrade to upgrade): markupsafe in
> c:\cygwi
> n\home\eausaig\saas\myproject\venv\lib\site-packages (from
> Jinja2>=2.4->Flask->f
> lask-script)
> Cleaning up...
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>
>
>
> @Dorian: It has the .cli in line 60.
>
> Have you tried running minitwit on Windows 7? If yes, what version of
> flask did you use.
>
> Thanks
>
>
> On Wed, Oct 1, 2014 at 4:45 PM, Leandro Poblet <leandrodrhouse@gmail.com>
> wrote:
>
>> I think that's part of the Flask-Script plugin, not Flask's core.
>>
>> http://flask-script.readthedocs.org/en/latest/
>>
>> Try with pip install flask-script and then running it again.
>>
>> 2014-10-01 12:31 GMT-03:00 austin aigbe <eshikafe@gmail.com>:
>>
>> Hi,
>>>
>>> Please how do I run the minitwit example on Windows?
>>> https://github.com/mitsuhiko/flask/tree/master/examples/minitwit
>>>
>>> I keep getting the following error message: AttributeError: 'Flask'
>>> object has no attribute 'command'.
>>>
>>> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python
>>> Python 2.7.7 (default, Jun  1 2014, 14:17:13) [MSC v.1500 32 bit
>>> (Intel)] on win
>>> 32
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import flask
>>> >>> flask.__version__
>>> '0.10.1'
>>> >>> exit()
>>>
>>> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python minitwit.py
>>> flask -
>>> -app=minitwit initdb
>>> Traceback (most recent call last):
>>>   File "minitwit.py", line 60, in <module>
>>>     @app.command('initdb')
>>> AttributeError: 'Flask' object has no attribute 'command'
>>>
>>> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>
>>>
>>> Thanks.
>>>
>>> Austin
>>>
>>
>>
>

Re: [flask] Running minitwit on Windows

From:
Dorian Hoxha
Date:
2014-10-01 @ 15:44
From looking at the github repo, your line doesn't have the ".cli" after
flask:

https://github.com/mitsuhiko/flask/blob/master/examples/minitwit/minitwit.py#L60

On Wed, Oct 1, 2014 at 5:31 PM, austin aigbe <eshikafe@gmail.com> wrote:

> Hi,
>
> Please how do I run the minitwit example on Windows?
> https://github.com/mitsuhiko/flask/tree/master/examples/minitwit
>
> I keep getting the following error message: AttributeError: 'Flask' object
> has no attribute 'command'.
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python
> Python 2.7.7 (default, Jun  1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)]
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import flask
> >>> flask.__version__
> '0.10.1'
> >>> exit()
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>python minitwit.py
> flask -
> -app=minitwit initdb
> Traceback (most recent call last):
>   File "minitwit.py", line 60, in <module>
>     @app.command('initdb')
> AttributeError: 'Flask' object has no attribute 'command'
>
> (venv) C:\cygwin\home\eausaig\saas\myproject\minitwit>
>
> Thanks.
>
> Austin
>