How ignore tags when use makemessages?

2014-08-01 Thread Neto
I have the following line:

Olá a todos bem-vindos ao site!

After using makemessages is generated the following lines in the '.po' file:

msgid "Olá a todos, bem-vindo!"
msgstr ""

I repeat the span tag? Or is there a method to not appear in the 
translation file?

-- 
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/11076dad-f1cb-461a-ac7b-ef4cead0adc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problem with limit_choices_to and filtering foreign key

2014-08-01 Thread Hilde Rafaelsen
I have two models, ReqForChange(models.Model) and RfcStatus(models.Model).

class ReqForChange(models.Model):
rfc = models.AutoField (primary_key=True)
   user = models.ForeignKey(User, verbose_name="Requested by")
  status = models.ForeignKey(Status, verbose_name="RfC State")
   effectOnUsers = models.NullBooleanField("Effect", blank=True, 
null=True) 



class RfcStatus(models.Model):
rfcd = models.AutoField (primary_key=True)
rfcStatusDateCreated = models.DateField("Created date", 
default=datetime.now())
rfc_details = models.ForeignKey(ReqForChange, 
limit_choices_to={'effectOnUsers': True}, blank=True, null=True)


In my admin page I want the user to register a new ReqForChange  and when 
the user open the RfcStatus the dropdown menu for the field effectOnUsers 
shall only display items where effectOnUsers is set to True. This do not 
work and I can't understand why? I have tried the limit_choice_to on the 
User field in the ReqForChange model, and that works fine.

I hope someone can give me a hint on how I can manage to filter values for 
my rfc_details field. I run django 1.6

Best regards,

Hilde T L Rafaelsen

-- 
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/24dee8af-5686-45db-af1b-26fa17d91125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid attribute

2014-08-01 Thread ngangsia akumbo
class Meta invalid attribute , price_sale, get_absolute_url

On Friday, August 1, 2014 3:10:40 AM UTC+1, cmawe...@gmail.com wrote:
>
> 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/ee279689-4e9d-4147-89bf-2b9fecd317cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using settings.LOGIN_URL and django.core.urlresolvers.reverse

2014-08-01 Thread Michel Rugenbrink
Have you tried using reverse_lazy instead of reverse?

On Wednesday, April 25, 2007 12:32:16 PM UTC+2, Matt wrote:
>
> Hi everyone,
>
> I have a quick question about the new LOGIN_URL, LOGOUT_URL, and
> LOGIN_REDIRECT_URL settings.  If, in my project's settings module, I
> write:
>
> LOGIN_URL = '/blah/'
> LOGOUT_URL = '/blah/blah/'
> LOGIN_REDIRECT_URL = '/blah/blah/blah/'
>
> They work just fine.  But I want to remove hard-coded URLs from my
> code; so I write:
>
> from django.core.urlresolvers import reverse
> LOGIN_URL = reverse('django.contrib.auth.views.login')
> LOGOUT_URL = reverse('django.contrib.auth.views.logout')
> LOGIN_REDIRECT_URL = reverse('gigall.apps.accounts.views.profile')
>
> This fails; the URLs used are Django's defaults.
>
> Does anyone know why this is so?  And can I work around it?
>
> Cheers,
> M.
>
> --
> Matt Riggott (mailto:matt.r...@gmail.com ).
> Dictated but not read.
>
>

-- 
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/f3c500d7-1312-4c09-b8b7-c33ce43d9060%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid attribute

2014-08-01 Thread Daniel Roseman
On Friday, 1 August 2014 11:55:10 UTC+1, ngangsia akumbo wrote:
>
> class Meta invalid attribute , price_sale, get_absolute_url
>
>>
>>>
You *have* to do better than this. As I have told you before, you must 
provide *all* the relevant information if you want people to help you.

Put yourself in our position. Can you imagine answering your question with 
the information you have provided so far? It is completely impossible. To 
start off with, you didn't even bother to say what the error was. When 
cmawe asked you for the full error message, you didn't cut and paste the 
actual error, but replied with this incomprehensible snippet.

*What* was the error? Where did it happen? What did Django say? What does 
this have to do with "class Meta"? How can the error be "price_sale" when 
you don't use that name in your code anywhere?

