Re: add custom action button on each admin row

2013-10-17 Thread Kelvin Wong
Take a look at Admin Actions. It should be able to do what you are thinking.

You can also make a Admin-only view and tie it into the admin.

K


On Thursday, October 17, 2013 1:12:59 PM UTC-7, Laurent GARTNER wrote:
>
> Hi,
>
> Is there a simple way to add custom action button (maybe links, 
> buttons...) on each row in admin site ?
>
> 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/5ee4b397-3661-41a4-a512-8d12a6872e42%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Loading data from Django into RedShift - ORM vs SQL?

2013-10-17 Thread Arnold Krille
Am Thu, 17 Oct 2013 13:32:44 +0300
schrieb Avraham Serour :
> The whole idea of having an ORM is not having ot deal with SQL
> directly unless necessary. I would try to do it using the ORM first
> but there's not general rule, each case should be analised
> individually

Actually you shouldn't decide each case individually but use the ORM by
default! The ORM is tested for a lot of cases whereas your SQL is only
working in your own case. And there are a lot of problems you might
think are better to solve in raw SQL, but actually after thinking
about it using the ORM will give you simpler code, simpler algorithms,
more optimization and less runtime... At least its our experience that
on 2/3 of the places where we 'needed' to do raw SQL replacing that by
using the ORM actually improved everything.

Have fun,

Arnold

-- 
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/20131017231237.65b6b31f%40orinoco.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to handle values_list?

2013-10-17 Thread Charly Román
Have you tried used get instead filter?

2013/10/17 Daniel Roseman :
> On Thursday, 17 October 2013 19:30:09 UTC+1, Andrew Michael wrote:
>>
>> Hi,
>>
>> I am new to Django and need some help. My issue is on my web page the data
>> is showing up like this: [u'Green'] and I want it to only show Green -
>> without the unicode wrapping. Can you please explain why this is happening
>> and how do I fix it?
>>
>> Here is my code.
>>
>> models.py:
>>
>> Class Name(models.Model):
>>
>> name = models.CharField(_('name'), max_length=100)
>>
>> number = models.ForeignKey(Number)
>>
>> views.py:
>>
>> def enter_name(request):
>>
>> my_number = request.user.number
>>
>> name = Name.objects.filter(pk=my_number).values_list('city',
>> flat=True)
>>
>> template.html:
>>
>> {{ name|safe }}
>>
>>
>>
>> Prints on the web page:
>>
>> [u’Green’]
>
>
> This nothing to do with Unicode. `name` is a *list*. So you have to iterate
> over it:
>
> {% for name in names %}
> {{ name }}
> {% endfor %}
> --
> 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/f1d664fc-4a67-4d1f-8df5-76fda1bbef20%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CABeWMUbaxazs1Sh0GMLhJVSXGcieUsTBhz2AgbWrhWD%2BBwru%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2013-10-17 Thread michael . schaefer
Oh my gosh ... I did. LOL. Thanks. I'm an idiot.

-- 
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/22d6b827-a23b-44df-b73c-9abd7e21f7fb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to handle values_list?

2013-10-17 Thread Daniel Roseman
On Thursday, 17 October 2013 19:30:09 UTC+1, Andrew Michael wrote:

> Hi, 
>
> I am new to Django and need some help. My issue is on my web page the data 
> is showing up like this: [u'Green'] and I want it to only show Green - 
> without the unicode wrapping. Can you please explain why this is happening 
> and how do I fix it? 
>
> Here is my code. 
>
> *models.py:*
>
> Class Name(models.Model):
>
> name = models.CharField(_('name'), max_length=100)
>
> number = models.ForeignKey(Number)
>
> *views.py:*
>
> def enter_name(request):
>
> my_number = request.user.number
>
> name = Name.objects.filter(pk=my_number).values_list('city', flat=True)
>
> template.html:
>
> {{ name|safe }}
>
>  
>
> Prints on the web page:
>
> [u’Green’]
>

This nothing to do with Unicode. `name` is a *list*. So you have to iterate 
over it:

{% for name in names %}
{{ name }}
{% endfor %}
--
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/f1d664fc-4a67-4d1f-8df5-76fda1bbef20%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2013-10-17 Thread Daniel Roseman
On Thursday, 17 October 2013 21:05:17 UTC+1, michael@farecompare.com 
wrote:

> Hi, 
>
> I'm trying to learn Django and Python at the same time. So I realize this 
> is a really simple issue for a beginner. But since I'm new to this, I could 
> use a little help. 
>
> Basically, I'm going through the tutorial here: 
>
> https://docs.djangoproject.com/en/1.5/intro/tutorial01/
>
> I have gone through it up to the point where we create the polls app with 
> the command: 
>
> python manage.py startapp polls
>
>
> I then created the models in polls/models.py by cutting and pasting from 
> the article. 
>
> Finally, to activate the new model, I went back to my settings.py file and 
> added "polls" to my list of installed apps. However, when I run the 
> command: 
>
> python manage.py sql polls
>
>
> I get the following error: 
>
> Michael$ python manage.py sql polls
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 453, in execute_from_command_line
> utility.execute()
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 263, in fetch_command
> app_name = get_commands()[subcommand]
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
>  
> line 109, in get_commands
> apps = settings.INSTALLED_APPS
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
>  
> line 53, in __getattr__
> self._setup(name)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
>  
> line 48, in _setup
> self._wrapped = Settings(settings_module)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
>  
> line 132, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
>   File 
> "/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
>  
> line 35, in import_module
> __import__(name)
>   File 
> "/Users/Michael/dev/projects/python/ape_admin/ape_admin/settings.py", line 
> 127, in 
> polls,
> NameError: name 'polls' is not defined
>
> I have a folder called "polls" that is in the same directory as my 
> manage.py file. Can someone tell me what I'm doing wrong? Is there a step 
> I'm missing that's not in the tutorial that a Python developer would just 
> know automatically? 
>
> Thanks,
>
> Michael
>
>
Sounds like you've put a line with just
   polls
in your INSTALLED_APPS, instead of
   "polls"
--
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/5c2d606c-5491-4af2-b1bb-09711c04348e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to handle values_list?

2013-10-17 Thread Andrew Michael
Unfortunately, that did not work. When I put that in the template I get 
nothing for name, not even [u'Green']. 

Any other thoughts?

On Thursday, October 17, 2013 4:19:57 PM UTC-4, ke1g wrote:
>
> Try:
>
> {{ name.0.name }}
>
>
> On Thu, Oct 17, 2013 at 2:30 PM, Andrew Michael 
>  > wrote:
>
>> Hi, 
>>
>> I am new to Django and need some help. My issue is on my web page the 
>> data is showing up like this: [u'Green'] and I want it to only show Green - 
>> without the unicode wrapping. Can you please explain why this is happening 
>> and how do I fix it? 
>>
>> Here is my code. 
>>
>> *models.py:*
>>
>> Class Name(models.Model):
>>
>> name = models.CharField(_('name'), max_length=100)
>>
>> number = models.ForeignKey(Number)
>>
>> *views.py:*
>>
>> def enter_name(request):
>>
>> my_number = request.user.number
>>
>> name = Name.objects.filter(pk=my_number).values_list('city', 
>> flat=True)
>>
>> template.html:
>>
>> {{ name|safe }}
>>
>> ** **
>>
>> Prints on the web page:
>>
>> [u’Green’]
>>  
>> -- 
>> 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/8287f841-2442-4f57-b46a-ca071fe839a8%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/3e14c918-f52a-498d-bdc8-28c1ab9934db%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to handle values_list?

