Re: Transforming django-admin.py to a shell script

2013-03-03 Thread Alon Nisser
Yes! Actually I also bumped into the annoying `ImportError: No module named 
django.core` problem, so fixing virtualenv would be a blessing.
*But.. *I still think this is the wrong path, since python setuptools has a 
better solution for that with cross platform compatibility etc.
Take a look 
at https://github.com/TurboGears/tg2devtools/blob/master/setup.py *vs *
https://github.com/django/django/blob/master/setup.py
you can see that Turbogears (as well as almost any other python 
webframework or commandline tool) uses setuptools entry points to establish 
a commandline script (under the working scripts/bin folder, according to 
the platform). why wouldn't Django do that? and then solve both problems in 
one shoot?

On Friday, March 1, 2013 8:25:50 PM UTC+2, Alon Nisser wrote:
>
> and then it could be called as `django-admin somecommend` instead of 
> `python django-admin.py somecommand`. 
> since python (using setuptools entry points) makes making a python script 
> into a shell script quite easy I guess this has been Discussed before but I 
> didn't find the discussion and the explanation why doesn't Django team deem 
> this path worthy.
> I think most python web frameworks use some kind of a shell script (or 
> using a customized paster/gearbox to provide this functionality) except for 
> Django.
>
> thanks for the clarification
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Transforming django-admin.py to a shell script