If you can provide the information, we can help you. Otherwise, we can't.
--
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/b470673e-76ba-461b-8bfc-8d64273320ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: invalid attribute

2014-08-01 Thread Collin Anderson
all of your methods are indented too much. They should be at the same level 
as `class Meta`, not part of it.

-- 
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/894f1d6e-7a96-45fb-8e37-229221c49b37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect with string?

2014-08-01 Thread Collin Anderson
redirect is a django shortcut for an http redirect response, not a 
file/pipe redirect. You need to use a python socket to connect to the ip 
address.

http://stackoverflow.com/questions/68774/best-way-to-open-a-socket-in-python

-- 
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/4fa95d46-e174-4ece-a3b0-82050d97458b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect with string?

2014-08-01 Thread Lachlan Musicman
Thanks Collin, I'll test on Monday
L.

On 1 August 2014 22:47, Collin Anderson  wrote:
> redirect is a django shortcut for an http redirect response, not a file/pipe
> redirect. You need to use a python socket to connect to the ip address.
>
> http://stackoverflow.com/questions/68774/best-way-to-open-a-socket-in-python
>
> --
> 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/4fa95d46-e174-4ece-a3b0-82050d97458b%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/CAGBeqiO%3DXy5tq-nr8SRDJ-Mwejmwi9J%3DjsgKqZHfe0o8aWqgWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Image upload problem with UserProfile and my form

2014-08-01 Thread Pepsodent Cola
Hi,
I have problems displaying my avatar image which I have uploaded from my 
forms page.  The browser source code seem to say that it cannot find the 
correct path to my uploaded image file.  Which file or files do I need to 
fix?

Profilehttp://127.0.0.1:8000/accounts/profile/>" method="post" 
enctype="multipart/form-data">Likes cheese: Favourite hamster name: Avatar: 
Currently: http://127.0.0.1:8000/accounts/profile/1406895413_91_tumblr_m5xo9h5X3E1qgfdhto1_500.gif>">1406895413_91_tumblr_m5xo9h5X3E1qgfdhto1_500.gif
  ClearChange: **




models.py

from django.db import models
from django.contrib.auth.models import User
from time import time
#___

def get_upload_file_name(instance, filename):
return "%s_%s" % (str(time()).replace('.','_'), filename)

#___

class UserProfile(models.Model):
user = models.OneToOneField(User)
nickname = models.CharField(max_length=50)
likes_cheese = models.BooleanField(default=False)
favourite_hamster_name = models.CharField(max_length=50)
*avatar* = models.ImageField(upload_to=get_upload_file_name, 
blank=True, null=True)

def __unicode__(self):
return self.nickname


User.profile = property(lambda u: 
UserProfile.objects.get_or_create(user=u)[0])
#___



views.py

from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.core.context_processors import csrf
from forms import UserProfileForm
from django.contrib.auth.decorators import login_required
#___

@login_required
def user_profile(request):
if request.method == 'POST':
form = UserProfileForm(request.POST, *request.FILES*, 
instance=request.user.profile)
if form.is_valid():
form.save()
return HttpResponseRedirect('/accounts/loggedin')
else:
user = request.user
profile = user.profile
form = UserProfileForm(instance=profile)

args = {}
args.update(csrf(request))

args['form'] = form

return render_to_response('userprofile/profile.html', args)
#___



forms.py

from django import forms
from models import UserProfile
#___

class UserProfileForm(forms.ModelForm):

class Meta:
model = UserProfile
fields = ('likes_cheese', 'favourite_hamster_name', 'avatar')
#___



profile.html

{% extends "base_main.html" %}

{% block content %}
Profile

{% for field in form %}
{{ field.error }}
{% endfor %}


{% csrf_token %}
{{ form.as_p }}

{% if form.avatar %}
**
{% endif %}

{% comment %}

{% endcomment %}



{% endblock %}



settings.py

MEDIA_ROOT = 
'/Desktop/Django/project1/userprofile/static/userprofile/uploaded_files/'
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)



There are 2 static folders in my project1 are there any conflicting issues 
with my setup?

