Re: display readonly or not

2015-08-11 Thread Tony Peña
hmmm.. not work

the field max_account must be modify for superuser not for the staff.

class VeximDomainAdmin(admin.ModelAdmin):
list_display = ('domain', 'enabled', 'avscan', 'spamassassin',
'max_accounts')
list_filter = ('enabled',)
exclude = ('uid', 'gid', 'pipe', 'maildir', 'blocklists', 'complexpass')
readonly_fields = ('max_accounts',)

def ro_fields(self, request, obj=None):
if obj is None or request.user.is_superuser:
return self.readonly_fields
else:
return self.model._meta.get_all_field_names()

get_readonly_fields = ro_fields


2015-08-11 7:23 GMT+02:00 Mike Dewhirst :

> On 11/08/2015 7:25 AM, Tony Peña wrote:
>
>> hi
>>
>> i have this on my model.admin
>>
>> class MyDomainAdmin(admin.ModelAdmin):
>> Â  Â  list_display = ('domain', 'enabled', 'avscan', 'spamassassin',
>> 'max_accounts')
>> Â  Â  list_filter = ('enabled',)
>> Â  Â  exclude = ('uid', 'gid', 'maildir')
>>
>> # this part is my pseudo-code logic I want but i can't solved.
>> Â  Â  if not user.is_superuser
>> Â  Â  Â  Â  readonly_fields = ('max_accounts',)
>>
>>
> There is a get_read_only() method in the admin.ModelAdmin class. It
> normally returns self.readonly_fields but you can give it a callable.
>
>
> https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_readonly_fields
>
> As well as defining any readonly fields (for everyone) you want something
> like ...
>
> def ro_fields(self, request, obj=None):
> if obj is None or request.user.is_superuser:
> return self.readonly_fields
> else:
> return self.model._meta.get_all_field_names()
>
> ... then get_readonly_fields = ro_fields should make it happen like your
> pseudocode.
>
> Mike
>
>
>
> how can i set readonly for users staff? but normally modify for only
>> superusers?
>> --
>> Antonio Peña
>> Secure email with PGP 0x8B021001 available at https://pgp.mit.edu
>> <
>> https://pgp.mit.edu/pks/lookup?search=0x8B021001&op=index&fingerprint=on&exact=on
>> >
>> Fingerprint: 74E6 2974 B090 366D CE71Â  7BB2 6476 FA09 8B02 1001
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscr...@googlegroups.com
>> .
>> To post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>>
>> https://groups.google.com/d/msgid/django-users/CALBaCdsUys33wv1n6tMaiKvEj%2BXcZRPytO_os9xNFW4ij0Vu0w%40mail.gmail.com
>> <
>> https://groups.google.com/d/msgid/django-users/CALBaCdsUys33wv1n6tMaiKvEj%2BXcZRPytO_os9xNFW4ij0Vu0w%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/55C986EC.2030508%40dewhirst.com.au
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Antonio Peña
Secure email with PGP 0x8B021001 available at https://pgp.mit.edu

Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALBaCdshxP8Teq%2Bm9vhYhn3EaNR5VUxD%2BTkHCFqUCmXHxw%3D9-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


ATOMIC_REQUESTS Middleware inside Transaction

2015-08-11 Thread guettli
I am not happy that settings.ATOMIC_REQUESTS=True isolates only the view, 
but not the middlewares
in one transaction.

For applications like reversion (app which records the changes of a model) 
it is very important,
that the middleware runs inside the same transaction. If storing the changes
runs in a second transaction, inconsistencies will happen: Model got 
updated,
but storing the changes in the second transaction might fail.

We are in the process of updating our apps to Django 1.8.

At the moment our preferred solution:

 - set settings.ATOMIC_REQUESTS=False
 - Run an own middleware which starts and ends the transaction.

Nearly two years ago this kind of Middleware suggested in this list:

https://groups.google.com/forum/#!msg/django-users/njeVp4zT5HA/9g0wsFYZKAwJ

Related issue for app reversion: 
https://github.com/etianen/django-reversion/issues/268

What do you think?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/723c79cb-27d1-4a39-b269-08d84fdad0eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: display readonly or not

2015-08-11 Thread Daniel Roseman
On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote:
 

