Re: simultaneously submit three forms on the same page

2014-07-31 Thread Santiago Lamora
2014-07-30 21:33 GMT+02:00 aRkadeFR :

> Excellent.
>
> Thanks for the share.
>
> How backward compatible is it?
>
> On 29/07/14 17:51, Santiago Lamora wrote:
> > 2014-07-29 16:50 GMT+02:00 John :
> >
> > > How can one submit 3 forms simultaneously?? Even ajax, is on by one!
> > >
> > >
> > Quotting
> > https://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms
> > > You can put several Django forms inside one  tag. To give each
> Form its
> > own namespace, use the prefix keyword argument:
> >
>


I think that is a pretty old feature. It's documented at least since django
1.3!!
https://docs.djangoproject.com/en/1.3/ref/forms/api/#prefixes-for-forms

-- 
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/CAEaW5xwz62%2Beng-PUrywZRs_AQ13jrNAZUVRQ7yrsFG85HRE8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access to custom fields in view?

2014-07-31 Thread Daniel Roseman
On Wednesday, 30 July 2014 19:02:00 UTC+1, Miguel Angel Yáñez Camacho wrote:

in my view in this code i can access to a regular field but i CANT access 
> to custom fields, give me error
> plantillas_db = templates_keyword.objects.select_related(
> 'plantilla').filter(keyword=bd_keywordsfinal, plantilla__state='1', 
> plantilla__promocionada=False).distinct().order_by(
> '-plantilla__inserted_date')
>
> s = set(plantillas_db)
> for i in s:
> print(i.id)
> print(i.responsive)
> print(i.engine)
>
> How can i access to this fields?
> thanks
>
> Miguel
>

*What* error you you get *exactly*? The code you've given should be fine, 
although it's cleaner to use the @property decorator rather than manually 
wrapping a function (but the functionality is exactly the same). Show us 
what happens.
--
DR.

-- 
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/7a02ccbd-a2b4-4a92-906d-21214bc89016%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


image upload

2014-07-31 Thread ngangsia akumbo
i have a problem of displaying my image on my web page.

i have upload my pic in admin and when i display it it shows me the  this

media/Lighthouse_1.jpg

models.py

class Image(models.Model):
title = models.CharField(max_length=60, blank=True, null=True)
image = models.FileField(upload_to="images")





 {{ blogs.title }} - Date Published: {{blogs.pub_date}} 
  {{ blogs.content|safe}} Tags: {{ blogs.photo }} 
  Reported By: {{blogs.reporter}} 
 


Return back to Main Page
News

 

{% endblock %}




MEDIA_ROOT = 
'C:/Python27/Scripts/testproject/Django-1.4.3/django/bin/test0/images/'
MEDIA_URL = '/media/'

STATIC_ROOT = '' "
STATIC_URL = '/static/'







-- 
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/ee0a99c1-b4aa-47fd-9e19-6937e2c0d705%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is creating a view necessary ?

2014-07-31 Thread VIPUL BANSAL
Hi all,

I have a complete HTML website and a few python scripts.
I want to run those scripts via HTML events such as clicking a button.

I read Django tutorial and found out that it is using Views to create HTML 
content.

Is there any way I can do it without using the Views and use the HTML code 
that I have already created ?

Thnaks,

-- 
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/d7f8d0b4-73c5-4cbc-bcd3-49d17ccc6c29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is creating a view necessary ?

2014-07-31 Thread Andreas Kuhne
Hi Vipul,

I think you should follow the Django tutorial a bit further. Your HTML
pages can be used as templates for the result of the views. Views in django
aren't the View in a MVC-pattern, but rather the controller (this was
something that confused me when I started in Django). So the python parts
of your code can be run in the views and your HTML pages can be used as
templates in Django.

Regards,

Andréas


2014-07-31 13:18 GMT+02:00 VIPUL BANSAL :

> Hi all,
>
> I have a complete HTML website and a few python scripts.
> I want to run those scripts via HTML events such as clicking a button.
>
> I read Django tutorial and found out that it is using Views to create HTML
> content.
>
> Is there any way I can do it without using the Views and use the HTML code
> that I have already created ?
>
> Thnaks,
>
> --
> 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/d7f8d0b4-73c5-4cbc-bcd3-49d17ccc6c29%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/CALXYUbmEH6Tq5aBw3%2BF%3D0jX3ru24dxFZ_FWzKV-JMb7Q%2BrcqyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


building a xenserver web client