/Desktop/Django/project1/polls/static/polls/
/Desktop/Django/project1/userprofile/static/userprofile/uploaded_files/









-- 
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/956d71c5-63c5-481c-9388-dfecad14b516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BigInt / Long for Auto Incrementing PK

2014-08-01 Thread Stefano Probst
Hi, you can use a bigintegerfield 
 
and set it as primary-key 
.

Am Donnerstag, 31. Juli 2014 17:34:17 UTC+2 schrieb 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/165fba9c-a459-43ae-b5e3-876bfc5d7c39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: hanging django/postgres idle connections

2014-08-01 Thread Jani Kajala
Haven't tried (yet), I'm new to Python & Django & Postgres, got on board 
with Python 3.4.1 and Django 1.7c1. I'm starting to suspect this isn't 
really Django related directly, since I can consistently reproduce the 
problem following way: 1) Run e.g. test case, break it in debugger 2) Stop 
debug session. Django cannot really do anything about me interrupting the 
debugging session, but it should not block access to DB indefinitely. 
However, it does. I tried also to install pgbouncer, but it made 
interestingly situation worse, now even a single connection can block 
access to DB even if I have pgbouncer max_connections set to 100. So maybe 
this is something Windows/VirtualBox networking related.

On Thursday, July 31, 2014 10:58:41 PM UTC+7, Collin Anderson wrote:
>
> 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/56d78f9a-cd64-4353-ba34-12b4528fb2a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Having LiveServerTestCase use same database as tests

2014-08-01 Thread Chris Wilson
Hi Phil,

On Sunday, October 21, 2012 5:37:45 PM UTC+1, Phil Gyford wrote:
>
> No, I'm afraid not. I didn't get any replies (nor to a StackOverflow 
> question http://stackoverflow.com/q/12041315/250962 ) and haven't gone 
> back to try again. I'd tried everything I could think of already. Good 
> luck, and let us know if you get anywhere! 
>

Sorry for replying to an old message. Since this problem keeps coming up, I 
wanted to ensure that the answer is in the django-users archives.

I posted what I hope is a complete analysis of the problem and possible 
solutions on your StackOverflow question:
http://stackoverflow.com/a/25081791/648162.

Cheers, 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/4264a0c1-3376-433f-8ef7-0a639517b3cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image upload problem with UserProfile and my form

2014-08-01 Thread Collin Anderson
This looks wrong to me:
 

> 
>
>
so maybe, rearranging your code a bit:
{% if form.avatar %}

{% endif %}

{{ form.avatar }}


 

-- 
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/0a9a9ac1-2f10-420c-aaf0-d3e7b22308ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BigInt / Long for Auto Incrementing PK

2014-08-01 Thread Collin Anderson

>
> Hi, you can use a bigintegerfield 
>  
> and set it as primary-key 
> .
>

But will it auto-increment when you save? 

-- 
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/14aeead1-50f3-4da8-ad6e-6e45350476be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trouble accessing message_dict of ValidationError

2014-08-01 Thread Rosemary McCloskey
Hi,

I'm writing a view to create a model, and am trying to capture any 
ValidationErrors and display them to the user. I have code that looks like 
this:

  # exceptions is a dict of errors already encountered
  try:
# create model
  except ValidationError as e:
for key, msg in e.message_dict.items(): 
   
  exceptions.update({key: str(msg[0])}) 

I'm getting the following error:

  Traceback (most recent call last):
File 
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 
114, in get_response
  response = wrapped_callback(request, *callback_args, 
**callback_kwargs)
File "/home/rmcclosk/Documents/Shipyard/shipyard/method/views.py", line 
529, in method_revise
  for key, msg in e.message_dict.items():
File 
"/usr/local/lib/python2.7/dist-packages/django/core/exceptions.py", line 
96, in message_dict
  for field, messages in self.error_dict.items():
  AttributeError: 'ValidationError' object has no attribute 'error_dict'

This looks like a Django bug to me, but I googled around and couldn't find 
anything similar. The same error also happens if I just try to 
print(e.message_dict) instead of iterating through it, it seems like just 
accessing message_dict is causing the problem. Any ideas about what could 
be wrong?

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/c1cfd882-6241-4ce7-9c74-c2dd6c05b915%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: building a xenserver web client

2014-08-01 Thread Cal Leeming [Simplicity Media Ltd]
Hi Marc,

Although somewhat off-topic for this list, I would say there's several
people out there that aren't at all happy with OpenStack (myself included).

However the requirements for creating an interface for virtualization
management can very quickly become overwhelming, as there are so many areas
this could expand into.

OpenStack has contributions from a lot of people, and backing from some big
names, so you'd be hard pushed to create an interface that covers all use
cases.

Bare in mind that some aspects of such a platform, such as the REST API, if
done properly, are difficult to achieve with stock Django.

The best way to get like minded contributors is to start work on something
yourself, and attract people along the way. Create a prototype or an alpha,
learn from the mistakes, and use the experience to not only become a better
programmer, but to determine what the goals of your project would be. If
you're not busy this weekend, have yourself your very own hackathon :)

Also decide early on what your personal goal is... if you want to ship a
product, then focus on getting it done by any and every means necessary,
potentially compromising quality for speed. If you want to improve your own
skills, then focus on learning and take as long as you need to get the job
done right.

As a startup kid, that's my two cents.

Cal


On Fri, Aug 1, 2014 at 7:16 AM,  wrote:

> 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.
>

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


Re: Changing website version written in python+django

2014-08-01 Thread CLIFFORD ILKAY
On 08/01/2014 01:06 AM, 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.

Hi Zoli,

I'm assuming that you're not using virtualenv right now. The best way to
do this is to use virtualenv, virtualenwrapper, and a revision control
system like Mercurial. The workflow goes something like this.

mkvirtualenv new_site
# pip install (all the bits that make up your site with the versions
that you want)
# hg clone (/path/to/old_site)
# run automated tests
# cd (to wherever manage.py is)
python manage.py runserver