> There is a get_read_only() method in the admin.ModelAdmin class. It 
> normally returns self.readonly_fields but you can give it a callable. 
>
>
> https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_readonly_fields
>  
>
> As well as defining any readonly fields (for everyone) you want 
> something like ... 
>
> def ro_fields(self, request, obj=None): 
>  if obj is None or request.user.is_superuser: 
>  return self.readonly_fields 
>  else: 
>  return self.model._meta.get_all_field_names() 
>
> ... then get_readonly_fields = ro_fields should make it happen like your 
> pseudocode. 
>
> Mike 
>

Why do you define a separate method, then alias to get_readonly_fields? Why 
not override the method directly?
--
Daniel. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b43856c6-4e6f-435a-bee2-886110d2aa1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: display readonly or not

2015-08-11 Thread Tony Peña
because i don't know how... that's why i ask :)

2015-08-11 11:17 GMT+02:00 Daniel Roseman :

> On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote:
>
>
>> There is a get_read_only() method in the admin.ModelAdmin class. It
>> normally returns self.readonly_fields but you can give it a callable.
>>
>>
>> https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_readonly_fields
>>
>> As well as defining any readonly fields (for everyone) you want
>> something like ...
>>
>> def ro_fields(self, request, obj=None):
>>  if obj is None or request.user.is_superuser:
>>  return self.readonly_fields
>>  else:
>>  return self.model._meta.get_all_field_names()
>>
>> ... then get_readonly_fields = ro_fields should make it happen like your
>> pseudocode.
>>
>> Mike
>>
>
> Why do you define a separate method, then alias to get_readonly_fields?
> Why not override the method directly?
> --
> Daniel.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b43856c6-4e6f-435a-bee2-886110d2aa1a%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Antonio Peña
Secure email with PGP 0x8B021001 available at https://pgp.mit.edu

Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALBaCdvkBLE-dGoyg%2B-TrF9jEz5nuYWL237Nz21kUXpumPw91Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: display readonly or not

2015-08-11 Thread Mike Dewhirst

On 11/08/2015 7:17 PM, Daniel Roseman wrote:

On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote:
Â

There is a get_read_only() method in the admin.ModelAdmin class. It
normally returns self.readonly_fields but you can give it a callable.


https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_readonly_fields




As well as defining any readonly fields (for everyone) you want
something like ...

def ro_fields(self, request, obj=None):
     if obj is None or request.user.is_superuser:
         return self.readonly_fields
     else:
         return self.model._meta.get_all_field_names()

... then get_readonly_fields = ro_fields should make it happen like
your
pseudocode.

Mike


Why do you define a separate method, then alias to get_readonly_fields?
Why not override the method directly?


Because in some places/models in the admin I don't want to override the 
method; and in all (my) cases there needs to be readonly "modified" and 
"modified_by" fields for superusers as well.


Further, I put my ro_fields method in a common module and import it 
where required in a number of apps in that project.


Cheers

Mike


--
Daniel.Â

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b43856c6-4e6f-435a-bee2-886110d2aa1a%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55C9DC37.1040202%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thank you Russ. If it's not possible to do it easily in production then I
guess we are stuck with JavaScript, although I prefer Python. But without
jQuery, jQuery UI and other jQuery plugins I find it very difficult to
write client side scripts in Python. So I think we will write client side
scripts in JavaScript in Speedy Mail Software and other projects we will
have.

Uri.

*Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    
> Speedypedia in Hebrew and English


On Sun, Aug 9, 2015 at 4:05 AM, Russell Keith-Magee  wrote:

> On Sat, Aug 8, 2015 at 4:27 PM, Uri Even-Chen  wrote:
>
>> Hi Russ,
>>
>> I checked the projects you mentioned, but is it possible to communicate
>> with other JavaScript scripts such as jQuery, jQuery UI and plugins for
>> jQuery? I would like to have a way to communicate from Python to JavaScript
>> in the client side, otherwise I really think we will not be able to use
>> these projects in production.
>>
>> Hi Uri,
>
> It's possible - but it depends on the project and the tooling they
> provide. I know PyPy.js, for example, provides a JS/DOM bridge.
>
> However, as I said in my last email, at the moment, this isn't the easy
> path. Essentially, if you're asking the question "Is it possible", the
> answer for all practical purposes is effectively "no". Technically, it's
> possible, but you have to know what you're doing.
>
> Yours
> Russ Magee %-)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMQ2MsF-D5Kb5ge-%2BeJrTjCgTL9p11fH0sN4ZA8rnyU3Sr5niw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks for the feedback. Actually I asked this question also in the
django-users mailing list and Russell Keith-Magee told me about
Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing
lists) but I also asked if I can use JavaScript scripts such as jQuery,
jQuery UI and other jQuery plugins from the scripts in Python and Russell
said it's possible but not practical for production. And I'm thinking about
developing Speedy Mail Software or other projects for production (of course
after the alpha & beta are over) so I guess we are stuck with JavaScript
for the client side programming. And I don't mind if they use a compiler or
an interpreter or any other method to run Python in the client side, as
long as it works. But without using jQuery and other plugins it would be
very hard to use these projects in production.

Uri.

*Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    
> Speedypedia in Hebrew and English


On Mon, Aug 10, 2015 at 7:40 PM, Ian Kelly  wrote:

> On Fri, Aug 7, 2015 at 5:00 AM, Uri Even-Chen  wrote:
> >
> > Are you familiar with pyjs? I saw the website and I see that the latest
> stable release is from May 2012. Is it possible to use pyjs to compile
> Python to JavaScript? Which versions of Python are supported? Are versions
> 2.7 and 3.4 supported? And is it possible to use Django (in the client
> side) and JavaScript frameworks such as jQuery, jQuery UI and jQuery
> plugins together with pyjs?
>
> And if you check the commit history on GitHub, there are only two
> commits in the past year. The project was hijacked (i.e. forked plus
> "we're taking the domain name and the mailing list too") a few years
> ago (also in May 2012, I think not coincidentally), and that sadly
> seems to have slowly killed the development momentum on the project.
>
> I'm not really familiar with the space, but I tend to hear good things
> about Brython. PyPy.js and Skulpt are other alternatives. However, I
> think that all of these are implementations of Python in Javascript,
> not Python to Javascript compilers.
> --
> https://mail.python.org/mailman/listinfo/python-list
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMQ2MsEuk4Ow%3DDiU_WbSEHJEeBrkKDmhTK5AH8c0dckcBQdfiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


New tool to build django deb package

2015-08-11 Thread aRkadeFR

Hey guys,

I wanted to share with you a little project I did for myself first:
https://github.com/aRkadeFR/dh-python-django

It's a build system paired with debhelper. It helps you build .deb
django package with systemd/nginx/uWSGI/virtualenv.

It's not finished yet, and obviously I take into account only little
use case.

If anyone interested, I'm available and you can PR :)

--
aRkadeFR

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55CA0761.2020001%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread jsachs
I'm studying the Django Project tutorial 
 using Python 2.7 
(because that's my department's current standard) and Django 1.8.2 (because 
that's the current stable version).

The tutorial says, "If you are still using Python 2.7, you will need to 
adjust the code samples slightly, as described in comments." What comments 
does it mean?

The section "Playing with the API" instructs me to run the command:

$ python manage.py shell
or
>>> import django
>>> django.setup()

Being a methodical sort, I tried both. The first works. The second gives me 
a bunch of errors, beginning with:

Traceback (most recent call last):
  File "", line 1, in 
  File "c:\Python27\lib\site-packages\django\__init__.py", line 17, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)

I think it's complaining about an incompatibility between Python 2.7 and 
Python 3.2.

I can evade the immediate problem by using "python manage.py shell" 
instead, but I expect further problems in short order, and I need to know 
how to fix them.

So, where are these "comments" that tell me what to do? I don't see any in 
that part of the tutorial. I opened __init__.py, and there are no helpful 
comments there, either.

I could figure this out myself, but I can't see debugging my way through 
the entire Django codebase. I'm being paid to write an application, not fix 
up Django.

Either I'm missing the comments that the tutorial promised me, or it has 
left me in the lurch. Can someone explain, please?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/98c81681-2008-44f3-9f27-937359768f49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different auth user models withoout doing multi-table inheritance