2013-10-17 Thread Bill Freeman
Try:

{{ name.0.name }}


On Thu, Oct 17, 2013 at 2:30 PM, Andrew Michael  wrote:

> Hi,
>
> I am new to Django and need some help. My issue is on my web page the data
> is showing up like this: [u'Green'] and I want it to only show Green -
> without the unicode wrapping. Can you please explain why this is happening
> and how do I fix it?
>
> Here is my code.
>
> *models.py:*
>
> Class Name(models.Model):
>
> name = models.CharField(_('name'), max_length=100)
>
> number = models.ForeignKey(Number)
>
> *views.py:*
>
> def enter_name(request):
>
> my_number = request.user.number
>
> name = Name.objects.filter(pk=my_number).values_list('city', flat=True)
> 
>
> template.html:
>
> {{ name|safe }}
>
> ** **
>
> Prints on the web page:
>
> [u’Green’]
>
> --
> 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/8287f841-2442-4f57-b46a-ca071fe839a8%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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%2BAj0uSH9Cm4LQxdo-U-6_bVGcpKrsmMdRGuYA%2B8RvLPS9%3Dag%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


add custom action button on each admin row

2013-10-17 Thread Laurent GARTNER
Hi,

Is there a simple way to add custom action button (maybe links, buttons...) 
on each row in admin site ?

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/b36aeb18-c04a-4bef-9a06-5764d53a6bfd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can not connect to MySQL

2013-10-17 Thread Larry Martell
On Thu, Oct 17, 2013 at 1:47 PM,  wrote:

> Hi, I am new to Django and try to connect to database MySQL I get this
> message: Can anyone help? thanks in advance.
>
> Unhandled exception in thread started by  of  at 0x3026810>>
> Traceback (most recent call last):
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/commands/runserver.py",
> line 92, in inner_run
> self.validate(display_num_errors=True)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/base.py",
> line 280, in validate
> num_errors = get_validation_errors(s, app)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/validation.py",
> line 28, in get_validation_errors
> from django.db import models, connection
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
> line 40, in 
> backend = load_backend(connection.settings_dict['ENGINE'])
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
> line 34, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
> line 93, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
> line 27, in load_backend
> return import_module('.base', backend_name)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/backends/mysql/base.py",
> line 17, in 
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
> No module named MySQLdb
>
>
>
Did you install MySQLdb?

-- 
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/CACwCsY5ZQpF9Zby-dA4Z4a5EL9sDSefEqGyS0%3DSLqG41JPFL3g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can not connect to MySQL

2013-10-17 Thread Charly Román
Install mysql module:

sudo pip install mysql-python


2013/10/17  :
> Hi, I am new to Django and try to connect to database MySQL I get this
> message: Can anyone help? thanks in advance.
>
> Unhandled exception in thread started by   0x3026810>>
> Traceback (most recent call last):
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/commands/runserver.py",
> line 92, in inner_run
> self.validate(display_num_errors=True)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/base.py",
> line 280, in validate
> num_errors = get_validation_errors(s, app)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/validation.py",
> line 28, in get_validation_errors
> from django.db import models, connection
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
> line 40, in 
> backend = load_backend(connection.settings_dict['ENGINE'])
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
> line 34, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
> line 93, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
> line 27, in load_backend
> return import_module('.base', backend_name)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/backends/mysql/base.py",
> line 17, in 
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
> No module named MySQLdb
>
>
> --
> 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/86dad6e4-ba16-489c-9fa8-d1722c089d11%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CABeWMUbYzuD2gmprGcF7MWoZgoO0e1z6CnrwCgUoW80mQe4w%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can not connect to MySQL

2013-10-17 Thread Thomas Orozco
Most likely it's the MySQLdb package (
https://pypi.python.org/pypi/MySQL-python) that's not installed.

Installing it *will* require installing libmysql-client first, though.


On Thu, Oct 17, 2013 at 10:05 PM, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> Could be a number of things:
>
> - mysql may not be installed.
>
> - mysql is installed but in a non-standard location.
>
> - mysql is the wrong version.
>
> You can start tracking down these issues by running mysql_config
>
> François
>
> On Oct 17, 2013, at 3:47 PM, timdang2...@yahoo.com wrote:
>
> > Hi, I am new to Django and try to connect to database MySQL I get this
> message: Can anyone help? thanks in advance.
> >
> > Unhandled exception in thread started by  of  at 0x3026810>>
> > Traceback (most recent call last):
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/commands/runserver.py",
> line 92, in inner_run
> > self.validate(display_num_errors=True)
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/base.py",
> line 280, in validate
> > num_errors = get_validation_errors(s, app)
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/validation.py",
> line 28, in get_validation_errors
> > from django.db import models, connection
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
> line 40, in 
> > backend = load_backend(connection.settings_dict['ENGINE'])
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
> line 34, in __getattr__
> > return getattr(connections[DEFAULT_DB_ALIAS], item)
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
> line 93, in __getitem__
> > backend = load_backend(db['ENGINE'])
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
> line 27, in load_backend
> > return import_module('.base', backend_name)
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
> line 35, in import_module
> > __import__(name)
> >   File
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/backends/mysql/base.py",
> line 17, in 
> > raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: No module named MySQLdb
> >
> >
> >
> > --
> > 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/86dad6e4-ba16-489c-9fa8-d1722c089d11%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> 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/5BB2B165-8731-48CB-BC75-D36551EA1C7C%40gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAMuNovRmGjYi2LV%2BVzjiFt2qax05KtGcSy5NNVm8zxUGQjc7aw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Trouble With Tutorial #1 - NameError: name 'polls' is not defined

2013-10-17 Thread michael . schaefer
Hi, 

I'm trying to learn Django and Python at the same time. So I realize this 
is a really simple issue for a beginner. But since I'm new to this, I could 
use a little help. 

Basically, I'm going through the tutorial here: 

https://docs.djangoproject.com/en/1.5/intro/tutorial01/

I have gone through it up to the point where we create the polls app with 
the command: 

python manage.py startapp polls


I then created the models in polls/models.py by cutting and pasting from 
the article. 

Finally, to activate the new model, I went back to my settings.py file and 
added "polls" to my list of installed apps. However, when I run the 
command: 

python manage.py sql polls


I get the following error: 

Michael$ python manage.py sql polls
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
 
line 453, in execute_from_command_line
utility.execute()
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
 
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
 
line 263, in fetch_command
app_name = get_commands()[subcommand]
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py",
 
line 109, in get_commands
apps = settings.INSTALLED_APPS
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
 
line 53, in __getattr__
self._setup(name)
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
 
line 48, in _setup
self._wrapped = Settings(settings_module)
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py",
 
line 132, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
  File 
"/Library/Python/2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
 
line 35, in import_module
__import__(name)
  File 
"/Users/Michael/dev/projects/python/ape_admin/ape_admin/settings.py", line 
127, in 
polls,
NameError: name 'polls' is not defined

I have a folder called "polls" that is in the same directory as my 
manage.py file. Can someone tell me what I'm doing wrong? Is there a step 
I'm missing that's not in the tutorial that a Python developer would just 
know automatically? 

Thanks,

Michael

-- 
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/7d2fefe7-e2e6-489e-81dc-01b5cdba9ecc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can not connect to MySQL

2013-10-17 Thread François Schiettecatte
Could be a number of things:

- mysql may not be installed.

- mysql is installed but in a non-standard location.

- mysql is the wrong version.