2014-07-31 Thread marc
Hi,

is anyone interested in co-building a full featured web client for 
xenserver instances? 
Since version 6.2 the update procedures are really a pain which is one of 
my reasons to think about an (maintained) opensource client.

Ideas are welcome.
Cheers

-- 
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/9e7a3689-9b5e-4dba-865c-f46b6c047c9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Changeing website version

2014-07-31 Thread Zoltán Turcsányi
Hi Everyone,


I have a website written in python+django and I deployed it to 
pythonanywhere.com. It's okay, works well, but I want to deploy new 
versions. How should I do that?
Just copy the new files with rsync? Or change the full django project 
directory?
I would be really grateful if you wrote it step by step.


Thanks,
Zoli

-- 
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/318d6697-ce23-4902-92b2-71f8d663201b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to call a function when a project starts.

2014-07-31 Thread Bill Freeman
It runs twice because runserver uses two processes: the real server, and;
the monitoring process that restarts the other when you change a source
file. You could fool around with undocumented internals to figure out which
a given import is running in.  Or you could use a modifies runserver
command. Or you could modify manage.py. Or you could, if your O/S supports
it, open a file for exclusive use and the one that can't knows that it is
the server process.
On Jul 30, 2014 7:30 PM, "Mike Dewhirst"  wrote:

> On 31/07/2014 5:57 AM, Chen Xu wrote:
>
>> Hi Everyone:
>> I would like to call a function when my project starts, basically I want
>> to call a do_something() when I run python manage.py runserver. However,
>> when I put it into settings.py, it gets called twice, but I only want it
>> to execute once.
>>
>> Is there a good way to do it.
>>
>
> Maybe you could turn do_something() a singleton so it only executes once?
>
> http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python
>
>
>
>
>
>> Thanks
>>
>>
>> --
>> âš¡ Chen Xu âš¡
>>
>> --
>> 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/CACac-
>> qbTXbMGmYU%3D5R618rbt7pT%3DgTL%3DWAxhCR-prmuLbz-VKw%40mail.gmail.com
>> > qbTXbMGmYU%3D5R618rbt7pT%3DgTL%3DWAxhCR-prmuLbz-VKw%
>> 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/53D97FE6.3000301%40dewhirst.com.au.
> 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/CAB%2BAj0v1qGWYCXtJxBGqCRwSmYGfF%3DM54JXomAp-k-Hdd4OZAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to call a function when a project starts.

2014-07-31 Thread cmawebsite
I think if you put it in urls.py it should run (once) just before the first 
request.

On Thursday, July 31, 2014 10:30:08 AM UTC-4, ke1g wrote:
>
> It runs twice because runserver uses two processes: the real server, and; 
> the monitoring process that restarts the other when you change a source 
> file. You could fool around with undocumented internals to figure out which 
> a given import is running in.  Or you could use a modifies runserver 
> command. Or you could modify manage.py. Or you could, if your O/S supports 
> it, open a file for exclusive use and the one that can't knows that it is 
> the server process.
>

-- 
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/f4f7f03b-cbc0-46eb-a472-f75a0717d4cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


BigInt / Long for Auto Incrementing PK

2014-07-31 Thread Nicholas Haggmark
Hi Guys,

I need to create a couple of tables with 64-bit int data type primary keys. 
 I've been googling around and I haven't seen anything really recent in 
regards to this.  Does Django 1.7 support auto incrementing 64-bit int 
primary keys?  If not out of the box, does anyone have a reliable solution 
for this?

Thanks!

Nick Haggmark

-- 
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/5efe1c50-8a63-4a00-86e6-e83dea9640a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: building a xenserver web client

2014-07-31 Thread cmawebsite
You mentioned "full featured". Check out 
https://github.com/openstack/horizon if you haven't.

On Thursday, July 31, 2014 9:55:43 AM UTC-4, ma...@tubeards.com wrote:
>
> Hi,
>
> is anyone interested in co-building a full featured web client for 
> xenserver instances? 
> Since version 6.2 the update procedures are really a pain which is one of 
> my reasons to think about an (maintained) opensource client.
>
> Ideas are welcome.
> Cheers
>

-- 
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/c0320237-3d9d-4801-ac20-a3ec673f40f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: image upload

2014-07-31 Thread cmawebsite
Are you using   ?