2015-08-11 Thread James Schneider
>
>
> Hi James, thanks for the elaborate answer. Not that explicit OneToOne
> relationships are bad but I was just trying to avoid the overhead due to
> the JOINs that comes with it.
>
>>
>> Understood. Unless you specifically request the data either by accessing
the .merchant_data FK attribute or use select_related(), you shouldn't see
a JOIN. I stumbled across this video yesterday where Russell talks about
the user model and having only minimal authentication data in the primary
model vs. profile data in ancillary models, along with a bunch of other fun
topics like tracking names and genders within the user models.

http://www.rightrelevance.com/search/articles/hero?article=20db948267aa29156a7ca20a83b66d54a2953f19&query=django&taccount=django_rr

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVZvsaccR3G6b%3DrJi8WApHE-bXNzthxHtJcCavB66VRUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Andrew Farrell
Hi jsachs,

Could you reply to the list with a couple copy-pasted outputs to help
diagnose the problem?
1) From the window shell, could you run `python manage.py shell` and paste
the output? Could you also please run `dir` and paste that output?
2) Could you also trigger that same error the full error you are getting,
starting with "Traceback (most recent call last):" and ending where she
shell prints out the next line of '>>>' ?
3) After you run that, within the same python shell, can you get the result
of the python statement `import os; print
os.environ['DJANGO_SETTINGS_MODULE']`

-- Andrew


On Tue, Aug 11, 2015 at 11:56 AM,  wrote:

> I'm studying the Django Project tutorial
>  using Python
> 2.7 (because that's my department's current standard) and Django 1.8.2
> (because that's the current stable version).
>
> The tutorial says, "If you are still using Python 2.7, you will need to
> adjust the code samples slightly, as described in comments." What comments
> does it mean?
>
> The section "Playing with the API" instructs me to run the command:
>
> $ python manage.py shell
> or
> >>> import django
> >>> django.setup()
>
> Being a methodical sort, I tried both. The first works. The second gives
> me a bunch of errors, beginning with:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "c:\Python27\lib\site-packages\django\__init__.py", line 17, in
> setup
> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
>
> I think it's complaining about an incompatibility between Python 2.7 and
> Python 3.2.
>
> I can evade the immediate problem by using "python manage.py shell"
> instead, but I expect further problems in short order, and I need to know
> how to fix them.
>
> So, where are these "comments" that tell me what to do? I don't see any in
> that part of the tutorial. I opened __init__.py, and there are no helpful
> comments there, either.
>
> I could figure this out myself, but I can't see debugging my way through
> the entire Django codebase. I'm being paid to write an application, not fix
> up Django.
>
> Either I'm missing the comments that the tutorial promised me, or it has
> left me in the lurch. Can someone explain, please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/98c81681-2008-44f3-9f27-937359768f49%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2By5TLbBb1zSEN505rH1LfTZZewrv3Sm9XeNU6uN-AMTZ03KEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Carl Meyer
Hi,

On 08/11/2015 11:56 AM, jsa...@nvidia.com wrote:
> I'm studying the Django Project tutorial
>  using Python
> 2.7 (because that's my department's current standard) and Django 1.8.2
> (because that's the current stable version).
> 
> The tutorial says, "If you are still using Python 2.7, you will need to
> adjust the code samples slightly, as described in comments." What
> comments does it mean?

Python code comments, in the code samples that need adjusting. The first
example I see is in the `polls/models.py` code sample in this section:
https://docs.djangoproject.com/en/1.8/intro/tutorial01/#playing-with-the-api

See the "__unicode__ on Python 2" comments?

> The section "Playing with the API" instructs me to run the command:
> 
> $ python manage.py shell
> or
 import django
 django.setup()
> 
> Being a methodical sort, I tried both. The first works. The second gives
> me a bunch of errors, beginning with:
> 
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "c:\Python27\lib\site-packages\django\__init__.py", line 17, in setup
> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
> 
> I think it's complaining about an incompatibility between Python 2.7 and
> Python 3.2.

Can't say without seeing more of the traceback. I doubt it though, since
this only executes code in Django itself, which is fully compatible with
both Python 2 and 3.

> I can evade the immediate problem by using "python manage.py shell"
> instead, but I expect further problems in short order, and I need to
> know how to fix them.
> 
> So, where are these "comments" that tell me what to do? I don't see any
> in that part of the tutorial. I opened __init__.py, and there are no
> helpful comments there, either.

You don't need to adjust anything at all in Django itself to adapt to
Python 2; Django fully supports both 2 and 3. You just need to make sure
that the code you write yourself is Python 2 compatible. Where the
tutorial tells you to type some code in a file, it gives the Python 3
version, but has comments showing what needs to be adjusted for Python
2. There's nothing special you need to do until you get to those code
samples.

> I could figure this out myself, but I can't see debugging my way through
> the entire Django codebase. I'm being paid to write an application, not
> fix up Django.

You don't need to fix up Django.

> Either I'm missing the comments that the tutorial promised me, or it has
> left me in the lurch. Can someone explain, please?

Just continue with the tutorial, and read the code samples (including
comments) carefully, when you reach them.

Your issue when running `django.setup()` is probably entirely unrelated,
but in order to debug it we'd need to see the full traceback.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55CA31AA.4040707%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


InterfaceError: connection already closed from psycopg2 when running Django Tests

2015-08-11 Thread TheBeardedTemplar
I'm trying to implement testing on a fairly large Django site, and I'm 
encountering a psycopg2 error when running all the tests at once using 
`python manage.py test`. If I specify each app name individually, it works 
fine (some tests fail, but all for legitimate reasons), however when I run 
them all at once, it works as expected for the first 20-30 tests, and then 
I get a large number failing at once, all with an interface error.

==
ERROR: testFunctionality (proj.apps.myapp.tests.AppFunction)

--
Traceback (most recent call last):
  File "C:\projects\WidgetCo\src\django\widget\apps\app\tests.py", 
line 31, in setUp
data.createClients()
  File "C:\projects\WidgetCo\src\django\testApp\data.py", line 61, 
in createClients
createCompanies()
  File "C:\projects\WidgetCo\src\django\testApp\data.py", line 54, 
in createCompanies
company1.save()
  File "C:\Python27\lib\site-packages\django\db\models\base.py", 
line 710, in save
force_update=force_update, update_fields=update_fields)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", 
line 738, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, 
using, update_fields)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", 
line 822, in _save_table
result = self._do_insert(cls._base_manager, using, fields, 
update_pk, raw)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", 
line 861, in _do_insert
using=using, raw=raw)
  File "C:\Python27\lib\site-packages\django\db\models\manager.py", 