You can start tracking down these issues by running mysql_config

François

On Oct 17, 2013, at 3:47 PM, timdang2...@yahoo.com wrote:

> Hi, I am new to Django and try to connect to database MySQL I get this 
> message: Can anyone help? thanks in advance.
> 
> Unhandled exception in thread started by   0x3026810>>
> Traceback (most recent call last):
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/commands/runserver.py",
>  line 92, in inner_run
> self.validate(display_num_errors=True)
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/base.py",
>  line 280, in validate
> num_errors = get_validation_errors(s, app)
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/validation.py",
>  line 28, in get_validation_errors
> from django.db import models, connection
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
>  line 40, in 
> backend = load_backend(connection.settings_dict['ENGINE'])
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
>  line 34, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
>  line 93, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
>  line 27, in load_backend
> return import_module('.base', backend_name)
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
>  line 35, in import_module
> __import__(name)
>   File 
> "/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/backends/mysql/base.py",
>  line 17, in 
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No 
> module named MySQLdb
> 
> 
> 
> -- 
> 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/86dad6e4-ba16-489c-9fa8-d1722c089d11%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/5BB2B165-8731-48CB-BC75-D36551EA1C7C%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Can not connect to MySQL

2013-10-17 Thread timdang2000
Hi, I am new to Django and try to connect to database MySQL I get this 
message: Can anyone help? thanks in advance.

Unhandled exception in thread started by >
Traceback (most recent call last):
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/commands/runserver.py",
 
line 92, in inner_run
self.validate(display_num_errors=True)
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/base.py",
 
line 280, in validate
num_errors = get_validation_errors(s, app)
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/core/management/validation.py",
 
line 28, in get_validation_errors
from django.db import models, connection
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
 
line 40, in 
backend = load_backend(connection.settings_dict['ENGINE'])
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/__init__.py",
 
line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
 
line 93, in __getitem__
backend = load_backend(db['ENGINE'])
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/utils.py",
 
line 27, in load_backend
return import_module('.base', backend_name)
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/utils/importlib.py",
 
line 35, in import_module
__import__(name)
  File 
"/home/tee/django-tee/local/lib/python2.7/site-packages/Django-1.5.4-py2.7.egg/django/db/backends/mysql/base.py",
 
line 17, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: 
No module named MySQLdb


-- 
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/86dad6e4-ba16-489c-9fa8-d1722c089d11%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Announce] Expected djangoproject.com downtime tomorrow, Oct 18, starting 20:00 UTC

2013-10-17 Thread Jacob Kaplan-Moss
Hi folks -

We'll be doing some work on djangoproject.com (and associated sub-sites)
tomorrow, starting around 20:00 UTC. Expect some downtime, possibly as long
as an hour or so, starting around then.

During the downtime, as usual, you can find a mirror of Django's
documentation on Read the Docs: http://django.readthedocs.org/en/latest/.

Thanks!

Jacob

-- 
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/CAK8PqJGpj3Jv%2BP0Zqj6u0Q4RuhfYJYniNKk%3DWxjV5mimx0Wn4A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


How to handle values_list?

2013-10-17 Thread Andrew Michael
Hi, 

I am new to Django and need some help. My issue is on my web page the data 
is showing up like this: [u'Green'] and I want it to only show Green - 
without the unicode wrapping. Can you please explain why this is happening 
and how do I fix it? 

Here is my code. 

*models.py:*

Class Name(models.Model):

name = models.CharField(_('name'), max_length=100)

number = models.ForeignKey(Number)

*views.py:*

def enter_name(request):

my_number = request.user.number

name = Name.objects.filter(pk=my_number).values_list('city', flat=True)

template.html:

{{ name|safe }}

 

Prints on the web page:

[u’Green’]

-- 
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/8287f841-2442-4f57-b46a-ca071fe839a8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Accessing related objects on model.clean()

2013-10-17 Thread Marc Aymerich
On Wed, Oct 16, 2013 at 11:52 PM, Marc Aymerich  wrote:
> Yep,
> I'm writing some validation logic for a model that is being used in an
> admin inline form
>
> The model looks like this
>
> class Child(models.Model):
>  parent = models.ForeignKey(Parent)
>
>  def clean(self):
>   super().clean()
>   if self.parent.surname != self.surname:
>   raise ValidationError
>
> The problem is that on the "Parent add admin view" I get a
> Parent.DoesNotExist error when I'm saving new Parent and Childs. That
> is because when child.clean() is called child.parent_id is None, so
> self.parent fails, it looks like self.parent is created afterwards and
> is not available at that time.

yep this was something related with my application ! it is indeed
possible to access related objects on model clean, sorry for the
noise!

-- 
Marc

-- 
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%2BDCN_ucGB4yM%3Dqr5NkBT8Dk1Wmd1zkzeXaFQ%3DofSpvnwJFWAw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Initial fixtures with the auth Module

2013-10-17 Thread Dennis Hellmich
Hi,

since the update to Django 1.5 a problem appears in my test when I try to 
load the initial data from a fixture into the database.
My guess is that this problem is connected to the mod_wsgi auth handler.

model: auth.Group
pk: 1
fields:
name:  Admins
permissions:   [
[ 'add_user', 'auth', 'user' ],
[ 'change_user', 'auth', 'user' ],
[ 'delete_user', 'auth', 'user' ],
 ]

When I try to run the tests (and load this fixture) I get the following 
error message:

ERROR: test_check_password_custom_user 
(django.contrib.auth.tests.handlers.ModWsgiHandlerTestCase)
--
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/test/testcases.py", 
line 268, in __call__
self._post_teardown()
  File "/usr/local/lib/python2.7/dist-packages/django/test/testcases.py", 
line 533, in _post_teardown
self._fixture_teardown()
  File "/usr/local/lib/python2.7/dist-packages/django/test/testcases.py", 