That will enable you to test the upgraded site without any risk of
breaking the currently working site. Once you're satisfied that it's
working as you expect, you can "pip freeze > requirements.txt" and use
that as the basis of seeding an installation on the production server.
Again, use virtualenv on the server so that you can isolate the
environment for your site from the system-wide site-packages.

We have a site we built using Mezzanine 3.0.9. It pulled in Django 1.6.2
as a dependency when we did "pip install Mezzanine". In a test
virtualenv, we duplicated the production virtualenv so we had Mezzanine
3.0.9 and all its dependencies. We then ran "pip install --upgrade
Mezzanine" and that pulled in Mezzanine 3.1.9 with Django 1.6.5.
Immediately, we noticed there was some breakage on the site we built. We
downgraded to Mezzanine 3.0.9 in the test environment while leaving
Django 1.6.5 alone and that breakage disappeared so it's clear that it's
not Django but Mezzanine at the source of the breakage.

We upgraded Django to 1.6.5 in the production environment while leaving
Mezzanine at 3.0.9 and we'll have to deal with the breakage of our site
with Mezzanine 3.1.9 in the test environment before we can upgrade
Mezzanine in production, too. If we weren't using virtualenv, that would
have been an ordeal.

-- 
Regards,

Clifford Ilkay

647-778-8696

Dinamis



-- 
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/53DBBF1B.5020108%40dinamis.com.
For more options, visit https://groups.google.com/d/optout.


Djamin, a new and clean styles for Django admin.

2014-08-01 Thread Herson
Hey guys, in the last days, i push my new project called Djamin[0], a new
and clean styles for django admin.

I hope you like and i sent in django dev tool for a proposal to change.

Forken, commit and send suggestions, all are welcome.

[0] https://github.com/hersonls/djamin

-- 
Herson Leite, Software Developer
www.hersonls.com.br

-- 
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%2BdbW11d2ZYeqHVYDjA1c-0Xx31nThgNjWAt%3Du9FVsuxOWTFqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


unsupported opperand type(s)

2014-08-01 Thread Mariusz Wilk
Hi guys.

I'm just going through the official tutorial for Django: "Writing your first 
Django app, part 1"

At the bottom of the page it says:
 # Make sure our custom method worked.
 >>> p = Poll.objects.get(pk=1)
 >>> p.was_published_recently()
 True