On Thursday, July 31, 2014 7:20:19 AM UTC-4, ngangsia akumbo wrote:
>
> i have a problem of displaying my image on my web page.
>
> i have upload my pic in admin and when i display it it shows me the  this
>
> media/Lighthouse_1.jpg
>
> models.py
>
> class Image(models.Model):
> title = models.CharField(max_length=60, blank=True, null=True)
> image = models.FileField(upload_to="images")
>
>
> 
> 
>
>  {{ blogs.title }} - Date Published: {{blogs.pub_date}} 
>   {{ blogs.content|safe}} Tags: {{ blogs.photo }} 
>   Reported By: {{blogs.reporter}} 
>  
> 
> 
> Return back to Main Page
> News
> 
>  
> 
> {% endblock %}
>
>
>
>
> MEDIA_ROOT = 
> 'C:/Python27/Scripts/testproject/Django-1.4.3/django/bin/test0/images/'
> MEDIA_URL = '/media/'
>
> STATIC_ROOT = '' "
> STATIC_URL = '/static/'
>
>
>
>
>
>
>
>

-- 
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/a39e3250-7ded-4d1a-8a48-7b026d4a81b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: hanging django/postgres idle connections

2014-07-31 Thread cmawebsite
Does it work fine on django 1.6? It could be a regression.

On Wednesday, July 30, 2014 10:41:58 AM UTC-4, Jani Kajala wrote:
>
> Hi,
>
> I have a problem with leaking Postgres DB connections even if I 
> have CONN_MAX_AGE=0. Every time I start the server and stop it by 
> Ctrl+Break a DB connection is leaked.
>
> When I check from Postgres there is bunch of "idle" connections with 
> following content:
> SELECT "django_migrations"."app", "django_migrations"."name" FROM 
> "django_migrations"
>
> I'm running Python on Windows 8 + virtualenv with following installs:
> Django==1.7c1
> future==0.12.4
> psycopg2==2.5.3
> python3-memcached==1.51
> pytz==2014.4
> six==1.7.3
> sqlparse==0.1.11
> virtualenv==1.11.6
> xlwt-future==0.8.0
>
> Postgres is running in Ubuntu 14.04 in latest Oracle VirtualBox on same 
> Windows machine.
>
> Any ideas?
>
>
> Thanks,
> Jani
>
>

-- 
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/4855c62e-c322-45d0-bc93-da79957fd7f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: user object's is_authenticated() method ALWAYS return True even after they log out??

2014-07-31 Thread cmawebsite
Right, the question isn't "is user x logged into the website right now", it 
actually only makes sense for for request.user. This will return all users 
in the database: logged_in_users = [user for user in User.objects.all() if 
user.is_authenticated()]

-- 
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/5c439b95-7dd1-46bd-a356-b1074af79c7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why are DateTimeField auto_now and auto_now_add bad?

2014-07-31 Thread cmawebsite
It gets confusing if those fields are editable in the admin. I recommend 
setting editable=False on those fields.

On Sunday, July 27, 2014 6:47:33 PM UTC-4, Russell Keith-Magee wrote:
>
>
> I'm not aware of a formally documented list anywhere. 
>
> To the best my knowledge, the bug/downside that is referred to here is 
> that the fields *won't* automatically update in *every* circumstance. You 
> need to actually *save* the model to make the field update. Calls to 
> update, save_base, etc won't invoke the "auto" part of the field logic, and 
> the timestamp won't be adjusted.
>
> Yours,
> Russ Magee %-)
>
>
> On Sun, Jul 27, 2014 at 10:29 PM, Mattias Linnap  > wrote:
>
>> Hi all,
>>
>> I've seen DateTimeField's auto_now and auto_now_add parameters often 
>> described as "buggy" or "error-prone". For example:
>> https://code.djangoproject.com/ticket/22995
>> https://groups.google.com/forum/#!topic/django-developers/TNYxwiXLTlI
>>
>> The ticket proposes to document these downsides or problems in more 
>> detail. But until that happens, is there a blog post or mailing list post 
>> somewhere that summarises the gotchas to watch out for with auto_now?
>>
>> Thanks,
>>
>> Mattias
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/9d61eca2-21c7-41ae-a921-a448d5f9f4f9%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/0abd49f6-d55d-4b88-99ca-96560cdb501e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Screenshot pdf from AWS hosted django app

2014-07-31 Thread cmawebsite
I just use commandline imagemagick instead of PythonMagic, if the python 
bindings are the issue getting imagemagick to work.