line 553, in _fixture_teardown
skip_validation=True, reset_sequences=False)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 161, in call_command
return klass.execute(*args, **defaults)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 255, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 385, in handle
return self.handle_noargs(**options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/flush.py",
 
line 89, in handle_noargs
call_command('loaddata', 'initial_data', **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 161, in call_command
return klass.execute(*args, **defaults)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 255, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py",
 
line 187, in handle
for obj in objects:
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/serializers/pyyaml.py", 
line 67, in Deserializer
raise DeserializationError(e)
DeserializationError: Problem installing fixture 
'/home/projects/fixtures/initial_data.yaml': Permission matching query does 
not exist.

This error does not occur if I don't assign any permissions to the group.
Does anyone have an idea how to solve this problem?

Thanks a lot in advance,
Dennis


P.S.
some addional information:
django.VERSION = (1, 5, 4, 'final', 0)
Python 2.7.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/88535993-5a86-43d4-b5b2-7bb8b1d67076%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


django-ckeditor image upload giving wrong url of the image

2013-10-17 Thread Robin Lery
When I try text editing and other text related stuffs and save it, the
editor does its job nicely. But when I try to upload an image it just take
a different url. I am on windows. Is it because of this, cause I saw a post
on this 
post,
but it didn't helped me either. It does get saved and they each have their
own thumbnails too. But its just that the wrong urls. I checked the src of
the image, and it was like this,



But it should have been like this,



And sometimes the src of the image is just like this,



This is the snippet of my settings.py:

CKEDITOR_UPLOAD_PATH = 'C:/Users/Nanyoo/web/demo/media'
MEDIA_ROOT = 'C:/Users/Nanyoo/web/demo/media'

I've included its url in my urls.py:

(r'^ckeditor/', include('ckeditor.urls')),

models.py:

from django.db import modelsfrom datetime import datetimefrom
django.contrib.auth.models import Userfrom time import time

def get_upload_file_name(instance, filename):
return "uploaded_files/%s_%s" %(str(time()).replace('.','_'), filename)
class Blog(models.Model):
title = models.CharField(max_length=200)
image = models.ImageField(upload_to=get_upload_file_name, blank=True)
pub_date = models.DateTimeField(default=datetime.now)
creator = models.ForeignKey(User, related_name="creator_set")
body = models.TextField()

In the forms.py:

from django import formsfrom django_summernote.widgets import
SummernoteWidgetfrom ckeditor.widgets import CKEditorWidget
class BlogForm(forms.Form):
title = forms.CharField(max_length=200,widget=SummernoteWidget())
body = forms.CharField(widget=CKEditorWidget())

In the index.html:

{% for blog in blogs %}

{{ blog.title | safe}}
{{ blog.body | safe}}

{% endfor %}

Please help me figure it out. Any help will be greatly appreciated!

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/CA%2B4-nGomdQf3%3DDbzArYUYeBdyjEhnVbDuc8KLmi%3DdwPsgBsROA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django Debug Toolbar supports Python 3 - beta testers wanted!

2013-10-17 Thread Aymeric Augustin
Hello,

I just upgraded the Django Debug Toolbar to support Django 1.5 and Python 
3. Since there hasn't been a release in a long time, and since support for 
Python 3 required rather extensive changes, I would really appreciate if 
you could try it before we make an official release on PyPI in a few days.

To install the development version, run:

$ pip uninstall django-debug-toolbar# in case it's already installed
$ pip install django-debug-toolbar==dev

Please report regressions and bugs to 
https://github.com/django-debug-toolbar/django-debug-toolbar/issues.

Thanks for your help!

-- 
Aymeric.

-- 
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/90deb1c6-3bca-45ec-90d2-6663a7a03829%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Preferred virtualenv layout for Django projects

2013-10-17 Thread Tom Evans
On Thu, Oct 17, 2013 at 4:26 PM, Tim Chase
 wrote:
> How do folks prefer to layout their Django projects when using
> virtualenv?  Do you do either of the following, or something else?
>
> Method 1: (project & apps at same level)
>
> ~/tmp$ virtualenv my_proj
> ~/tmp$ cd my_proj
> ~/tmp/my_proj$ . bin/activate
> (my_proj)~/tmp/my_proj$ pip install django # ...
> (my_proj)~/tmp/my_proj$ django-admin.py startproject my_project
> (my_proj)~/tmp/my_proj$ django-admin.py startapp my_app1
> (my_proj)~/tmp/my_proj$ # run/test from virtenv root
>
> Method 2: (apps within project)
>
> ~/tmp$ virtualenv my_proj
> ~/tmp$ cd my_proj
> ~/tmp/my_proj$ . bin/activate
> (my_proj)~/tmp/my_proj$ pip install django # ...
> (my_proj)~/tmp/my_proj$ django-admin.py startproject my_project
> (my_proj)~/tmp/my_proj$ cd my_project
> (my_proj)~/tmp/my_proj/my_project$ ./manage.py startapp my_app1
> (my_proj)~/tmp/my_proj/my_project$ # run/test from proj root
>
> Do you have to jockey the $PYTHONPATH to find apps in either case?
> If so, how do you make this portable/versioned (modify the
> virtualenv scripts and add them to $VCS? have a custom script and put
> that in $VCS?)
>
> Which bits do you include/exclude when using version-control?
>
> Do you keep your requirements.txt for pip at the top level virtualenv
> directory, or inside the project folder (or elsewhere)?
>
> I've seen a couple blog-posts that advocate "use virtualenv" but most
> seem to elide the best-practice details.
>
> Any tips appreciated.
>
> -tkc

This is the layout I prefer these days:

the_project_name
├── activate -> project_env/bin/activate
├── bootstrap
├── logs
│   ├── project.debug.log
│   └── project.log
├── project_env
│   ├── bin
│   ├── lib
│   └── src
├── requirements.txt
├── run
│   └── app.pid
└── the_project_name
├── app1
│   └── views.py
├── app2
│   └── views.py
├── app3
│   └── views.py
├── manage.py
└── project
├── default_settings.py
├── routers.py
├── settings.py.example
└── urls.py

The top level directory is named after the project, and contains the
project code, and placeholder folders for the environment, for log
files, for temporary 'run' files like pidfiles, the requirements.txt
for pip, a bootstrap script which creates the virtualenv and installs
necessary packages.

The project code directory is also named for the project (in fact,
it's name is entirely irrelevant, it is only used to specify the path
to manage.py). It has manage.py, the apps that are part of the project
(as opposed to standalone apps used in the project), and the project
directory.

The project directory contains the default_settings.py and
settings.py, routers.py (if needed) and the top level project urls.py.
In settings, we refer to 'app1', 'app2' and so on, not
'the_project_name.app1', the routers would be specified as
'project.routers.YourRouterName', and the ROOT_URLCONF as
'project.urls'.

Everything is checked in to version control, but with ignores to
exclude the venv, log and run folders etc. We deploy with cfengine,
which checks out the repo where it should, checks out the settings.py
from a separate configuration repository, runs bootstrap and starts
the service.

Since the only way to modify the running project is via checking
things in to a repository and requesting a re-deploy, this ensures
that running code is reproducible - a developer can easily recreate
the live environment in their dev site - and repeatable.

When we deploy updates, we first make one backend inactive in haproxy,
wait for existing requests on that server to be completed, and then
re-deploy, re-enabling it in haproxy afterwards. This ensures updates
never cause a client request to be terminated.

Hope that is useful.

Cheers

Tom

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


Re: Preferred virtualenv layout for Django projects

2013-10-17 Thread Some Developer

On 17/10/2013 16:26, Tim Chase wrote:

How do folks prefer to layout their Django projects when using
virtualenv?  Do you do either of the following, or something else?

Method 1: (project & apps at same level)

~/tmp$ virtualenv my_proj
~/tmp$ cd my_proj
~/tmp/my_proj$ . bin/activate
(my_proj)~/tmp/my_proj$ pip install django # ...
(my_proj)~/tmp/my_proj$ django-admin.py startproject my_project
(my_proj)~/tmp/my_proj$ django-admin.py startapp my_app1
(my_proj)~/tmp/my_proj$ # run/test from virtenv root

Method 2: (apps within project)

~/tmp$ virtualenv my_proj
~/tmp$ cd my_proj
~/tmp/my_proj$ . bin/activate
(my_proj)~/tmp/my_proj$ pip install django # ...
(my_proj)~/tmp/my_proj$ django-admin.py startproject my_project
(my_proj)~/tmp/my_proj$ cd my_project
(my_proj)~/tmp/my_proj/my_project$ ./manage.py startapp my_app1
(my_proj)~/tmp/my_proj/my_project$ # run/test from proj root

Do you have to jockey the $PYTHONPATH to find apps in either case?
If so, how do you make this portable/versioned (modify the
virtualenv scripts and add them to $VCS? have a custom script and put
that in $VCS?)

Which bits do you include/exclude when using version-control?

Do you keep your requirements.txt for pip at the top level virtualenv
directory, or inside the project folder (or elsewhere)?

I've seen a couple blog-posts that advocate "use virtualenv" but most
seem to elide the best-practice details.

Any tips appreciated.

-tkc


I'd keep the virtualenv directory and the project directory completely 
separate.


Keep the requirements.txt file in the top level of your Django project 
and use that if you ever need to regenerate your virtualenv directory 
structure. Essentially the virtualenv environment should be completely 
disposable since you can regenerate it automatically in the future if 
required. You certainly shouldn't be committing it a version control 
system. That seems rather messy 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/52600284.8050304%40googlemail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Preferred virtualenv layout for Django projects

2013-10-17 Thread Tim Chase
How do folks prefer to layout their Django projects when using
virtualenv?  Do you do either of the following, or something else?

Method 1: (project & apps at same level)

~/tmp$ virtualenv my_proj
~/tmp$ cd my_proj
~/tmp/my_proj$ . bin/activate
(my_proj)~/tmp/my_proj$ pip install django # ...
(my_proj)~/tmp/my_proj$ django-admin.py startproject my_project
(my_proj)~/tmp/my_proj$ django-admin.py startapp my_app1
(my_proj)~/tmp/my_proj$ # run/test from virtenv root

Method 2: (apps within project)

~/tmp$ virtualenv my_proj
~/tmp$ cd my_proj
~/tmp/my_proj$ . bin/activate
(my_proj)~/tmp/my_proj$ pip install django # ...
(my_proj)~/tmp/my_proj$ django-admin.py startproject my_project
(my_proj)~/tmp/my_proj$ cd my_project
(my_proj)~/tmp/my_proj/my_project$ ./manage.py startapp my_app1
(my_proj)~/tmp/my_proj/my_project$ # run/test from proj root

Do you have to jockey the $PYTHONPATH to find apps in either case?
If so, how do you make this portable/versioned (modify the
virtualenv scripts and add them to $VCS? have a custom script and put
that in $VCS?)

Which bits do you include/exclude when using version-control?

Do you keep your requirements.txt for pip at the top level virtualenv
directory, or inside the project folder (or elsewhere)?

I've seen a couple blog-posts that advocate "use virtualenv" but most
seem to elide the best-practice details.

Any tips appreciated.

-tkc



-- 
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/20131017102654.3556c3f9%40bigbox.christie.dr.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread Tom Evans
On Thu, Oct 17, 2013 at 1:25 PM, y venkatesh  wrote:
> Hi rush I am new to usage of this site.Can I directly discuss my doubts with
> django users  like in stackoverflow  ? Please guide me.Thanks in advance.

Also, Django users are not banned from stackoverflow (!), if you
prefer that, then use it, there are active Django "answerers".

Cheers

Tom

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


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-17 Thread J. Paskaruk
Yah, was having trouble installing it within the virtualenv as well, though
- ultimately, exiting the virtualenv and installing python-dev allowed me
to install the mysqldb module (library? I'm still unclear on terms, sorry).
anyways, problem is solved. :>


On Thu, Oct 17, 2013 at 9:14 AM, Bill Freeman  wrote:

> If you installed python-mysqldb in the base python, perhaps by using
> synaptic, then you aren't supposed to see it in the virtualenv.
>
>
> On Wed, Oct 16, 2013 at 6:48 PM, J. Paskaruk  wrote:
>
>> Heh, just realized I made an out-of-context comment. This problem is
>> actually solved, but I'm currently also having trouble connecting to MySQL,
>> and am discussing that in another thread. Forgot which thread I'm in.
>>
>> The potentially virtualenv-based problem is that python-mysqldb is
>> installed, but the virtualenv Python can't see it, and I can't install it
>> with pip. No idea, but I switched to sqlite. :>
>>
>>
>> On Wed, Oct 16, 2013 at 4:42 PM, Dow Street wrote:
>>
>>> And just a reminder that you can certainly use virtualenv without
>>> virtualenvwrapper.  Every env you create with virtualenv will have a script
>>> to activate that env located at envname/bin/activate.  For example:
>>>
>>> Open your shell, cd to the desired directory, and create a new env:
>>>
>>> $ virtualenv testenv
>>> New python executable in testenv/bin/python
>>> Installing setuptools.done.
>>> Installing pip...done.
>>>
>>> Activate the env:
>>>
>>> $ . testenv/bin/activate
>>> (testenv)$
>>>
>>> Note that the prompt changed and is now pre-pended by the env name.
>>>
>>> Deactivate the env:
>>>
>>> (testenv)$ deactivate
>>> $
>>>
>>> The prompt changes back - env is deactivated.
>>>
>>> R,
>>> Dow
>>>
>>>
>>> On Oct 16, 2013, at 2:32 PM, Bill Freeman  wrote:
>>>
>>> > virtualenv is, indeed, great stuff, and is unlikely to be your problem.
>>> >
>>> >
>>> > On Wed, Oct 16, 2013 at 3:24 PM, J. Paskaruk 
>>> wrote:
>>> > I will keep that in mind for sure - I'm always aware that there are
>>> little subtleties like that all around me, waiting to trip me up, so when
>>> someone explains one to me, I cleave to the info. I'm pretty paranoid about
>>> this kind of thing to begin with, which is why I removed it from the one
>>> when I added it to the other - if it only needs to be there once, then
>>> having it there twice is just stupidity, unless there is a demonstrable
>>> reason to do so.
>>> >
>>> > I'm kinda suspicious of virtualenv in the first place because of this,
>>> but the sales pitch by that nice young man, Simeon Whatsisname, convinced
>>> me that it was a good idea to get a handle on it.
>>> >
>>> >
>>> > On Wed, Oct 16, 2013 at 12:51 PM, Bill Freeman 
>>> wrote:
>>> > Not strictly true.  .bashrc will get run again in a sub-shell.  For
>>> example, in your shell, you run a command, and that command is a shell
>>> script.  A new shell is started to run that script.  It inherits your
>>> environment variables.  But it also runs .bashrc.  That's usually not a
>>> problem, but there are corner cases where it is, so it's worth taking a
>>> little care in writing a .bashrc file.
>>> >
>>> >
>>> > On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk 
>>> wrote:
>>> > Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
>>> should only be run the once. I'm the only significant user of this
>>> computer. Cheers!
>>> >
>>> >
>>> > On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman 
>>> wrote:
>>> > What I mean by "I don't know about sourceing virtualenvwrapper.sh" is
>>> that I don't know, and don't have the inclination to research, whether,
>>> having sourced the file in a shell, you should avoid sourcing it again in a
>>> sub-shell.
>>> >
>>> > What I mean by guard variables is that you could, at the end of your
>>> .bashrc, export a variable that is unlikely to clash with the variables of
>>> other systems, e.g.;
>>> >
>>> > export BASHRC_HAS_ALREADY_BEEN RUN
>>> >
>>> > And earlier in the file test the variable to guard against redoing the
>>> things that should not be redone.
>>> >
>>> > if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
>>> ># Put stuff that shouldn't be done twice here
>>> > fi
>>> >
>>> >
>>> > On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk 
>>> wrote:
>>> > That's the one, thank you so much! I saw in the comments of .profile
>>> that it would not be read if there was a .bashrc file present, so my next
>>> step was creating that file and putting those lines in it, but I'm very
>>> afraid of pooching my install. Noob, like I said. :>
>>> >
>>> > I have Aspergers, so I'm not clear on what you meant by "I don't know
>>> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
>>> - I'm assuming, though, that you're referring to a security concern 

Deployment

2013-10-17 Thread Zoubeida
Hi all,

i am new in django, and i want to deploy my application.
i create a package via setuptools.
in my prod server i create myvirtualenv where i installed my new package.
i also installed supêrvisor and i configured it.

i tried to use gunicorn, i install it and when i run : gunicorn_django 
--bind localhost:8001
there is an error with rpc4django:

File 
"/home/zzarkouna/.virtualenvs/DEP/local/lib/python2.7/site-packages/rpc4django/rpcdispatcher.py",
 
line 350, in register_rpcmethods
app = __import__(appname, globals(), locals(), ['*'])

but when i run it normally : Myproject_admin runserver 8001 ---> everything 
is OK!

My second prob is how to configure apache with my application package?

Any idea??


-- 
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/5402b412-a2a3-40f2-b4fe-91508a5323e2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread C. Kirby
You can ask any questions about django here, including doubts or questions 
about whether it is best for you.

On Thursday, October 17, 2013 7:25:55 AM UTC-5, ssy wrote:
>
> Hi rush I am new to usage of this site.Can I directly discuss my doubts 
> with django users  like in stackoverflow  ? Please guide me.Thanks in 
> advance.
>

-- 
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/59e8ac10-adc4-448e-840f-ffc686c47eb3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-17 Thread Bill Freeman
If you installed python-mysqldb in the base python, perhaps by using
synaptic, then you aren't supposed to see it in the virtualenv.


On Wed, Oct 16, 2013 at 6:48 PM, J. Paskaruk  wrote:

> Heh, just realized I made an out-of-context comment. This problem is
> actually solved, but I'm currently also having trouble connecting to MySQL,
> and am discussing that in another thread. Forgot which thread I'm in.
>
> The potentially virtualenv-based problem is that python-mysqldb is
> installed, but the virtualenv Python can't see it, and I can't install it
> with pip. No idea, but I switched to sqlite. :>
>
>
> On Wed, Oct 16, 2013 at 4:42 PM, Dow Street  wrote:
>
>> And just a reminder that you can certainly use virtualenv without
>> virtualenvwrapper.  Every env you create with virtualenv will have a script
>> to activate that env located at envname/bin/activate.  For example:
>>
>> Open your shell, cd to the desired directory, and create a new env:
>>
>> $ virtualenv testenv
>> New python executable in testenv/bin/python
>> Installing setuptools.done.
>> Installing pip...done.
>>
>> Activate the env:
>>
>> $ . testenv/bin/activate
>> (testenv)$
>>
>> Note that the prompt changed and is now pre-pended by the env name.
>>
>> Deactivate the env:
>>
>> (testenv)$ deactivate
>> $
>>
>> The prompt changes back - env is deactivated.
>>
>> R,
>> Dow
>>
>>
>> On Oct 16, 2013, at 2:32 PM, Bill Freeman  wrote:
>>
>> > virtualenv is, indeed, great stuff, and is unlikely to be your problem.
>> >
>> >
>> > On Wed, Oct 16, 2013 at 3:24 PM, J. Paskaruk 
>> wrote:
>> > I will keep that in mind for sure - I'm always aware that there are
>> little subtleties like that all around me, waiting to trip me up, so when
>> someone explains one to me, I cleave to the info. I'm pretty paranoid about
>> this kind of thing to begin with, which is why I removed it from the one
>> when I added it to the other - if it only needs to be there once, then
>> having it there twice is just stupidity, unless there is a demonstrable
>> reason to do so.
>> >
>> > I'm kinda suspicious of virtualenv in the first place because of this,
>> but the sales pitch by that nice young man, Simeon Whatsisname, convinced
>> me that it was a good idea to get a handle on it.
>> >
>> >
>> > On Wed, Oct 16, 2013 at 12:51 PM, Bill Freeman 
>> wrote:
>> > Not strictly true.  .bashrc will get run again in a sub-shell.  For
>> example, in your shell, you run a command, and that command is a shell
>> script.  A new shell is started to run that script.  It inherits your
>> environment variables.  But it also runs .bashrc.  That's usually not a
>> problem, but there are corner cases where it is, so it's worth taking a
>> little care in writing a .bashrc file.
>> >
>> >
>> > On Wed, Oct 16, 2013 at 1:40 PM, J. Paskaruk 
>> wrote:
>> > Ahh k. I took it out of .profile entirely and put it in .bashrc, so it
>> should only be run the once. I'm the only significant user of this
>> computer. Cheers!
>> >
>> >
>> > On Wed, Oct 16, 2013 at 11:45 AM, Bill Freeman 
>> wrote:
>> > What I mean by "I don't know about sourceing virtualenvwrapper.sh" is
>> that I don't know, and don't have the inclination to research, whether,
>> having sourced the file in a shell, you should avoid sourcing it again in a
>> sub-shell.
>> >
>> > What I mean by guard variables is that you could, at the end of your
>> .bashrc, export a variable that is unlikely to clash with the variables of
>> other systems, e.g.;
>> >
>> > export BASHRC_HAS_ALREADY_BEEN RUN
>> >
>> > And earlier in the file test the variable to guard against redoing the
>> things that should not be redone.
>> >
>> > if [ "$BASHRC_HAS_ALREADY_BEEN RUN" -ne "1" ]; then
>> ># Put stuff that shouldn't be done twice here
>> > fi
>> >
>> >
>> > On Wed, Oct 16, 2013 at 12:24 PM, J. Paskaruk 
>> wrote:
>> > That's the one, thank you so much! I saw in the comments of .profile
>> that it would not be read if there was a .bashrc file present, so my next
>> step was creating that file and putting those lines in it, but I'm very
>> afraid of pooching my install. Noob, like I said. :>
>> >
>> > I have Aspergers, so I'm not clear on what you meant by "I don't know
>> about sourceing virtualenvwrapper.sh.  (Guard variables are your friend.)"
>> - I'm assuming, though, that you're referring to a security concern in this
>> line, presumably based on the idea that someone could access
>> virtualenvwrapper.sh and put malicious code in there.
>> >
>> > If I've assessed your comment correctly, is there a good, basic
>> tutorial on {guard variables}, as well as the larger schema into which they
>> fit? Preferably one that *does* assume intelligence, but does *not* assume
>> a lot of existing knowledge on the part of the user?
>> >
>> >
>> > Whatever the 

Re: Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread Daniele Procida
On Thu, Oct 17, 2013, rush  wrote:

>http://www.djangobook.com/ is also a good choice.

I would not recommend that actually. It's very out of date. 

Even the book itself says: "we ask that, at this time, djangobook.com not be 
used for educational purposes."

On the other hand, if people woud like help to bring it up to date...

Daniele

-- 
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/20131017122734.984289775%40smtp.modern-world.net.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread y venkatesh
Hi rush I am new to usage of this site.Can I directly discuss my doubts 
with django users  like in stackoverflow  ? Please guide me.Thanks in 
advance.

-- 
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/ea6584ec-2427-48bd-82bb-a2800458ceea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread rush
http://www.djangobook.com/ is also a good choice. -- wbr,rush.  17.10.2013, 15:49, "François Schiettecatte" :See:https://docs.djangoproject.com/en/1.5/intro/tutorial01/FrançoisOn Oct 17, 2013, at 7:44 AM, y venkatesh  wrote: Hi every body,Good to evening to allI am new to django framework can any body please give suggest me what is best tutorial point for learning Django. Thanks & Regards, ssy. --  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/3e9c3cb0-a6e7-4336-89dd-f9bd58ef6e37%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.-- 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/70E50812-ECAD-4BBF-BF9A-80C2A07DACE7%40gmail.com.For more options, visit https://groups.google.com/groups/opt_out.



-- 
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/109471382010727%40web2g.yandex.ru.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread François Schiettecatte
See:

https://docs.djangoproject.com/en/1.5/intro/tutorial01/

François

On Oct 17, 2013, at 7:44 AM, y venkatesh  wrote:

> Hi every body,
> 
>Good to evening to allI am new to django framework can any 
> body please give suggest me what is best tutorial point for learning Django.
> 
> 
> Thanks & Regards,
> ssy.
> 
> -- 
> 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/3e9c3cb0-a6e7-4336-89dd-f9bd58ef6e37%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/70E50812-ECAD-4BBF-BF9A-80C2A07DACE7%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Please suggest me best e-tutorial for Django framework.

2013-10-17 Thread y venkatesh
Hi every body,

   Good to evening to allI am new to django framework can 
any body please give suggest me what is best tutorial point for learning 
Django.


Thanks & Regards,
ssy.

-- 
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/3e9c3cb0-a6e7-4336-89dd-f9bd58ef6e37%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-17 Thread y venkatesh


On Tuesday, October 15, 2013 10:38:35 PM UTC+5:30, rok wrote:
>
> I have recently been testing the 1.6b4 tag with a new app we are writing, 
> using apache and wsgi. However, I could not get rid of the following issue 
> happening on every request:
>
> ...
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File 
> "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line 2, 
> in 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from 
> django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, 
> StackedInline, TabularInline, HORIZONTAL, VERTICAL
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File 
> "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6, in 
> 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from 
> django.contrib.admin.sites import AdminSite, site
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File 
> "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in 
> 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from 
> django.contrib.admin import ModelAdmin, actions
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError: cannot 
> import name actions
>
> by doing the following change, I could get rid of what looked like a 
> circular import issue:
> --- a/django/contrib/admin/sites.py
> +++ b/django/contrib/admin/sites.py
> @@ -1,6 +1,7 @@
>  from functools import update_wrapper
>  from django.http import Http404, HttpResponseRedirect
> -from django.contrib.admin import ModelAdmin, actions
> +from django.contrib.admin import ModelAdmin
> +from django.contrib.admin.actions import delete_selected
>  from django.contrib.admin.forms import AdminAuthenticationForm
>  from django.contrib.auth import REDIRECT_FIELD_NAME
>  from django.contrib.contenttypes import views as contenttype_views
> @@ -46,7 +47,7 @@ class AdminSite(object):
>  self._registry = {}  # model_class class -> admin_class instance
>  self.name = name
>  self.app_name = app_name
> -self._actions = {'delete_selected': actions.delete_selected}
> +self._actions = {'delete_selected': delete_selected}
>  self._global_actions = self._actions.copy()
>  
>  def register(self, model_or_iterable, admin_class=None, **options):
>
> Switching to 1.5.4 resolves the issue as well (even though the sites.py 
> code is the same). What is more, this did not occur in the development 
> environment when using the runserver run.
>
> Any clue?
>

-- 
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/9a44b544-2bce-4bd9-b506-75f9993284d5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Loading data from Django into RedShift - ORM vs SQL?

2013-10-17 Thread Avraham Serour
The whole idea of having an ORM is not having ot deal with SQL directly
unless necessary. I would try to do it using the ORM first but there's not
general rule, each case should be analised individually


On Thu, Oct 17, 2013 at 10:21 AM, Victor Hooi  wrote:

> Hi,
>
> We have a Django eCommerce site, from where we want to load transactional
> data into Amazon RedShift (i.e. basically ETL).
>
> This would probably be a batch load run either once a day, or at intervals
> throughout the day.
>
> (I'm also curious about whether it's possible to stream the data in, but I
> don't think that will work well with RedShift).
>
> My question is regarding how we should be extracting the data - we can
> either hook directly into the Django ORM, or just use SQL by hand.
>
> What are people's experiences with either approach? Any thoughts on
> pros/cons of either?
>
> Cheers,
> Victor
>
> --
> 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/c020f34a-37c0-4259-9251-dd5ccad00968%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Matthias Müller
You need the python header as well:

sudo apt-get install python-dev

-- 
Viele Grüße / Best Regards
Matthias Müller


2013/10/17 Nigel Legg 

> Thanks Thomas, that worked, so some progress, but now when I do sudo pip
> psycopg2, I get an error: Python.h not found -
> In file included from psycopg/psycopgmodule.c:27:0:
> ./psycopg/psycopg.h:30:20: fatal error: Python.h: no such file or
> directory.
> Should I be downloading and building the source?
>
> Cheers, Nigel
> 07914 740972
>
>
>
> On 17 October 2013 09:57, Thomas Orozco  wrote:
>
>> You need the Postgres client C headers to build psycopg2. Before running
>> pip install psycopg2, run:
>>
>> sudo apt-get install libpq-dev
>>
>>
>>
>>
>>  On Thu, Oct 17, 2013 at 10:51 AM, Nigel Legg wrote:
>>
>>> I am not sure whether this is really a postgres issue or a python /
>>> Django issue - please let me know if I should be posting this elsewhere.
>>> I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the
>>> Ubuntu software centre says I have Python 3.3, but when I go into the
>>> Python shell it says 2.7.4).
>>> I followed the instructions on configuring Postgres from
>>> http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
>>> up to the point of adding a line to the pg_hba.conf file - Ubuntu would not
>>> let me write to this.
>>> When I tried to install psycopg2 (pip install psycopg2),  I got the
>>> following error:
>>>
>>> ERROR: you need to install postgresql-server-dev-X.Y for building a
>>> server side extension or libpq-dev for building a client-side application.
>>>
>>> What does this mean?  How do I proceed?
>>>
>>> Many thanks in advance for your help.
>>>
>>>  --
>>> 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/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> 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/CAMuNovQyS1jhWLieeZ-Etb%2Bfpp1%2B6iaSRTuf5hNxVFJQpC4fWw%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CADeX7vwToyt8ze989WhUkmQ2nx0TwTqt8L7ibC3sHrGjZeRjBA%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAA2xsHRLPVYeA8knu0kLAFXN9Wug9KqPw-OG3AFSwZTC0fWiyg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Thomas Orozco
You're missing:

sudo apt-get install python-dev


On Thu, Oct 17, 2013 at 11:31 AM, Nigel Legg  wrote:

> Thanks Thomas, that worked, so some progress, but now when I do sudo pip
> psycopg2, I get an error: Python.h not found -
> In file included from psycopg/psycopgmodule.c:27:0:
> ./psycopg/psycopg.h:30:20: fatal error: Python.h: no such file or
> directory.
> Should I be downloading and building the source?
>
> Cheers, Nigel
> 07914 740972
>
>
>
> On 17 October 2013 09:57, Thomas Orozco  wrote:
>
>>  You need the Postgres client C headers to build psycopg2. Before
>> running pip install psycopg2, run:
>>
>> sudo apt-get install libpq-dev
>>
>>
>>
>>
>>  On Thu, Oct 17, 2013 at 10:51 AM, Nigel Legg wrote:
>>
>>> I am not sure whether this is really a postgres issue or a python /
>>> Django issue - please let me know if I should be posting this elsewhere.
>>> I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the
>>> Ubuntu software centre says I have Python 3.3, but when I go into the
>>> Python shell it says 2.7.4).
>>> I followed the instructions on configuring Postgres from
>>> http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
>>> up to the point of adding a line to the pg_hba.conf file - Ubuntu would not
>>> let me write to this.
>>> When I tried to install psycopg2 (pip install psycopg2),  I got the
>>> following error:
>>>
>>> ERROR: you need to install postgresql-server-dev-X.Y for building a
>>> server side extension or libpq-dev for building a client-side application.
>>>
>>> What does this mean?  How do I proceed?
>>>
>>> Many thanks in advance for your help.
>>>
>>>  --
>>> 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/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> 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/CAMuNovQyS1jhWLieeZ-Etb%2Bfpp1%2B6iaSRTuf5hNxVFJQpC4fWw%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CADeX7vwToyt8ze989WhUkmQ2nx0TwTqt8L7ibC3sHrGjZeRjBA%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAMuNovTGg84%2BLefLWV93CyDncbBpyzg0%2BvtnTgcsuo8M-fscuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Nigel Legg
Thanks Thomas, that worked, so some progress, but now when I do sudo pip
psycopg2, I get an error: Python.h not found -
In file included from psycopg/psycopgmodule.c:27:0:
./psycopg/psycopg.h:30:20: fatal error: Python.h: no such file or directory.
Should I be downloading and building the source?

Cheers, Nigel
07914 740972



On 17 October 2013 09:57, Thomas Orozco  wrote:

> You need the Postgres client C headers to build psycopg2. Before running
> pip install psycopg2, run:
>
> sudo apt-get install libpq-dev
>
>
>
>
> On Thu, Oct 17, 2013 at 10:51 AM, Nigel Legg  wrote:
>
>> I am not sure whether this is really a postgres issue or a python /
>> Django issue - please let me know if I should be posting this elsewhere.
>> I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the
>> Ubuntu software centre says I have Python 3.3, but when I go into the
>> Python shell it says 2.7.4).
>> I followed the instructions on configuring Postgres from
>> http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
>> up to the point of adding a line to the pg_hba.conf file - Ubuntu would not
>> let me write to this.
>> When I tried to install psycopg2 (pip install psycopg2),  I got the
>> following error:
>>
>> ERROR: you need to install postgresql-server-dev-X.Y for building a
>> server side extension or libpq-dev for building a client-side application.
>>
>> What does this mean?  How do I proceed?
>>
>> Many thanks in advance for your help.
>>
>>  --
>> 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/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CAMuNovQyS1jhWLieeZ-Etb%2Bfpp1%2B6iaSRTuf5hNxVFJQpC4fWw%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Thomas Orozco
You need the Postgres client C headers to build psycopg2. Before running
pip install psycopg2, run:

sudo apt-get install libpq-dev




On Thu, Oct 17, 2013 at 10:51 AM, Nigel Legg  wrote:

> I am not sure whether this is really a postgres issue or a python / Django
> issue - please let me know if I should be posting this elsewhere.
> I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the
> Ubuntu software centre says I have Python 3.3, but when I go into the
> Python shell it says 2.7.4).
> I followed the instructions on configuring Postgres from
> http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
> up to the point of adding a line to the pg_hba.conf file - Ubuntu would not
> let me write to this.
> When I tried to install psycopg2 (pip install psycopg2),  I got the
> following error:
>
> ERROR: you need to install postgresql-server-dev-X.Y for building a server
> side extension or libpq-dev for building a client-side application.
>
> What does this mean?  How do I proceed?
>
> Many thanks in advance for your help.
>
>  --
> 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/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAMuNovQyS1jhWLieeZ-Etb%2Bfpp1%2B6iaSRTuf5hNxVFJQpC4fWw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Ubuntu, Postgres, and psycopg2.

