Re: [flask] flaskext.script within Archlinux
- From:
- Peter Ward
- Date:
- 2011-06-01 @ 12:14
Surely you wouldn’t be able to use ./manage.py without a hashbang line?
Does it work if you add "#!/usr/bin/env python2" as the first line of
manage.py?
On 1 June 2011 21:30, Alex <gfreezy@gmail.com> wrote:
> Hi Peter,
>
> First, thanks for replying.
>
> The problem occurs when i run flask-celery's example.
> The manage.py is listed below:
>
> *from __future__ import absolute_import*
> *from flaskext.script import Manager*
> *from flaskext.celery import install_commands as install_celery_commands*
> *
> *
> *from myapp import create_app*
> *
> *
> *app = create_app()*
> *manager = Manager(app)*
> *install_celery_commands(manager)*
> *
> *
> *if __name__ == "__main__":*
> * manager.run()*
> *
> *
> When i execute ./manage.py runserver, no error displays.However, when i
> refer to 'localhost:5000',
> the browser says 404. When just running 'python2 app.py', it works well.
>
> app.py is just as simple as a index page. And i am definitely sure than it
> has no mistakes.
>
>
>
> 2011/6/1 Peter Ward <peteraward@gmail.com>
>
>> Hi,
>>
>> This would only make a difference if Flask-Script invoked python in a
>> subprocess, but my cursory glance over the source code didn’t show this to
>> be happening.
>> And even then, I’d imagine the only sane way to invoke python would be to
>> use sys.executable.
>>
>> So, it should work fine—if it doesn’t, what is the specific error you’re
>> getting?
>> If you’re confused about the documentation always referring to "python
>> manage.py ...", don’t be, just mentally replace "python" with "python2".
>>
>> (yes, you should be using virtualenv, but I don't think that's the problem
>> here)
>>
>> Peter
>>
>> On 1 June 2011 15:56, Alex <gfreezy@gmail.com> wrote:
>>
>>> Hi everyone,
>>> flaskext.script seems to use 'python' to execute commands while Archlinux
>>> refers 'python' to 'python3', and 'python2' to 'python 2.*'.
>>> So flaskext.script can't works normally on my system.
>>> Where to change the command so it can work for the specific system.
>>> thanks.
>>>
>>
>>
>>
>> --
>> Peter Ward
>> http://flowblok.id.au/
>> BIT III, Sydney University
>>
>
>
--
Peter Ward
http://flowblok.id.au/
BIT III, Sydney University
Re: [flask] flaskext.script within Archlinux
- From:
- Alex
- Date:
- 2011-06-01 @ 12:20
I have changed it. The manage.py runs ok.
I mean './manage.py runserver' doesn't work correctly.
2011/6/1 Peter Ward <peteraward@gmail.com>
> Surely you wouldn’t be able to use ./manage.py without a hashbang line?
> Does it work if you add "#!/usr/bin/env python2" as the first line of
> manage.py?
>
>
> On 1 June 2011 21:30, Alex <gfreezy@gmail.com> wrote:
>
>> Hi Peter,
>>
>> First, thanks for replying.
>>
>> The problem occurs when i run flask-celery's example.
>> The manage.py is listed below:
>>
>> *from __future__ import absolute_import*
>> *from flaskext.script import Manager*
>> *from flaskext.celery import install_commands as install_celery_commands*
>> *
>> *
>> *from myapp import create_app*
>> *
>> *
>> *app = create_app()*
>> *manager = Manager(app)*
>> *install_celery_commands(manager)*
>> *
>> *
>> *if __name__ == "__main__":*
>> * manager.run()*
>> *
>> *
>> When i execute ./manage.py runserver, no error displays.However, when i
>> refer to 'localhost:5000',
>> the browser says 404. When just running 'python2 app.py', it works well.
>>
>> app.py is just as simple as a index page. And i am definitely sure than it
>> has no mistakes.
>>
>>
>>
>> 2011/6/1 Peter Ward <peteraward@gmail.com>
>>
>>> Hi,
>>>
>>> This would only make a difference if Flask-Script invoked python in a
>>> subprocess, but my cursory glance over the source code didn’t show this to
>>> be happening.
>>> And even then, I’d imagine the only sane way to invoke python would be to
>>> use sys.executable.
>>>
>>> So, it should work fine—if it doesn’t, what is the specific error you’re
>>> getting?
>>> If you’re confused about the documentation always referring to "python
>>> manage.py ...", don’t be, just mentally replace "python" with "python2".
>>>
>>> (yes, you should be using virtualenv, but I don't think that's the
>>> problem here)
>>>
>>> Peter
>>>
>>> On 1 June 2011 15:56, Alex <gfreezy@gmail.com> wrote:
>>>
>>>> Hi everyone,
>>>> flaskext.script seems to use 'python' to execute commands while
>>>> Archlinux refers 'python' to 'python3', and 'python2' to 'python 2.*'.
>>>> So flaskext.script can't works normally on my system.
>>>> Where to change the command so it can work for the specific system.
>>>> thanks.
>>>>
>>>
>>>
>>>
>>> --
>>> Peter Ward
>>> http://flowblok.id.au/
>>> BIT III, Sydney University
>>>
>>
>>
>
>
> --
> Peter Ward
> http://flowblok.id.au/
> BIT III, Sydney University
>