cmd = 'convert -density 300 -flatten -interlace line -quality 92 
-colorspace sRGB -thumbnail'.split() + size + [default_storage.path(name) + 
'[0]', 'jpg:-']
proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
assert not proc.returncode, stderr + stdout
default_storage.save(request.path[1:], ContentFile(stdout))

-- 
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/7b9aff5d-de02-4cb5-8a2e-d8c65e0c3656%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Screenshot pdf from AWS hosted django app

2014-07-31 Thread cmawebsite
And if local dev is an issue, you could try setting MEDIA_URL to your live 
site.

-- 
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/f3e0d3cd-64e2-4ad1-95c6-a00dd2b1656d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Queryset with filtering on reverse foreign key failing

2014-07-31 Thread cmawebsite
What does the FieldError say?

-- 
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/4bba252c-1690-4eab-b1e8-62cb674aa151%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different choices values for a single field in inherited class

2014-07-31 Thread cmawebsite
class Color(models.Model):
red_or_white = models.CharField(max_length=10, choices=[('red', 'Red'), 
('white', 'White')])
tone = models.CharField(max_length=32)
 
class Wine(models.Model):
name = models.CharField(max_length=255)
color = models.ForeignKey(Color) 



-- 
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/f5769995-3563-40f1-a9aa-8d5a9298cbed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django limit_choices_to - ForeignKey

2014-07-31 Thread cmawebsite
If you are using the admin:

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_choice_field

Otherwise, you'll need to dynamically create that field or the entire form.

-- 
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/bdd0f989-c442-40fd-8d97-e6f282525ca9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I get Django to ignore javascript code because its throwing an exception

2014-07-31 Thread G Z
doesn't work because then my charts dont appear when i enclose the script 
tag.