So far everything went well but now cmd returns:
 TypeError: unsupported operand type(s) for -: 'function' and   
 'datetime.timedelta'



WHAT CAN I DO TO FIX IT??
So far my cone in \polls\models.py:



from django.db import models
import datetime
from django.utils import timezone

class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

def __unicode__(self):
return self.question

def was_published_recently(self):
return self.pub_date >= timezone.now - datetime.timedelta(days=1)

class Choice(models.Model):
poll= models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()

def __unicode__(self):
return self.choice

-- 
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/4fce47e6-0b29-4bb8-9c33-fd041fa9c960%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: unsupported opperand type(s)

2014-08-01 Thread Collin Anderson

>
> def was_published_recently(self):
> return self.pub_date >= timezone.now - datetime.timedelta(days=1)
>
timezone.now() 

-- 
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/78625e2b-18aa-4915-8e83-e08a16fc9f73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BigInt / Long for Auto Incrementing PK

2014-08-01 Thread Nicholas Haggmark
Hi guys,

I was aware that you could set the BigInt model type to PK, but there 
doesn't appear to be a good way to make it auto-increment. Also, will FK 
columns introspect it to a long correctly?

On Friday, August 1, 2014 11:21:14 AM UTC-4, Collin Anderson wrote:
>
> Hi, you can use a bigintegerfield 
>>  
>> and set it as primary-key 
>> .
>>
>
> But will it auto-increment when you save? 
>

-- 
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/e17d478b-974d-45be-8476-8a06b57c2abe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-08-01 Thread Russell Keith-Magee
As others have pointed out, the reason putting it in settings.py causes it
to be run twice is because settings is loaded twice when you use runserver.
That won't happen in production, however, as the mod_wsgi binding doesn't
require the "other" process when it's deployed through the wsgi interface.

I would **STRONGLY** recommend against the hacks suggested in this thread
that involve building singleton objects, file-based locks, or other
mechanisms that work around the fact that settings.py is invoked twice.

If you're using Django 1.6, the best option is to put the code in your top
level urls.py. This is what admin does to discover all the apps in a Django
system. It's not an ideal solution, but it works, and will only be executed
once, and as close to "startup" as is practical.

If you're using a pre-release of Django 1.7, the new AppConfig class
definitions are designed to provide the exact sort of 'startup
configuration' you've asked about.

https://docs.djangoproject.com/en/1.7/ref/applications/

Yours,
Russ Magee %-)



On Thu, Jul 31, 2014 at 3: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.
>
> 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
> 
> .
> 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/CAJxq84-bu-OPNtsfF_En-RxHc-5-opzNH9YUe-DMuTfMykJR9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unsupported opperand type(s)

2014-08-01 Thread Mariusz Wilk
thanks, that helped

I also got confused and created too many objects, so now instead of  p.id 
 "1" cdm returns  "3". How do I delete objects from p?

>>> from django.utils import timezone>>> p = Poll(question="What's new?", 
>>> pub_date=timezone.now())
# Save the object into the database. You have to call save() explicitly.>>> 
p.save()
# Now it has an ID. Note that this might say "1L" instead of "1", depending# on 
which database you're using. That's no biggie; it just means your# database 
backend prefers to return integers as Python long integer# objects.>>> p.id*1   
<- I HAVE 3 *

-- 
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/c7c3b295-9169-4317-81bb-bb0ce2ea8e7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djamin, a new and clean styles for Django admin.

2014-08-01 Thread Ryan Blunden
This looks pretty clean. I’ll give it a try on a new Django app I’m developing. 
  

Have you tested it on Django 1.7?  


On Friday, August 1, 2014 at 11:13 AM, Herson wrote:

> Hey guys, in the last days, i push my new project called Djamin[0], a new and 
> clean styles for django admin.
>  
> I hope you like and i sent in django dev tool for a proposal to change.  
>  
> Forken, commit and send suggestions, all are welcome.
>  
> [0] https://github.com/hersonls/djamin
>  
> --  
> Herson Leite, Software Developer
> www.hersonls.com.br (http://www.hersonls.com.br)
> --  
> 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 
> (mailto:django-users+unsubscr...@googlegroups.com).
> To post to this group, send email to django-users@googlegroups.com 
> (mailto: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%2BdbW11d2ZYeqHVYDjA1c-0Xx31nThgNjWAt%3Du9FVsuxOWTFqw%40mail.gmail.com
>  
> (https://groups.google.com/d/msgid/django-users/CA%2BdbW11d2ZYeqHVYDjA1c-0Xx31nThgNjWAt%3Du9FVsuxOWTFqw%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/EE78BEAF6E5E43CD9D66FB81CBBC2C0C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unsupported opperand type(s)

2014-08-01 Thread Collin Anderson
p.id == 3 is just fine. It's auto-incrementing, and even if you delete 
items, an object will never get p.id == 1 again.

If you really want a Poll with id=1, either clear out your database, or 
create it manually like so:
p = Poll(id=1, question="What's new?", pub_date=timezone.now())
p.save()

-- 
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/20d01d45-3516-4a87-9bbd-15505b3d2f56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Community blog posts

2014-08-01 Thread Lee
Am I the only one who gets irritated by the periodic mass re-posting of strings 
of old blog articles to the community feed on djangoproject? I want to see 
fresh stuff I've not seen before, not the same rubbish I ignored the first 
three times it was posted. Seems like a pretty cheap shot to keep driving 
traffic to your sites to me...

-- 
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/6194e2b3-281c-4e6d-ab04-9e9e785b6c48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Going throught the Django tutorial help pls

2014-08-01 Thread Michael Carey
I have:

Enter code here...from django.shortcuts import render
from django.template import RequestContext, loader
from django.http import HttpResponse

from polls.models import Poll

def index(request):
latest_poll_list = Poll.objects.get(name="Test") 
#Poll.objects.all().order_by('-pub_date')[:5] 
   context = {'latest_poll_list': latest_poll_list}
return render(request, 'polls/index.html', context)

def detail(request, poll_id):
try:
poll = Poll.objects.get(pk=poll_id)
except Poll.DoesNotExist:
raise Http404
return render(request, 'polls/detail.html', {'poll': poll})

def results(request, poll_id):
return HttpResponse("You're looking at the results of poll %s." % 
poll_id)

def vote(request, poll_id):
return HttpResponse("You're voting on poll %s." % poll_id)

It currently shows a list of the polls, what I am trying to work out is how 
to print out the integer value that is associated with that pole.

latest_poll_list = Poll.objects.get(name="Test")


Thankyou

MC

-- 
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/172c763e-fc5c-42d5-8429-eb0643fdcdab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Going throught the Django tutorial help pls

2014-08-01 Thread Collin Anderson

>
> It currently shows a list of the polls, what I am trying to work out is 
> how to print out the integer value that is associated with that pole.


Is poll.id what you want? In the template it would be {{ poll.id }}

Or: Poll.objects.get(name="Test").id

-- 
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/ecbbd9b2-1067-492f-b61b-26bfa8e91e21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get latest timestamp+value from each group

2014-08-01 Thread Collin Anderson
I'm not an ORM/SQL pro myself, so if I were doing this, I would just 
cache/denoralize the last value onto the device whenever there's a new log.

-- 
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/2eb0e828-67a7-44aa-bfd2-1ba69fa3111f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Going throught the Django tutorial help pls

2014-08-01 Thread Michael Carey


On Saturday, 2 August 2014 12:55:25 UTC+10, Collin Anderson wrote:
>
> It currently shows a list of the polls, what I am trying to work out is 
>> how to print out the integer value that is associated with that pole.
>
>
> Is poll.id what you want? In the template it would be {{ poll.id }}
>
> Or: Poll.objects.get(name="Test").id
>

So I tried:

def index(request):
latest_poll_list = Poll.objects.get(name="Test").id 
#Poll.objects.all().order_by('-pub_date')[:5] 
  
context = {'latest_poll_list': latest_poll_list}
return render(request, 'polls/index.html', context)

 and get a error, sorry I am really new to both python and SQLite

I do have a poll "Test" 

Thank you

Mick C

-- 
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/850a42a7-eebd-44f1-a2bf-e1bcabc0c952%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.