2013-10-17 Thread Nigel Legg
I am not sure whether this is really a postgres issue or a python / Django 
issue - please let me know if I should be posting this elsewhere.
I have installed Ubuntu 13.04, Postgres 9.1 and Django. (strangely, the 
Ubuntu software centre says I have Python 3.3, but when I go into the 
Python shell it says 2.7.4).  
I followed the instructions on configuring Postgres from 
http://blog.iiilx.com/programming/how-to-install-postgres-on-ubuntu-for-django/,
 
up to the point of adding a line to the pg_hba.conf file - Ubuntu would not 
let me write to this. 
When I tried to install psycopg2 (pip install psycopg2),  I got the 
following error:

ERROR: you need to install postgresql-server-dev-X.Y for building a server 
side extension or libpq-dev for building a client-side application. 

What does this mean?  How do I proceed? 

Many thanks in advance for your help.

-- 
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/3b3fa90f-7602-40ff-ab79-55d70c3074f1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Doing the basic tutorial, MySQL-python problems.

2013-10-17 Thread Robbie Scourou
Only on weekends! Glad it's sorted for you. :)


On Wed, Oct 16, 2013 at 11:57 PM, J. Paskaruk  wrote:

> I followed your directions, and the whole thing went off without a hitch.
>
> ARE YOU A WIZARD?!
>
>
> On Wed, Oct 16, 2013 at 5:25 PM, Robbie Scourou  wrote:
>
>> Shutting up sir! :)
>>
>> One last thing to try:
>>
>> apt-get install python-dev
>>
>> Do that outside of virtualenv, then try it installing mysql-python within
>> the virtualenv. After that, I'm out of ideas.
>>
>>
>> On Wed, Oct 16, 2013 at 8:21 PM, J. Paskaruk  wrote:
>>
>>>
>>> On Wed, Oct 16, 2013 at 1:50 PM, Robbie Scourou wrote:
>>>
 apt-get install libmysqlclient-dev