On Wednesday, July 30, 2014 7:44:48 PM UTC-6, Camilo Torres wrote:
>
> Hello, you can use 'verbatim':
> https://docs.djangoproject.com/en/1.6/ref/templates/builtins/#verbatim
>
> On Wednesday, July 30, 2014 6:59:05 PM UTC-4:30, G Z wrote:
>>
>> so im using the following java script
>>
>> var cpuChart = document.getElementById('cpu').getContext('2d');
>> new Chart(cpuChart).Line(cpuData,{
>> bezierCurve: false,
>> datasetFill : false,
>> legendTemplate : "-legend\"><% 
>> for (var i=0; i> style=\"background-color:<%=datasets[i].lineColor%>\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%><%}%>"
>> 
>> });
>>
>> django will see the % signs and think it is block content as it says 
>> below i copy and pasted the error, how i get django to ignore a section of 
>> my code and not parse the tags for that section.
>>
>>
>> Request Method:POSTRequest URL:http://127.0.0.1:8000/vmstats/Django 
>> Version:1.6.5Exception Type:TemplateSyntaxErrorException Value:
>>
>> Invalid block tag: '>>
>> Exception 
>> Location:/usr/local/lib/python2.7/dist-packages/django/template/base.py 
>> in invalid_block_tag, line 332Python Executable:/usr/bin/pythonPython 
>> Version:2.7.5Python Path:
>>
>> ['/home/grant/workspace/Django Projects/trunk/holon',
>>  '/usr/lib/python2.7',
>>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>>  '/usr/lib/python2.7/lib-tk',
>>  '/usr/lib/python2.7/lib-old',
>>  '/usr/lib/python2.7/lib-dynload',
>>  '/usr/local/lib/python2.7/dist-packages',
>>  '/usr/lib/python2.7/dist-packages',
>>  '/usr/lib/python2.7/dist-packages/PILcompat',
>>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>>
>> Server time:Wed, 30 Jul 2014 23:27:32 +
>> Error during template rendering
>>
>> In template /home/grant/workspace/Django 
>> Projects/trunk/holon/portal/templates/vmstats.html, error at line *162*
>> Invalid block tag: '>> document.getElementById('iops').getContext('2d'); 153 new 
>> Chart(iopsChart).Line(iopsData,{ 154 bezierCurve: false, 155 datasetFill 
>> : false, 156 }); 157 158 var cpuChart = 
>> document.getElementById('cpu').getContext('2d'); 159 new 
>> Chart(cpuChart).Line(cpuData,{ 160 bezierCurve: false, 161 datasetFill : 
>> false, 162 legendTemplate : "> class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; 
>> i> style=\"background-color:<%=datasets[i].lineColor%>\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%><%}%>"
>>  
>> 163 164 }); 165 }
>>
>

-- 
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/b5db3b20-bceb-4b72-bc83-d52adb948b8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Data stats package and reporting help

2014-07-31 Thread James P
I'm building a report builder for my Django app and could use a little 
advice.

My reports are fairly simple where I accumulate scores of data (easy 
enough) but then I want to alter the report totals by varying dimensions 
(date ranges / split dates/weeks/months / owners / other metadata etc.). 
Since I am working with Django Querysets, I have some options as to how I 
can query the data into one query set with joins where I can traverse the 
joins for my accumulating data. Or I can take multiple querysets and join 
them in my app manually which simplifies the queries somewhat (this 
optimization might come later when I load test the app). 

My data might look something like this:

Parent (with useful dimensional metadata) -> Child (with useful dimensional 
metadata) ->Child of child (accumulating data source, i.e. Counts to 
aggregate)

I see some stuff about Pandas, also Anaconda. I took a brief look at both 
and they definitely both sound more hardcore than I need, but then I don't 
feel like rolling my own axis/dimensional modelling logic if I can perhaps 
build a dataset and have the app do it for me. Which package is recommended 
for babby's first stat package that can meet my requirements? Ideally one 
that uses less resources as I plan to scale this app up quite a bit in 
production.

Also for whichever package recommended, where would I find some good basic 
tutorials on how to build my dataset and alter it for reporting purposes? I 
plan to build charts on the client-side front-end with HTML5/js/css.

-- 
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/e70b70fa-abb1-4fd0-bb8b-3ec0497d9e80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: user object's is_authenticated() method ALWAYS return True even after they log out??

2014-07-31 Thread Chris Seberino
Is there a way to answer your question "is user x logged into the website 
right now" in Django code?

On Thursday, July 31, 2014 11:05:29 AM UTC-5, cmawe...@gmail.com wrote:
>
> Right, the question isn't "is user x logged into the website right now", 
> it actually only makes sense for for request.user. This will return all 
> users in the database: logged_in_users = [user for user in 
> User.objects.all() if user.is_authenticated()]
>
>

-- 
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/74b5580f-92b1-4d06-bc2e-c4747dba5357%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: user object's is_authenticated() method ALWAYS return True even after they log out??

2014-07-31 Thread cmawebsite
something like this may work:

from django.contrib.auth.models import User
from django.contrib.sessions.models import Session

User.objects.filter(id__in=(s.get_decoded().get('_auth_user_id') for s in 
Session.objects.all()))







for s in Session.objects.all()


-- 
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/02b02949-22cc-4211-a679-862c228a7715%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: user object's is_authenticated() method ALWAYS return True even after they log out??

2014-07-31 Thread cmawebsite
or for a specific user:

from django.contrib.sessions.models import Session

any(s.get_decoded().get('_auth_user_id') == user.id for s in Session.objects
.all())


-- 
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/6c360bd0-541d-4692-ba5d-c1c46b3c5c2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Queryset with filtering on reverse foreign key failing

2014-07-31 Thread Anthony
Could not resolve tblconfigagentgroupmembers.

I've resolved the issue now though. I moved the model to models.py from the
models_auto.py file and was then getting some validation errors mostly
missing id fields(just set primary keys on the generated models) and now
it's working as expected.


On Fri, Aug 1, 2014 at 12:18 AM,  wrote:

> What does the FieldError say?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/RtlHbhnTfro/unsubscribe.
> To unsubscribe from this group and all its topics, 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/4bba252c-1690-4eab-b1e8-62cb674aa151%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Anthony Hawkes
E-Mail: lifesillus...@gmail.com
Ph: 0400 372 260

-- 
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/CABqJoT2hy70rcEvhxWovejjO4RT95WF9rZHeBoJ9Na-UxWDShg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: image upload

2014-07-31 Thread ngangsia akumbo
no

On Thursday, July 31, 2014 4:43:15 PM UTC+1, cmawe...@gmail.com wrote:
>
> Are you using   ?
>
> On Thursday, July 31, 2014 7:20:19 AM UTC-4, ngangsia akumbo wrote:
>>
>> i have a problem of displaying my image on my web page.
>>
>> i have upload my pic in admin and when i display it it shows me the  this
>>
>> media/Lighthouse_1.jpg
>>
>> models.py
>>
>> class Image(models.Model):
>> title = models.CharField(max_length=60, blank=True, null=True)
>> image = models.FileField(upload_to="images")
>>
>>
>> 
>> 
>>
>>  {{ blogs.title }} - Date Published: {{blogs.pub_date}} 
>>   {{ blogs.content|safe}} Tags: {{ blogs.photo }} 
>>   Reported By: {{blogs.reporter}} 
>>  
>> 
>> 
>> Return back to Main Page
>> News
>> 
>>  
>> 
>> {% endblock %}
>>
>>
>>
>>
>> MEDIA_ROOT = 
>> 'C:/Python27/Scripts/testproject/Django-1.4.3/django/bin/test0/images/'
>> MEDIA_URL = '/media/'
>>
>> STATIC_ROOT = '' "
>> STATIC_URL = '/static/'
>>
>>
>>
>>
>>
>>
>>
>>

-- 
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/9889f679-b424-477c-a276-f44a2e395ce2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


invalid attribute

2014-07-31 Thread ngangsia akumbo
*Got an invalid attribut error*

class Product(models.Model):
name = models.CharField(max_length=255, unique=True)
slug = models.SlugField(max_length=255, unique=True,
help_text="Each product has a unique name")
brand = models.CharField(max_length=50)
sku = models.CharField(max_length=50)
price = models.DecimalField(max_length=9, decimal_places=3)
old_price = models.DecimalField(max_length=9, decimal_places=3, 
blank=True, default=0.00)
image = models.CharField(max_length=50)
is_active = models.BooleanField(default=True)
is_bestseller = models.BooleanField(default=False)
is_featured = models.BooleanField(default=False)
quantity = models.IntegerField()
description = models.TextField()
meta_keywords = models.CharField('Meta Keywords', max_length=300)
meta_description = models.CharField("Meta Description", max_length=255)

created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
category = models.ManyToManyField(Category)


class Meta:
db_table = 'products'
ordering = ['-created_at']

def __unicode(self):
return self.name


@models.permalink
def get_absolute_url(self):
return ('catalog_product', (), { 'product_slug': self.slug })


def sale_price(self):
if self.old_price > self.price:
return self.price
else:
return None




-- 
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/ac5af6a4-c497-4ba9-8d04-17a97f051729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get latest timestamp+value from each group

2014-07-31 Thread Joshua Lyon
I would also add that using the Max ID as the annotation field for the 
device (group) is what I am using in the interim, but it only works since 
currently my log IDs are automatically generated and each newly entered 
timestamp is younger than the previous. My concern is that I would like to 
extend the application to allow the possibility of backfilling data 
(entering old timestamps) in which case the Max IDs are no longer a good 
proxy for the Max timestamps.

devices = Device.objects.annotate(max_log_id=Max("log__id"))
logs = Log.objects.filter(id__in=[device.max_log_id for device in devices])

Any thoughts or suggestions?

On Wednesday, July 30, 2014 2:11:49 PM UTC-5, Joshua Lyon wrote:
>
> I have a basic Django application which uses sqlite as a backend on 
> low-end hardware (eg. Raspberry Pi). I have the RPi collecting sensor data 
> and logging it. I am trying to get the last process value, timestamp, and 
> associated sensor name in an efficient way, but can't seem to figure it out 
> with the Django ORM.
>
> *models.py*
> class Device(models.Model):
> name = models.CharField(max_length=30)
>
>
> class Log(models.Model):
> timestamp = models.IntegerField()
> value = models.FloatField()
>
> device = models.ForeignKey(Device)
>
>
> class Meta:
> unique_together = ("timestamp", "device")
>
> The following works, but is inefficient as it requires multiple SQL calls 
> (one to start and then one for each device):
> devices = Device.objects.all()
>
> series = []
> for device in devices:
> log = Log.objects.filter(mapping_id=device.id).latest("timestamp")
> series.append({"name": device.name,
>"timestamp": log.timestamp,
>"value": log.value})
>
>
> I have searched around and it seems the annotate() method might be able to 
> help, but I can't seem to figure out how to get the associated value along 
> with the max timestamp:
> Log.objects.values("device__name").annotate(timestamp=Max("timestamp"))  # 
> missing log value!
>   # or
> Device.objects.annotate(timestamp=Max("log__timestamp"))  # missing log 
> value!
>
>
>

-- 
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/07f467fa-1d97-4bd3-a2a0-fe520ce01395%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I get Django to ignore javascript code because its throwing an exception

2014-07-31 Thread Mike Dewhirst

On 1/08/2014 3:37 AM, G Z wrote:

doesn't work because then my charts dont appear when i enclose the
script tag.


Can you put the js into a file and use the template to include it?



On Wednesday, July 30, 2014 7:44:48 PM UTC-6, Camilo Torres wrote:

Hello, you can use 'verbatim':
https://docs.djangoproject.com/en/1.6/ref/templates/builtins/#verbatim


On Wednesday, July 30, 2014 6:59:05 PM UTC-4:30, G Z wrote:

so im using the following java script

var cpuChart = document.getElementById('cpu').getContext('2d');
 new Chart(cpuChart).Line(cpuData,{
 bezierCurve: false,
 datasetFill : false,
 legendTemplate : "-legend\"><% for (var i=0;
i\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%><%}%>"
 });