line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", 
line 920, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
  File 
"C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 972, 
in execute_sql
with self.connection.cursor() as cursor:
  File 
"C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 164, 
in cursor
cursor = self.make_cursor(self._cursor())
  File 
"C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 137, 
in _cursor
return self.create_cursor()
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 97, 
in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File 
"C:\Python27\lib\site-packages\django\db\backends\base\base.py", line 137, 
in _cursor
return self.create_cursor()
  File 
"C:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py"
, line 212, in create_cursor
cursor = self.connection.cursor()
InterfaceError: connection already closed


It looks like the postgresql database is closing mid-test, but I'm not sure 
why or how to stop it. I've tried setting a really high value for 
CONN_MAX_AGE as well as leaving it as default (never close). I've looked at 
the test where it starts to fail (it's always the same one) and nothing 
appears out of the ordinary. Any suggestions would be appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a8e52742-9e20-4854-b2ab-e972a7e54b1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks Fabio, it's very interesting. Are you related to Pyjeon Software? Do
we have to pay to use RapydScript? Is it ready for production?


*Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    
> Speedypedia in Hebrew and English


On Tue, Aug 11, 2015 at 8:54 PM, Fabio Zadrozny  wrote:

>
> On Tue, Aug 11, 2015 at 8:55 AM, Uri Even-Chen  wrote:
>
>> Thanks for the feedback. Actually I asked this question also in the
>> django-users mailing list and Russell Keith-Magee told me about
>> Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing
>> lists) but I also asked if I can use JavaScript scripts such as jQuery,
>> jQuery UI and other jQuery plugins from the scripts in Python and Russell
>> said it's possible but not practical for production. And I'm thinking about
>> developing Speedy Mail Software or other projects for production (of course
>> after the alpha & beta are over) so I guess we are stuck with JavaScript
>> for the client side programming. And I don't mind if they use a compiler or
>> an interpreter or any other method to run Python in the client side, as
>> long as it works. But without using jQuery and other plugins it would be
>> very hard to use these projects in production.
>>
>> Uri.
>>
>
>
> ​I think that you could try RapydScript: http://rapydscript.pyjeon.com/
>
> Cheers,
>
> Fabio
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMQ2MsFPEapmwTbCg2EH8W7KhK%2BBZyu_USHuWBJTSmgA00Renw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Testing Signals