>>>
>>>
>>>
>>> Sorry, I'm running Linux Mint, very similar to your vaporators in most
>>> respects. Can you speak Bochi? Of course I can sir, it's like a second
>>> language to me. Ok, shut up, I'll take this one.
>>>
>>> Sorry. I exited my virtualenv to do that install first, and it did
>>> indeed install something new. Let's see... still gives the error. pip
>>> install MySQL-Python still doesn't work in the virtualenv either. Sigh.
>>>
>>> In other news, I'm making great progress with sqlite, so if you wanna
>>> keep throwing ideas at me I'll keep trying em, but if I'm getting boring,
>>> don't worry bout it none. Like i said, as long as I'm making some kind of
>>> progress, I usually find that the stuff I find difficult today magically
>>> becomes trivial when I come back to it a few weeks later. :>
>>>
>>>  --
>>> 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/CANabDd%2BG_VCS9aen3sRRGBTH09%2B%3D4kuCxDR-XLq8OUYwrWWpeQ%40mail.gmail.com
>>> .
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> 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/lLyFY5EIjyE/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/CAC2OFVpR_Rprnt3u9ywVkqdQQM2u%2BB4J-jBV8rtKTL22SC8ftQ%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CANabDdKaks8uj7Fe2X4pPt%3D6QCxKfdGARrjeL87YfCC0y8Srsg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAC2OFVrpHzw5821sETafp%2Bxja%3DNTxE_xiRAQ4n53qKqfj6K7%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Loading data from Django into RedShift - ORM vs SQL?

2013-10-17 Thread Victor Hooi
Hi,

We have a Django eCommerce site, from where we want to load transactional 
data into Amazon RedShift (i.e. basically ETL).

This would probably be a batch load run either once a day, or at intervals 
throughout the day.

(I'm also curious about whether it's possible to stream the data in, but I 
don't think that will work well with RedShift).

My question is regarding how we should be extracting the data - we can 
either hook directly into the Django ORM, or just use SQL by hand.

What are people's experiences with either approach? Any thoughts on 
pros/cons of either?

Cheers,
Victor

-- 
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/c020f34a-37c0-4259-9251-dd5ccad00968%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.