django will see the % signs and think it is block content as it
says below i copy and pasted the error, how i get django to
ignore a section of my code and not parse the tags for that section.


Request Method: POST
Request URL:http://127.0.0.1:8000/vmstats/
Django Version: 1.6.5
Exception Type: TemplateSyntaxError
Exception Value:

Invalid block tag: '>-legend\"><% for (var i=0;
i\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%><%}%>"

163 
164 });
165 }

--
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/b5db3b20-bceb-4b72-bc83-d52adb948b8c%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/53DAC7E4.1000101%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Anyone got Django working on Google App Engine? Seems there are inconsistent, incomplete and conflicting docs. Any advice appreciated....SOS

2014-07-31 Thread Chris Seberino
Is this the latest greatest docs for Django on Google AppEngine?

http://django-nonrel.org/

There seems to be another page high on a search:
  
  
  http://www.allbuttonspressed.com/projects/djangoappengine#installation

With the first doc I was able to get a toy Django app running with the 
local devserver but that
page has scanty instructions for getting models and uploading to Google 
beyond that!?!?

e.g.

(1) In various places it says to do "manage.py deploy" in order to deploy 
your app.
 The problem is that "deploy" isn't a normal Django switch for 
manage.py.
  The docs insinuate you need to somehow use djangoappengine but there