2015-08-11 Thread Grant Means
I have an app that fires a custom signal when a specific method is called. 
I wrote a test that connects to the signal in setUp() and uses a local 
listener function to set a class attribute to True if the handler is 
called. You can see the relevant code here:

https://dpaste.de/mAGw

This works fine if I test the module directly using ./manage.py test  
test_models.py. However if I run test  or simply test the signals 
don't appear to connect. Using PyCharm I stepped through the code and found 
that when I call .connect() in my TestCase, and step into Signal.connect() 
I can see all of the expected receivers on `self.receivers`. 

However if I step into the Signal.send() method when the signal is fired, 
none of the expected receivers are in place. Again, this works if I test 
the module directly just not if I use `test ` or `test`. 

Does anyone have any guidance on how I could get this to work? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8390428d-f5a4-4e51-860f-6e7c1d965e6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pyjs - a compiler from Python to JavaScript

2015-08-11 Thread Uri Even-Chen
Thanks Fabio, we'll check RapydScript and we might use it for Speedy Mail
Software as well! I will check with the other developers (which are on
the speedy-mail-software list). In the past I had Speedy Mail online from
2000 to 2005 and it was based on a Perl script (Perl was popular in 2000).
But since it didn't support Unicode/UTF-8 encoding and didn't have a spam
filter I decided to close it in 2005 (after Google introduced Gmail). But I
think today it's easier to create software than it was in 2005, and I hope
next year we can launch Speedy Mail again, based on the Speedy Mail
Software we are developing (which will be free software & open source). I'm
looking forward to launching Speedy Mail as an alternative to Gmail.


*Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    
> Speedypedia in Hebrew and English


On Tue, Aug 11, 2015 at 10:08 PM, Fabio Zadrozny  wrote:

> Hi Uri,
>
> No, I'm not related to it. -- I'm the PyDev/Eclipse maintainer... that
> already takes a lot of my time ;)
>
> It's license is BSD (so, no need to pay). As it's just a way to convert
> from a Python-like syntax to JavaScript syntax you can even switch to plain
> JavaScript later on if you want -- in fact, when you debug the code you'll
> be debugging JavaScript and not Python (it's like CoffeScript but with a
> Python-like syntax).
>
> Cheers,
>
> Fabio
>
> On Tue, Aug 11, 2015 at 3:48 PM, Uri Even-Chen  wrote:
>
>> Thanks Fabio, it's very interesting. Are you related to Pyjeon Software?
>> Do we have to pay to use RapydScript? Is it ready for production?
>>
>>
>> *Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
>> Email: u...@speedy.net
>> Website: http://www.speedysoftware.com/uri/en/
>> 
>> 
>> 
>> 
>> > Speedypedia in Hebrew and English
>> 
>>
>> On Tue, Aug 11, 2015 at 8:54 PM, Fabio Zadrozny 
>> wrote:
>>
>>>
>>> On Tue, Aug 11, 2015 at 8:55 AM, Uri Even-Chen  wrote:
>>>
 Thanks for the feedback. Actually I asked this question also in the
 django-users mailing list and Russell Keith-Magee told me about
 Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing
 lists) but I also asked if I can use JavaScript scripts such as jQuery,
 jQuery UI and other jQuery plugins from the scripts in Python and Russell
 said it's possible but not practical for production. And I'm thinking about
 developing Speedy Mail Software or other projects for production (of course
 after the alpha & beta are over) so I guess we are stuck with JavaScript
 for the client side programming. And I don't mind if they use a compiler or
 an interpreter or any other method to run Python in the client side, as
 long as it works. But without using jQuery and other plugins it would be
 very hard to use these projects in production.

 Uri.

>>>
>>>
>>> ​I think that you could try RapydScript: http://rapydscript.pyjeon.com/
>>>
>>> Cheers,
>>>
>>> Fabio
>>>
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMQ2MsFRQ0vsFYMpkAN2VHxzKz5Rvm7CRAQiXjtCdpbtaymA5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Console Routes With Django ??