2013-03-02 Thread Joe Tennies
So, you are asking for the startproject (which again, you only run once, so
I wouldn't think it would be TOO bad) to create a manage.bat that had the
following line in it?

python manage.py %*

I'm not saying that this is a bad idea. It does make it fairly easy for
Windows people. In the case of Linux and Mac, I think the old way "just
works" in 90+% of the cases.

That stated, could we get the following lines added to virtualenv's
activate.bat:

assoc .py=Python.File
ftype Python.File=(magic path to python.exe or pythonw.exe)

>From what I'm reading*, that would solve this problem not just for Django
but for everyone. I'll create a patch for virtualenv once I get a chance to
test this theory.

*(
http://stackoverflow.com/questions/8012956/python-django-virtualenv-windows)




On Sat, Mar 2, 2013 at 2:57 PM, Alon Nisser  wrote:

> much simpler. simply making it run with simple `manage somecommand`
> instead of `python manage.py somecommand`. using setuptools or something
> similiar
>
> On Saturday, March 2, 2013 12:17:25 AM UTC+2, Łukasz Rekucki wrote:
>
>> On 1 March 2013 22:38, Alon Nisser  wrote:
>>
>>> at least from my windows exprience with Django (yes, I know this isn't a
>>> common use case, but still) the current django-admin.py and manage.py do
>>> need python preface to run right (while inside a virtualenv)
>>
>>
>> I'm not 100% sure if the Windows Python Launcher[1] works with
>> virtualenv, but it most likely works with venv support in Python 3.3. It
>> should also allow you to run Python scripts without the .py suffix
>>
>> Anyways, what kind of "shell" you had in mind? Batch ? Powershell ? Bash
>> ?.
>>
>> [1]: http://blog.python.org/**2011/07/python-launcher-for-**
>> windows_11.html
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers?hl=en
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Joe Tennies
tenn...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Transforming django-admin.py to a shell script

2013-03-02 Thread Alon Nisser
much simpler. simply making it run with simple `manage somecommand` instead 
of `python manage.py somecommand`. using setuptools or something similiar

On Saturday, March 2, 2013 12:17:25 AM UTC+2, Łukasz Rekucki wrote:
>
> On 1 March 2013 22:38, Alon Nisser >wrote:
>
>> at least from my windows exprience with Django (yes, I know this isn't a 
>> common use case, but still) the current django-admin.py and manage.py do 
>> need python preface to run right (while inside a virtualenv)
>
>
> I'm not 100% sure if the Windows Python Launcher[1] works with virtualenv, 
> but it most likely works with venv support in Python 3.3. It should also 
> allow you to run Python scripts without the .py suffix
>
> Anyways, what kind of "shell" you had in mind? Batch ? Powershell ? Bash ?.
>
> [1]: http://blog.python.org/2011/07/python-launcher-for-windows_11.html
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Transforming django-admin.py to a shell script

2013-03-01 Thread Łukasz Rekucki
On 1 March 2013 22:38, Alon Nisser  wrote:

> at least from my windows exprience with Django (yes, I know this isn't a
> common use case, but still) the current django-admin.py and manage.py do
> need python preface to run right (while inside a virtualenv)


I'm not 100% sure if the Windows Python Launcher[1] works with virtualenv,
but it most likely works with venv support in Python 3.3. It should also
allow you to run Python scripts without the .py suffix

Anyways, what kind of "shell" you had in mind? Batch ? Powershell ? Bash ?.

[1]: http://blog.python.org/2011/07/python-launcher-for-windows_11.html

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Transforming django-admin.py to a shell script

2013-03-01 Thread Alon Nisser
at least from my windows exprience with Django (yes, I know this isn't a 
common use case, but still) the current django-admin.py and manage.py do 
need python preface to run right (while inside a virtualenv) - but maybe 
I'm wrong, at least from my peak in Django setup.py It doesn't utilize 
`entrypoints` so I guess this is why on some platforms the basic shell 
usage fails. anyway wouldn't it be more future proof to start enabling the 
option to use Django-admin and manage as shell script. the current .py 
version would continue to work (even if in a somewhat broken way) but 
slowly the tutorials would move to simpler shell script without the .py 
ending.

On Friday, March 1, 2013 8:40:20 PM UTC+2, Alex Ogier wrote:
>
> On Fri, Mar 1, 2013 at 1:25 PM, Alon Nisser > 
> wrote: 
> > and then it could be called as `django-admin somecommend` instead of 
> `python 
> > django-admin.py somecommand`. 
> > since python (using setuptools entry points) makes making a python 
> script 
> > into a shell script quite easy I guess this has been Discussed before 
> but I 
> > didn't find the discussion and the explanation why doesn't Django team 
> deem 
> > this path worthy. 
> > I think most python web frameworks use some kind of a shell script (or 
> using 
> > a customized paster/gearbox to provide this functionality) except for 
> > Django. 
>
> django-admin.py is already an executable script. So you don't need 
> `python django-admin.py somecommand`, just `django-admin.py 
> somecommand` should suffice. The .py suffix is a bit ugly, to be sure, 
> but it's not worth breaking every single introductory tutorial on the 
> web to fix. Besides, it does have some merit as it is consistent with 
> `./manage.py somecommand`, which is the recommended way to run pretty 
> much every command except "startproject". 
>
> Best, 
> Alex Ogier 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Transforming django-admin.py to a shell script

2013-03-01 Thread Alex Ogier
On Fri, Mar 1, 2013 at 1:25 PM, Alon Nisser  wrote:
> and then it could be called as `django-admin somecommend` instead of `python
> django-admin.py somecommand`.
> since python (using setuptools entry points) makes making a python script
> into a shell script quite easy I guess this has been Discussed before but I
> didn't find the discussion and the explanation why doesn't Django team deem
> this path worthy.
> I think most python web frameworks use some kind of a shell script (or using
> a customized paster/gearbox to provide this functionality) except for
> Django.

django-admin.py is already an executable script. So you don't need
`python django-admin.py somecommand`, just `django-admin.py
somecommand` should suffice. The .py suffix is a bit ugly, to be sure,
but it's not worth breaking every single introductory tutorial on the
web to fix. Besides, it does have some merit as it is consistent with
`./manage.py somecommand`, which is the recommended way to run pretty
much every command except "startproject".

Best,
Alex Ogier

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Transforming django-admin.py to a shell script

2013-03-01 Thread Alon Nisser
and then it could be called as `django-admin somecommend` instead of 
`python django-admin.py somecommand`. 
since python (using setuptools entry points) makes making a python script 
into a shell script quite easy I guess this has been Discussed before but I 
didn't find the discussion and the explanation why doesn't Django team deem 
this path worthy.
I think most python web frameworks use some kind of a shell script (or 
using a customized paster/gearbox to provide this functionality) except for 
Django.

thanks for the clarification

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.