is no mention of how to magically tweak manage.py with 
djangoappengine
   so that the "deploy" switch appears suddenly.

(2) It isn't clear how to create models and use them.  I was getting errors
  about me not having permission to do this.

Any help greatly appreciated.

Sincerely,

Chris 

-- 
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/e9b6687b-3703-4ae4-9af7-fd46726a27c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid attribute

2014-07-31 Thread cmawebsite
Do you have the full error message?


On Thursday, July 31, 2014 5:48:55 PM UTC-4, ngangsia akumbo wrote:
>
> *Got an invalid attribut error*
>
> class Product(models.Model):
> name = models.CharField(max_length=255, unique=True)
> slug = models.SlugField(max_length=255, unique=True,
> help_text="Each product has a unique name")
> brand = models.CharField(max_length=50)
> sku = models.CharField(max_length=50)
> price = models.DecimalField(max_length=9, decimal_places=3)
> old_price = models.DecimalField(max_length=9, decimal_places=3, 
> blank=True, default=0.00)
> image = models.CharField(max_length=50)
> is_active = models.BooleanField(default=True)
> is_bestseller = models.BooleanField(default=False)
> is_featured = models.BooleanField(default=False)
> quantity = models.IntegerField()
> description = models.TextField()
> meta_keywords = models.CharField('Meta Keywords', max_length=300)
> meta_description = models.CharField("Meta Description", max_length=255)
> 
> created_at = models.DateTimeField(auto_now_add=True)
> updated_at = models.DateTimeField(auto_now=True)
> category = models.ManyToManyField(Category)
>
>
> class Meta:
> db_table = 'products'
> ordering = ['-created_at']
>
> def __unicode(self):
> return self.name
>
>
> @models.permalink
> def get_absolute_url(self):
> return ('catalog_product', (), { 'product_slug': self.slug })
>
> 
> def sale_price(self):
> if self.old_price > self.price:
> return self.price
> else:
> return None
>
> 
> 
>
>

-- 
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/917e4e0c-89fe-4c11-8fb4-a26a1f4c9550%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Changing website version written in python+django

2014-07-31 Thread Zoltán Turcsányi
Hi Everyone,


I have a website written in python+django and I deployed it to 
pythonanywhere.com. It's okay, works well, but I want to deploy new 
versions. How should I do that?
Just copy the new files with rsync? Or change the full django project 
directory?
I would be really grateful if you wrote it step by step.


Thanks,
Zoli

-- 
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/cb3e728b-433a-4e47-974b-b8e6a40eb07c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Changing website version written in python+django