2015-08-11 Thread Prabath Peiris
Hi 

I am new to (kind of) Django framework and just finish the 
Django-REST-framework tutorials and it looks really cool. I am a big fan of 
ZendFramework2.0 (with Apigility) and trying to make parallels between 
these two frameworks. My primary question is about console routes. In ZF2 
you can define console routes very easily and execute same controllers as 
web API requests. What is the best way to accomplish this in Django 
(specially using REST framework). 

ZF2 console routes 
: http://framework.zend.com/manual/current/en/modules/zend.console.routes.html


Thanks
Prabath 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/192c3d1d-3bb1-4052-9e50-189c265efdeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problems installing a Django package

2015-08-11 Thread durirompepc
I did the tutorial for reusable apps for Django. All went well... but then 
I get problems when installing the app.
Processing ./django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz
  Requirement already satisfied (use --upgrade to upgrade): 
django-muro-humoristas==1 from 
file:///media/Comun/Programacion/Python/Django/Proyectos/muro_humoristas/django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz
 
in /home/rompepc/.local/lib/python3.2/site-packages
Building wheels for collected packages: django-muro-humoristas
  Running setup.py bdist_wheel for django-muro-humoristas
  Complete output from command /usr/bin/python3 -c "import 
setuptools;__file__='/tmp/pip-ip3iaz-build/setup.py';exec(compile(open(__file__).read().replace('\r\n',
 
'\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp3885trpip-wheel-:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
 or: -c --help [cmd1 cmd2 ...]
 or: -c --help-commands
 or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  
  Failed building wheel for django-muro-humoristas
Failed to build django-muro-humoristas

Searching about the error, it looks like I just have to install *wheel*. 
However, when I run the command *sudo pip install wheel* (*pip* is 
installed under *Python3*):
Requirement already satisfied (use --upgrade to upgrade): wheel in 
/usr/local/lib/python3.2/dist-packages

So, seeing that I can just going, I retry the package install and... get 
the same error: "*invalid command 'bdist_wheel'"*. Anyone could tell me 
what is going on? Is my first time doing a reusable app.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6287be74-ee45-4af5-b829-fa79aa1a6305%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Console Routes With Django ??

2015-08-11 Thread Gergely Polonkai
Hello,

as far as I know, Django doesn't have thin functionality built in. I would
be interested in such an app, though…

Best,
Gergely
On 11 Aug 2015 21:30, "Prabath Peiris"  wrote:

> Hi
>
> I am new to (kind of) Django framework and just finish the
> Django-REST-framework tutorials and it looks really cool. I am a big fan of
> ZendFramework2.0 (with Apigility) and trying to make parallels between
> these two frameworks. My primary question is about console routes. In ZF2
> you can define console routes very easily and execute same controllers as
> web API requests. What is the best way to accomplish this in Django
> (specially using REST framework).
>
> ZF2 console routes :
> http://framework.zend.com/manual/current/en/modules/zend.console.routes.html
>
>
> Thanks
> Prabath
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/192c3d1d-3bb1-4052-9e50-189c265efdeb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBULab3e6xbTJXfcbKB8GnMhbNsNrfE%2B7dHA2fHtZ11sXpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Serving uploaded files from multiple storages

2015-08-11 Thread 'Hugo Osvaldo Barrera' via Django users
I've an app where files are uploaded to differente storages:

Certain files uploaded via de the admin are uploaded to S3 (and served
via a CDN) (using a storage from django-storages).
Other files (user-uploaded files), are saved into into our local storage
(using the default FileField storage). These are served by nginx, since
they're usually only served between 0 and 2 times.

In other words, I have:

image = ImageField(
upload_to='media/', height_field='height', width_field='width'
)

And:

catalog_photo = ImageField(
storage=S3BotoStorage(),
)

I also need to show these files in different templates (and need the
admin to show the properly too!).
If I set MEDIA_URL to point to where I upload the first group, them URLs
for the second are broken, and viceversa.

How can I deal with this? Does the field have anything I can set that I
missed?
Also, how can I avoid this breaking in the admin, where editing the
template would be quite a bit more effort (that I'd like to avoid)?

Thanks,

-- 
Hugo Osvaldo Barrera

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1439335048.1737901.353839121.594E3662%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Re: Console Routes With Django ??

2015-08-11 Thread Tom Lockhart

> On Aug 11, 2015, at 12:29, Prabath Peiris  wrote:
> 
> Hi 
> 
> I am new to (kind of) Django framework and just finish the 
> Django-REST-framework tutorials and it looks really cool. I am a big fan of 
> ZendFramework2.0 (with Apigility) and trying to make parallels between these 
> two frameworks. My primary question is about console routes. In ZF2 you can 
> define console routes very easily and execute same controllers as web API 
> requests. What is the best way to accomplish this in Django (specially using 
> REST framework). 
> 
> ZF2 console routes : 
> http://framework.zend.com/manual/current/en/modules/zend.console.routes.html 
> 
affect the equivalent would be Django management commands.

hth

- Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/755F8E03-EE81-4379-876A-563DA2A0321B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Serving uploaded files from multiple storages

2015-08-11 Thread Javier Guerra Giraldez
On Tue, Aug 11, 2015 at 6:17 PM, 'Hugo Osvaldo Barrera' via Django
users  wrote:
> I've an app where files are uploaded to differente storages:


i would create a new storage object with a configuration that
associates some prefix with other 'backend' storage objects.  then
implement each storage method by stripping the prefix, using it to
determine the apropriate backend, and calling it with the rest of the
path.

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFkDaoTMnMS9egF3Mvvs1%2B%2B1tw-Khsn3BP-_VR1N-O0wLeqqEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


bulk add m2m relationship for multiple instances

2015-08-11 Thread yakkadesign
My app is getting killed by adding m2m relationships.  I can bulk create 
the objects but for the m2m I have to iterate over them which is super 
slow.  I'm looking for a way to bulk add the m2m relationships.   

Here is a example:
 class Sensor(models.Model):
Name = models.CharField( max_length=200 )
Value= models.FloatField()

class DataPoint(BaseModel):
Taken_datetime = models.DateTimeField( blank=True, null=True ) 
Sensors= models.ManyToManyField( SensorVal, blank=True, 
null=True )

for row in rows:
dp = DataPoint.objects.get(Taken_datetime=row['date']) 

sensorToAdd = []
for sensor in sensors:
s = Sensor.objects.get(Name=sensor.name, Value=sensor.value  )
sensorToAdd.append( s )

dp.Sensors.add( sensorToAdd )

In the actually app I bulk create all the DataPoint and Sensor instances.  
The problem is that |dp.Sensors.add( sensorToAdd )| does a lot of hits on 
the db.  I want a way bulk add all the sensors.  

Can I bulk add the m2m relationships in Django?  If not, can this be done 
in SQL and can you give me some pointers about where to get started?  I'm 
still a  

I'm a beginner with SQL but it seems like there should be a way to group 
all these calls together instead of creating one at a time.  

I'm using sqlite for development and postgres on the server.  

Here is the stack overflow I posted a few days ago: 
http://stackoverflow.com/questions/31907116/bulk-add-m2m-relationship-for-multiple-instances

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4b1c76b1-bd25-440f-b888-07f7a9a0a033%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Console Routes With Django ??

2015-08-11 Thread Gergely Polonkai
Not really. Management commands available in Django can't modify database
content as console routes does. Think about them as having a CRUD view set
that you can only call via a management command.
On 12 Aug 2015 01:23, "Tom Lockhart"  wrote:

>
> On Aug 11, 2015, at 12:29, Prabath Peiris 
> wrote:
>
> Hi
>
> I am new to (kind of) Django framework and just finish the
> Django-REST-framework tutorials and it looks really cool. I am a big fan of
> ZendFramework2.0 (with Apigility) and trying to make parallels between
> these two frameworks. My primary question is about console routes. In ZF2
> you can define console routes very easily and execute same controllers as
> web API requests. What is the best way to accomplish this in Django
> (specially using REST framework).
>
> ZF2 console routes :
> http://framework.zend.com/manual/current/en/modules/zend.console.routes.html
>
>
> affect the equivalent would be Django management commands.
>
> hth
>
> - Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/755F8E03-EE81-4379-876A-563DA2A0321B%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBUKcTNO27Htx%2BF5Rq7-GofG62UggvGzz%2BaLoEXM%2BOWhFxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.