2014-07-31 Thread Lachlan Musicman
You can copy the files on top of the old files and then restart the
web server, which will bump the wsgi or fastcgi, which should be
sufficient.

cheers
L.

On 1 August 2014 15:06, Zoltán Turcsányi  wrote:
> Hi Everyone,
>
>
> I have a website written in python+django and I deployed it to
> pythonanywhere.com. It's okay, works well, but I want to deploy new
> versions. How should I do that?
> Just copy the new files with rsync? Or change the full django project
> directory?
> I would be really grateful if you wrote it step by step.
>
>
> Thanks,
> Zoli
>
> --
> 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/cb3e728b-433a-4e47-974b-b8e6a40eb07c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You have to be really clever to come up with a genuinely dangerous
thought. I am disheartened that people can be clever enough to do that
and not clever enough to do the obvious thing and KEEP THEIR IDIOT
MOUTHS SHUT about it, because it is much more important to sound
intelligent when talking to your friends.
This post was STUPID.
---
The Most Terrifying Thought Experiment of All Time
http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html

-- 
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/CAGBeqiMG1-PWQ7HdACew2ii_qWdJzYXki%2B0Z4NotHf597cBkkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Redirect with string?

2014-07-31 Thread Lachlan Musicman
Hi all,

I have a thermal line printer (a Zebra LP2824 fwiw) and I've
discovered/worked out that I can print with it by just sending a text,
a la:

cat filename | nc  

I tried this in my view:

return redirect("", "string")

but it's printing out the HttpResponse object.

How would I send a string to the IP in question from a view?

cheers
L.


-- 
You have to be really clever to come up with a genuinely dangerous
thought. I am disheartened that people can be clever enough to do that
and not clever enough to do the obvious thing and KEEP THEIR IDIOT
MOUTHS SHUT about it, because it is much more important to sound
intelligent when talking to your friends.
This post was STUPID.
---
The Most Terrifying Thought Experiment of All Time
http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html

-- 
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/CAGBeqiME_VTnjZxLe2rAWJOm%3DCkq1ejpr0owtoOs6n8sNa56zA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: building a xenserver web client

2014-07-31 Thread marc
Openstack is huge. I'll prefer a lightweight solution, maybe just HTML/CSS 
(if there is already a good Soap client for JS). But this should be 
compatible to most of the API features provided by xen.

Am Donnerstag, 31. Juli 2014 17:39:53 UTC+2 schrieb cmawe...@gmail.com:
>
> You mentioned "full featured". Check out 
> https://github.com/openstack/horizon if you haven't.
>
> On Thursday, July 31, 2014 9:55:43 AM UTC-4, ma...@tubeards.com wrote:
>>
>> Hi,
>>
>> is anyone interested in co-building a full featured web client for 
>> xenserver instances? 
>> Since version 6.2 the update procedures are really a pain which is one of 
>> my reasons to think about an (maintained) opensource client.
>>
>> Ideas are welcome.
>> Cheers
>>
>

-- 
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/8214660c-6a6a-4b78-b21c-afa51a959090%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Changing website version written in python+django

2014-07-31 Thread Zoltán Turcsányi
THX
Z


2014. augusztus 1., péntek 7:12:38 UTC+2 időpontban Lachlan Musicman a 
következőt írta:
>
> You can copy the files on top of the old files and then restart the 
> web server, which will bump the wsgi or fastcgi, which should be 
> sufficient. 
>
> cheers 
> L. 
>
> On 1 August 2014 15:06, Zoltán Turcsányi > 
> wrote: 
> > Hi Everyone, 
> > 
> > 
> > I have a website written in python+django and I deployed it to 
> > pythonanywhere.com. It's okay, works well, but I want to deploy new 
> > versions. How should I do that? 
> > Just copy the new files with rsync? Or change the full django project 
> > directory? 
> > I would be really grateful if you wrote it step by step. 
> > 
> > 
> > Thanks, 
> > Zoli 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to django...@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/cb3e728b-433a-4e47-974b-b8e6a40eb07c%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> You have to be really clever to come up with a genuinely dangerous 
> thought. I am disheartened that people can be clever enough to do that 
> and not clever enough to do the obvious thing and KEEP THEIR IDIOT 
> MOUTHS SHUT about it, because it is much more important to sound 
> intelligent when talking to your friends. 
> This post was STUPID. 
> ---
>  
>
> The Most Terrifying Thought Experiment of All Time 
>
> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>  
>

-- 
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/36e6ed5a-2023-4296-a617-7a0a53511e21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.