Re: import django fails, what should I look at?

2014-07-25 Thread Andre Terra
On Sun, Jul 20, 2014 at 12:57 PM, Andre Terra <andrete...@gmail.com> wrote:

> pip install -e git#https://github.com/django/django.git


For the record, the right command is pip install -e git+
https://github.com/django/django.git#egg=django

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


Re: import django fails, what should I look at?

2014-07-20 Thread Andre Terra
You should use pip to install django.

This is how I go about it, from a fresh install.

mkdir ~/virtual
mkdir ~/projects
pip install virtualenv # unnecessary in python 3.3+
pip install virtualenvwrapper # use this. it will make your life much
simplerecho "export WORKON_HOME=$HOME/virtual" >> ~/.bashrcecho
"export PROJECT_HOME=$HOME/projects" >> ~/.bashrcecho "source
/usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc

After that, create your first virtualenv using mkvirtualenv foo, activate
it using workon foo, and deactivate it with deactivate.

Install packages using by issuing pip install commands, so if you want
django, you can use pip install django for the latest release or pip install
-e git#https://github.com/django/django.git for the latest development
version.

You might want to check the docs for virtualenv, virtualenvwrapper and pip.
You may also benefit from using yolk (python package) to check what you
already have installed in each virtualenv..

Best of luck!


Cheers,
AT


On Sat, Jul 19, 2014 at 7:21 PM, Dan Bikle  wrote:

> Hello World,
>
> I'm curious about working with the dev-version of Django.
>
> I want to get skilled at using Django, Python 2.7.8, and virtualenv
> together.
>
> I see this page:
>
> https://github.com/django/django/blob/master/INSTALL
>
> I installed python and then virtualenv:
>
> d...@cen113.dan ~ $ which python
> /home/dan/venv1/bin/python
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $ /home/dan/venv1/bin/python
> /home/dan/venv1/bin/python
> Python 2.7.8 (default, Jul 15 2014, 03:37:39)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> quit()
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
>
> The above INSTALL page says this:
>
> AS AN ALTERNATIVE, you can just copy the entire "django" directory to
> Python's
> site-packages directory
>
> I did this:
>
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $ cd /home/dan/venv1/lib/python2.7/site-packages
> d...@cen113.dan ~/venv1/lib/python2.7/site-packages $
> d...@cen113.dan ~/venv1/lib/python2.7/site-packages $
> d...@cen113.dan ~/venv1/lib/python2.7/site-packages $
>
> git clone https://github.com/django/django.git
>
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $ ls -la ~/venv1/lib/python2.7/site-packages/django/
> total 112
> drwxr-xr-x.   9 dan dan  4096 Jul 19 21:41 .
> drwxrwxr-x.   8 dan dan  4096 Jul 19 21:41 ..
> -rw-rw-r--.   1 dan dan 26288 Jul 19 21:41 AUTHORS
> -rw-rw-r--.   1 dan dan   913 Jul 19 21:41 CONTRIBUTING.rst
> drwxrwxr-x.  17 dan dan  4096 Jul 19 21:41 django
> drwxrwxr-x.  13 dan dan  4096 Jul 19 21:41 docs
> drwxrwxr-x.   2 dan dan  4096 Jul 19 21:41 extras
> drwxrwxr-x.   8 dan dan  4096 Jul 19 21:59 .git
> -rw-rw-r--.   1 dan dan   249 Jul 19 21:41 .gitattributes
> -rw-rw-r--.   1 dan dan   123 Jul 19 21:41 .gitignore
> -rw-rw-r--.   1 dan dan   136 Jul 19 21:41 .hgignore
> -rw-rw-r--.   1 dan dan   611 Jul 19 21:41 INSTALL
> -rw-rw-r--.   1 dan dan  1552 Jul 19 21:41 LICENSE
> -rw-rw-r--.   1 dan dan  1639 Jul 19 21:41 MANIFEST.in
> -rw-rw-r--.   1 dan dan  1782 Jul 19 21:41 README.rst
> drwxrwxr-x.   2 dan dan  4096 Jul 19 21:41 scripts
> -rw-rw-r--.   1 dan dan   404 Jul 19 21:41 setup.cfg
> -rw-rw-r--.   1 dan dan  3302 Jul 19 21:41 setup.py
> drwxrwxr-x. 198 dan dan 12288 Jul 19 21:41 tests
> drwxrwxr-x.   2 dan dan  4096 Jul 19 21:41 .tx
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
>
>
> At this point I have done what the INSTALL page says I can do.
>
> I tried this:
>
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $ which python
> which python
> /home/dan/venv1/bin/python
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $
> d...@cen113.dan ~ $ python
> python
> Python 2.7.8 (default, Jul 15 2014, 03:37:39)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> import django
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named django
> >>>
> >>>
>
> Since I'm using virtualenv and the latest dev-version of Django together,
> I must have a loose connection somewhere in my setup.
>
>
> I have some questions:
>
> q1: Is this statement true:
> "
> AS AN ALTERNATIVE, you can just copy the entire "django" directory to
> Python's
> site-packages directory
> "
> ??
>
> q2: If import django failed for you how would you debug it?
>
> q3: If I import a module and python cannot see it, do I need to be looking
> at any env variables?
>
> Dan
>
>  --
> 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 

Re: Anyone interested in reviewing the code of a small project - BookMarker

2014-05-26 Thread Andre Terra
Why are you using the webbrowser library? I don't see how it makes sense..


Cheers,
AT


On Mon, May 26, 2014 at 12:32 PM, Aseem Bansal  wrote:

> Thanks Shmengie. I was thinking of using class based views as it was
> pointed in tutorial that they are better but I was not sure which ones are
> good here. So I decided to prioritize making it work and then go for
> refactoring. CSS location I will change.
>
> The tutorials used include's but I didn't get the benefit of using that in
> a small project. I mean in a program I can think of independent units and
> turn them into functions but in HTML how do you go about breaking it into
> parts? I mean the thought process for deciding the parts. If I have many
> files then I can extract the common things but for a single file I am not
> sure how to go about that.
>
> Partials refers to the sub-templates. Correct?
>
> Custom template tags - I'll put that on my TODO list for later reading.
>
> On Monday, May 26, 2014 7:28:02 PM UTC+5:30, shmengie wrote:
>>
>> Looks like you're getting a handle on django.
>> You're not using Class Based Views, but you import generic.  Since you're
>> getting familiar with django, you *might* want to hold off on delving into
>> CBVs.  They're very powerful and can reduce coding, but can be difficult to
>> wrap your head around.
>>
>> Once you've created your app with functions, then perhaps go back and
>> wrap 'em in CBV's.  CBV's have a lot of power, but while learning the
>> basics, sticking with functions can be a lot less assimilate all at once.
>>
>> In your template, you have CSS at the bottom. CSS is typically linked in
>> the  section.  I suppose most web browsers today are okay
>> either way.  Javascript/jquery is typically near the end of the html, as
>> you have it.
>>
>> I wish w3c/html5 spec'd tags for  and 
>> locations.  Javascript more than css links seem feel sloppy to me, ahh
>> well, it is what it is.
>>
>> Next, I suspect you might want to work on a base.html and working with
>> {{include's}}.  It's a fairly easy concept to grasp and some of the beauty
>> of django's templating.  I wouldn't recommend delving into custom template
>> tags yet, but it's good to know they exist.
>>
>> You're template is not complex, being familiar with partials is an easy
>> way to keep it *simpler.*
>>
>> -Joe
>>
>  --
> 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/33c0987a-9edb-42dc-b37a-28c6273d2253%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: django output pdf problem

2014-04-24 Thread Andre Terra
Relevant Stack Overflow question/answer:
http://stackoverflow.com/a/9970672/447485

In short, you can't do it over simple Ajax, but you can emulate it.


Cheers,
AT


On Thu, Apr 24, 2014 at 8:56 AM, Tom Evans  wrote:

> On Thu, Apr 24, 2014 at 4:31 AM, 张永强  wrote:
> >
> > In my program, I want to generate a pdf and output to the browser.
> >
> > the server end code is:
> >
> > response = HttpResponse(content_type='application/pdf')
> > response['Content-Disposition'] = 'attachment; filename="' + orderNumber
> + '.pdf"'
> > response.write(pdf)
> > return response
> >
> > In the code, the type of pdf is 'str'
> >
> > the ajax code is:
> >
> > $.ajax({
> > type:'POST',
> > url:'/orderplace/',
> > data:{provider:provider, providerId:providerId,
> orderNumber:orderNumber},
> > success:function(resultData) {
> >   ;
> > }
> > });
>
> You cannot download files with AJAX. Make a regular request.
>
> 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/CAFHbX1JES94hqHGNkcacE65s_qAuJ6nK%3Db7gT6RaynmxeFopng%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: recommended fcgi way for django 1.6 on windows? Problems with https

2014-04-14 Thread Andre Terra
I've used nginx in windows with great results. In fact, I even compiled it
on cygwin with additional modules (namely, to track large file uploads) and
everything worked smoothly.


Cheers,
AT


On Mon, Apr 14, 2014 at 1:48 PM, anton  wrote:

> Hi
>
> I did a test with modwsgi on windows with apache,
> http and https work now both.
>
> Thanks :-)
>
> *BUT*: the modwsgi does not support Daemonmode on windows,
> which means that I need to restart the whole apache Server every time
> I update my django app.
>
> For a real productionserver its a nightmare, if there are different apps
> hosted.
>
> Perhaps I find a solution .. :-(
>
> Anton
>
>
> --
> 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/lih3hn%24sn4%241%40ger.gmane.org
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How do I use mathematical calculations on my forloop Article/Publication list?

2013-11-23 Thread Andre Terra
Take a look at the docs for aggregation and annotation and using F
expressions in them. I just skimmed over your email, but there might be
something useful to learn there.

https://docs.djangoproject.com/en/dev/topics/db/aggregation/
https://docs.djangoproject.com/en/dev/ref/models/queries/#f-expressions

Also, is there a reason why you're not using class based views?

https://docs.djangoproject.com/en/dev/topics/class-based-views/


Cheers,
AT


On Sat, Nov 23, 2013 at 8:12 PM, Pepsodent Cola wrote:

> I worked some more on James' hint:  articles[0].num_publications()
>
> And I followed some tutorial exercises on making Template filters.  After
> seeing DJ-Tom's hint.
>
> And this is as far as I got from trying things...
> I'm trying to send two lists to my template so I can do some parallel
> iteration in my forloop.
> But then I realized that *type(articles)* is a Queryset and not a list so
> I can't use zip() like in the examples I'm reading.
>
> So how can I integrate my list
> *publicists_coverage* = [] # List 3
> into this forloop template code?
> {% for row in *articles* %}
>
>
>
> #___
>
> def index(request):
> publications = Publication.objects.all()
>
> # sum_publications = Publication.objects.filter(article__pk=1).count()
>
> # List 1
> *articles* =
> Article.objects.all().annotate(num_publications=Count('publications'))
> #>>> type(articles)
> #
>
> # 3
> publication_per_article = [] # List 2
> for i in range(articles.count()):
> x = articles[i].num_publications
> publication_per_article.append(x)
>
> # 5
> total_publicists = Publication.objects.all().count()
>
> # Calculate things!
> *publicists_coverage* = [] # List 3
> for row in publication_per_article:
> y = float(row)/total_publicists
> publicists_coverage.append(y)
>
> ziplist = zip(articles, publicists_coverage)
> context = {'publications':publications, 'articles':articles,
>'total_publicists':total_publicists, 'ziplist':ziplist}
> #context = {'publications':publications,
> #   'total_publicists':total_publicists, 'ziplist':ziplist}
> return render(request, 'magazine/index.html', context)
>
> #___
>
> {% if *articles* and ziplist %}
> 
> 
> Article id
> Article
> Publication
> Publicists coverage (%)
> 
> {% for row in *articles* %}
> 
> {{ row.id }}
> {{ row.headline }}
> {{ row.num_publications }}
> ({{ row.num_publications }} / {{ total_publicists }}) = {{
> publicists_coverage }}x %
> 
> {% endfor %}
> 
> {% else %}
> No Articles or Ziplist are available.
> {% endif %}
>
>
>
>
>
>
>
>
> On Wednesday, November 20, 2013 10:29:24 PM UTC+1, Pepsodent Cola wrote:
>
>> 1.)
>> How do I use mathematical calculations on my forloop Article/Publication
>> list?
>>
>> * I have attached a screenshot with the table field that I'm working on 
>> *"Publicists
>> coverage (%)"*.
>> * Admin user/pass = joe/joe
>> * I have also attached my project files so that you can see things for
>> yourselves.
>>
>>
>> 2.)
>> Is the solution I'm working with in "Index View page" the correct
>> practice to do my mathematical calculations?
>>
>> #___
>> 
>>
>> def index(request):
>> publications = Publication.objects.all()
>>
>>
>> # sum_publications = Publication.objects.filter(
>> article__pk=1).count()
>> articles = Article.objects.all().annotate(num_publications=
>> Count('publications'))
>> *#articles_int = int(articles)*
>>
>> *sum_publicists = Publication.objects.all().count()*
>>
>> *#publicists_coverage = articles/sum_publicists*
>>
>>
>> #context = {'publications':publications, 'sum_publicists':sum_
>> publicists,
>> #   'publicists_coverage':publicists_coverage,
>> 'articles':articles}
>> context = {'publications':publications, 'sum_publicists':sum_
>> publicists,
>>'articles':articles}
>> return render(request, 'magazine/index.html', context)
>> #___
>> 
>>
>> 
>> How many Publications was each Article in?
>>
>> {% if articles %}
>> 
>> 
>> Article id
>> Article
>> Publication
>> *Publicists coverage (%)*
>> 
>> {% for row in articles %}
>> 
>> {{ 
>> row.id}}
>> {{ row.headline }}
>> {{ row.num_publications }}
>> (*{{ row.num_publications }} / {{ sum_publicists }}*) = x
>> %
>> 
>> {% endfor %}
>> 
>> {% else %}
>> No Articles are available.

Re: Prefork vs threaded when I want to spawn my own threads

2013-09-04 Thread Andre Terra
On Wed, Sep 4, 2013 at 2:36 PM, Javier Guerra Giraldez
wrote:

> above that, Redis is a clean, fast and very scalable platform for
> queues.  if you don't have heavy buzzword dependency, i wouldn't
> bother checking AMQP systems and stay with Redis.
>

A thousand times this. You don't need AMQP systems until you need them.

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


Re: quick question: RE model relations

2013-09-02 Thread Andre Terra
How about posting both models.py from galleryview and event to something
like https://gist.github.com/ ?

Maybe we can work from there.


Cheers,
AT


On Mon, Sep 2, 2013 at 2:07 PM, Bobby Roberts <tchend...@gmail.com> wrote:

> i tried doing that and now get this error:
>
> Error: One or more models did not validate:
> galleryview.galleryphoto: Accessor for field 'GalleryId' clashes with
> related field 'Gallery.Gallery_Id'. Add a related_name argument to the
> definition for 'GalleryId'.
> galleryview.galleryphoto: Reverse query name for field 'GalleryId' clashes
> with related field 'Gallery.Gallery_Id'. Add a related_name argument to the
> definition for 'GalleryId'.
> events.event: Accessor for field 'GalleryId' clashes with related field
> 'Gallery.Gallery_Id'. Add a related_name argument to the definition for
> 'GalleryId'.
> events.event: Reverse query name for field 'GalleryId' clashes with
> related field 'Gallery.Gallery_Id'. Add a related_name argument to the
> definition for 'GalleryId'.
>
>
> now i'm really lost.
>
> On Monday, September 2, 2013 12:40:29 PM UTC-4, Andre Terra (airstrike)
> wrote:
>
>> As per the current docs[0], you need to provide a dotted path to your
>> model in the form app.ModelName when defining a ForeignKey.
>>
>> So try this instead:
>>
>> GalleryId = models.ForeignKey('galleryview**.Gallery',
>> verbose_name=_('Gallery Id'), related_name='Gallery_Id',blan**k=True,
>> null=True, help_text=_("You can associate a photo gallery to this event
>> here."))
>>
>> If you don't mind me saying, 'galleryview' is a funny name for a django
>> module, considering how we use the name 'view' for something else entirely.
>>
>>
>> Cheers,
>> AT
>>
>>  [0] https://docs.**djangoproject.com/en/dev/ref/**
>> models/fields/#foreignkey<https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey>
>>
>>
>> On Mon, Sep 2, 2013 at 1:24 PM, Bobby Roberts <tche...@gmail.com> wrote:
>>
>>>  I'm creating an event module and want people to be able to associate a
>>> picture gallery with the event:
>>>
>>>
>>>
>>> from django.utils.translation import get_language, ugettext,
>>> ugettext_lazy as _
>>> from django.contrib import admin
>>> from django.db import models
>>> from django.contrib.auth.models import User
>>> from tinymce import models as tinymce_models
>>> from galleryview.models import Gallery
>>>
>>> active_choices=(
>>> (1,"Yes"),
>>> (0,"No"),
>>> )
>>>
>>> class event (models.Model):
>>> id = models.AutoField (primary_key=True)
>>> active = models.IntegerField(blank=**False,
>>> choices=active_choices)
>>> title = models.CharField(blank=False,**max_length=150)
>>> startDate = models.DateTimeField (blank=False,db_index=True)
>>> endDate = models.DateTimeField (blank=False,db_index=True)
>>> blurb = models.TextField (blank=False, max_length=175,help_text="
>>> **limit to a sentence, 175 chars.")
>>> message = models.TextField (blank=False, max_length=2000)
>>> GalleryId = models.ForeignKey('Gallery', verbose_name=_('Gallery
>>> Id'), related_name='Gallery_Id',**blank=True, null=True,
>>> help_text=_("You can associate a photo gallery to this event here."))
>>>
>>> class eventAdmin(admin.ModelAdmin):
>>> list_display = ('startDate','endDate','title'**,'active',)
>>> list_filter = ('startDate',)
>>> date_heiarchy = ['startDate','endDate']
>>> search_fields = ['title','blurb','message']
>>> admin.site.register(event,**eventAdmin)
>>>
>>>
>>> *when i try to syncdb, i'm getting the following error:*
>>>
>>> Error: One or more models did not validate:
>>> events.event: 'GalleryId' has a relation with model Gallery, which has
>>> either not been installed or is abstract.
>>>
>>> What am i doing wrong here?
>>>
>>>  --
>>> 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<

Re: quick question: RE model relations

2013-09-02 Thread Andre Terra
As per the current docs[0], you need to provide a dotted path to your model
in the form app.ModelName when defining a ForeignKey.

So try this instead:

GalleryId = models.ForeignKey('galleryview.Gallery',
verbose_name=_('Gallery Id'), related_name='Gallery_Id',blank=True,
null=True, help_text=_("You can associate a photo gallery to this event
here."))

If you don't mind me saying, 'galleryview' is a funny name for a django
module, considering how we use the name 'view' for something else entirely.


Cheers,
AT

[0] https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey


On Mon, Sep 2, 2013 at 1:24 PM, Bobby Roberts  wrote:

> I'm creating an event module and want people to be able to associate a
> picture gallery with the event:
>
>
>
> from django.utils.translation import get_language, ugettext, ugettext_lazy
> as _
> from django.contrib import admin
> from django.db import models
> from django.contrib.auth.models import User
> from tinymce import models as tinymce_models
> from galleryview.models import Gallery
>
> active_choices=(
> (1,"Yes"),
> (0,"No"),
> )
>
> class event (models.Model):
> id = models.AutoField (primary_key=True)
> active = models.IntegerField(blank=False, choices=active_choices)
> title = models.CharField(blank=False,max_length=150)
> startDate = models.DateTimeField (blank=False,db_index=True)
> endDate = models.DateTimeField (blank=False,db_index=True)
> blurb = models.TextField (blank=False,
> max_length=175,help_text="limit to a sentence, 175 chars.")
> message = models.TextField (blank=False, max_length=2000)
> GalleryId = models.ForeignKey('Gallery', verbose_name=_('Gallery
> Id'), related_name='Gallery_Id',blank=True, null=True, help_text=_("You can
> associate a photo gallery to this event here."))
>
> class eventAdmin(admin.ModelAdmin):
> list_display = ('startDate','endDate','title','active',)
> list_filter = ('startDate',)
> date_heiarchy = ['startDate','endDate']
> search_fields = ['title','blurb','message']
> admin.site.register(event,eventAdmin)
>
>
> *when i try to syncdb, i'm getting the following error:*
>
> Error: One or more models did not validate:
> events.event: 'GalleryId' has a relation with model Gallery, which has
> either not been installed or is abstract.
>
> What am i doing wrong here?
>
>  --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: I really about to give up Django

2013-09-02 Thread Andre Terra
*Non sequitur*.

Obscure variable names can happen regardless of the coder's language
choice, and most definitely do not encourge the use of one's native tongue.
As others have said in the thread, if you're writing *in English* to ask
for help, you should probably code in English as well.

It's not a stretch to say that the English-speaking community of django
developers is much larger than that which speaks any other language, so
it's all about trying to help yourself.


Cheers.


On Fri, Aug 30, 2013 at 10:23 PM, Dan Gentry  wrote:

>
> Just my opinion, but I see no reason to use English names in models.  Use
> whatever you wish.  English speaking programmers have been using cryptic
> variable names for decades.
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: JSON or YAML?

2013-08-30 Thread Andre Terra
It depends on where your data is coming from. YAML has less cruft in it, so
if you're writing your own serializer you can consider it to have an
advantage over JSON.

OTOH, many applications can already export to JSON, so you can leverage
that if that's the case.

Finally, If you're writing anything by hand, YAML is much faster.


Cheers,
AT


On Fri, Aug 30, 2013 at 4:55 PM, Rich Haase  wrote:

> Personal preference.  Python has excellent libraries to support parsing
> both JSON and YAML.
>
> Sent from my iPhone
>
> On Aug 30, 2013, at 7:34 AM, Floor Tile  wrote:
>
> Helle everybody,
>
> Just a short and simple question:
>
> It seams that both JSON and YAML can be used for initial data loading.
> (among other data types but I don't care about them for the moment)
> But can't figure out what the up and/or downsides of them are.
> Is it purely a matter of personal preference or there one better to use
> than the other for initial data loading. And which one would be the most
> preferred, if this is the case?
>
> Many 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.
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Andre Terra
On Mon, Aug 26, 2013 at 1:19 PM, Natko Perko  wrote:

> @laurent i guess it worked, but now i get the error no module named
> wikicamp.wiki.. this is all the code i have so far..


make sure the folder containing wikicamp is inside your PATH so you don't
get import errors. make sure there's an __init__.py inside it.

perhaps you could debug the import error like this:

$ ./manage.py shell
>>> import sys
>>> print '\n'.join(sys.path)
>>> import wikicamp
>>> from wikicamp import wiki


In the future, please post an entire traceback along with your question.

Cheers,
AT

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


Re: I really about to give up Django

2013-08-22 Thread Andre Terra
For the record, it's considered a good coding practice to keep everything
in English, including classes, functions and variables. This way it's
easier for people to help you.

Secondly, your Filhos model should really just be Filho.

Finally, don't use obscure names like Brinq. Instead, prefer the verbose
'Brinquedo'.

So I suggest renaming things like this:

Pai -> Parent
Brinq -> Toy
Filhos -> Child

and so forth.


Cheers,
AT


On Thu, Aug 22, 2013 at 1:38 PM, Mark Furbee  wrote:

> Try dropping the .value from referencia. Like {{
> form.instance.idproduto.idmercadoria.referencia }}. Does this work?
>
>
> On Thu, Aug 22, 2013 at 9:35 AM, Fellipe Henrique wrote:
>
>> I tried again.. and work if I have just 1 FK, if I have more then one,
>> doesn't work, like this:
>>
>> I have this models:
>> Itens -> produto -> mercadoria
>>
>> itens:
>>   idproduto = FK (produto)
>> produto:
>>   idmercadoria = FK(mercadoria)
>> mercadoria:
>>   referencia = Char
>>
>> I try to get "referencia" field, as you told:
>>
>> {{ form.instance.idproduto.idmercadoria.referencia.value }}
>>
>> doesn't work.. what I miss?
>>
>> Here is my complete models, forms and view: http://pastebin.com/w2TmyLzt
>>
>>  Cheers,
>>
>>
>> Em quinta-feira, 22 de agosto de 2013 13h24min31s UTC-3, Fellipe Henrique
>> escreveu:
>>
>>> Ok, I read that, but the problem persist.. I try to use as you told, but
>>> nothing show... and no errors appears..
>>>
>>> Sorry about my first line.. I just stop here, simple problem, in more
>>> then 1 day, and I don't find any solution, anything on internet to...
>>>
>>> Cheers
>>> Fellipe
>>>
>>>
  --
>> 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.
>> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: connecting to MS SQL server in addition to default MySQL

2013-08-07 Thread Andre Terra
You can use django-mssql[0] as a backend, and then either use the ORM as
usual, write RAW queries with Django[1] or just use SQL directly[2].


Cheers,
AT

[0] http://django-mssql.readthedocs.org/en/latest/
[1] https://docs.djangoproject.com/en/dev/topics/db/sql/
[2]
https://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly


On Wed, Aug 7, 2013 at 2:42 PM, Larry Martell wrote:

> I have a django app that connects to a MySQL server in the usual way.
> I've noe been asked to add some new functionality that requires that I
> pull data from a MS SQL server database running on a Windows box. I
> don't want to use the django ORM with the db, just access it directly
> with some sql in my python code. What's the best way to accomplish
> this?
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Impossible? Django with NTLM SSO auth on windows?

2013-07-31 Thread Andre Terra
On Sun, Jul 7, 2013 at 5:01 PM, Yves Rausch  wrote:

> Hello guys,
>
> we had a similar issue and created a new module on apache 2.4 where you
> can use ntlm authentication on a windows machine.
> Here is the binary download and some information (including a link to
> github repository): http://www.informer.de/produkte/apache-sspi-ntlm/
> Hope this helps.
>

Excellent news! Congratulations on the achievement and thank you so much
for sharing this with us!


Best wishes,
AT

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




Re: Django Dashboard

2013-07-30 Thread Andre Terra
On Tue, Jul 30, 2013 at 3:16 PM, Charly Román  wrote:

>
> You can try with pydashie, a python port of ruby version:
> https://github.com/evolvedlight/pydashie



Except that's Flask, not Django.


Cheers,
AT

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




Re: Is Celery the best option?

2013-07-19 Thread Andre Terra
I had never heard about Rq before, seems interesting indeed! Thanks for the
recommendation.


Cheers,
AT


On Fri, Jul 19, 2013 at 4:04 PM, Doug Ballance  wrote:

> Celery is a good option, and probably the most used.   There are a couple
> of other options that may be worth looking into:
>
> Huey
> https://github.com/coleifer/huey
>
> Rq
> http://python-rq.org/
>
> Personally I've never gotten on well with celery.  It's just not at all
> intuitive to me (it's heavy use of decorators).  Rq was a better fit.
>
>  --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: rich text editor

2013-07-18 Thread Andre Terra
You're welcome! We're here to help. Glad to be of service.


Cheers,
AT

On Thu, Jul 18, 2013 at 3:59 PM, Kakar Arunachal Service <
kakararunachalserv...@gmail.com> wrote:

> Thank you so much!!! I will try it for sure! Thanks again!
>
>
> On Fri, Jul 19, 2013 at 12:15 AM, Andre Terra <andrete...@gmail.com>wrote:
>
>> It seems you are asking two completely unrelated questions:
>> 1. to allow users to add some form of tags into their code for richer
>> submissions.
>> 2. to have a different css for each user
>>
>> One possible answer to #1 is BBCode, as I described. Question #2 is
>> something altogether. Do you want each user message to appear differently?
>> Is that supposed to be customizable to the degree of css? Are you just
>> switching colors? How much are you going to let the user style their
>> messages? BBcode should be anough to allow them to add bold, italics,
>> links, pictures, etc. If you just want that, there's no need to have a
>> separate css for each user. Instead, just follow my instructions below.
>>
>> I'm not sure how django-bbcode styles the rendered text, but my
>> step-by-step investigation would be:
>>
>> 1. Install django-bbcode
>> 2. Make sure you have a view somewhere with an input and go to that URL.
>> This would possibly be a very simple view with a textarea where you'd type
>> something in and see the rendered output.
>> 3. Send the textarea back to the template in a variable (called, say,
>> stuff) and render it with {% bbcode stuff %} in the template.
>> 4. Use firebug, google chrome's inspector/developer tools to inspect the
>> css that's applied to the rendered text
>> 5. Make changes to yourcurrentcssfile.css to include styling for the
>> BBCode.
>> 6. GOTO 2
>> 7. ???
>> 8. Profit!!!
>>
>> I hope I understood your question well enough. Good luck!
>>
>> Cheers,
>> AT
>>
>> On Thu, Jul 18, 2013 at 2:56 PM, Kakar Arunachal Service <
>> kakararunachalserv...@gmail.com> wrote:
>>
>>> Thanks a lot! Was waiting for an answer. Just one more question though,
>>> I didnt understood much in the link you gave me. Its that, suppose I
>>> included it where users can post, will each post require another css, or
>>> something else. Please explain.
>>>  Liked "Impossible is nothing™"
>>>
>>>
>>> On Thu, Jul 18, 2013 at 10:44 PM, Andre Terra <andrete...@gmail.com>wrote:
>>>
>>>> Impossible is nothing™, but I don't see the benefits of combining rich
>>>> text with social networking. Things like BBCode[0] usually offer a better
>>>> trade-off between flexibility/usability/maintenance. Based on a quick
>>>> google search, it seems there are solutions tailored for use with Django
>>>> [1][2]
>>>>
>>>> [0] http://en.wikipedia.org/wiki/BBCode
>>>> [1] https://github.com/marcinn/django-bbcode full solution
>>>> [2] http://djangosnippets.org/snippets/853/ old (0.96!), but should be
>>>> a place to start in case you want to rollout your own.
>>>>
>>>>
>>>>  Cheers,
>>>> AT
>>>>
>>>> On Thu, Jul 18, 2013 at 7:24 AM, Kakar Arunachal Service <
>>>> kakararunachalserv...@gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>> Just a thought, can a rich text editor be integrated to a social
>>>>> networking site. Or should every user have a css each? Its just a thought,
>>>>> was just wondering but would be glad if any of you could advice me how to
>>>>> if its possible.
>>>>> Thank you.
>>>>>
>>>>> --
>>>>> 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.
>>>>> 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 

Re: rich text editor

2013-07-18 Thread Andre Terra
It seems you are asking two completely unrelated questions:
1. to allow users to add some form of tags into their code for richer
submissions.
2. to have a different css for each user

One possible answer to #1 is BBCode, as I described. Question #2 is
something altogether. Do you want each user message to appear differently?
Is that supposed to be customizable to the degree of css? Are you just
switching colors? How much are you going to let the user style their
messages? BBcode should be anough to allow them to add bold, italics,
links, pictures, etc. If you just want that, there's no need to have a
separate css for each user. Instead, just follow my instructions below.

I'm not sure how django-bbcode styles the rendered text, but my
step-by-step investigation would be:

1. Install django-bbcode
2. Make sure you have a view somewhere with an input and go to that URL.
This would possibly be a very simple view with a textarea where you'd type
something in and see the rendered output.
3. Send the textarea back to the template in a variable (called, say,
stuff) and render it with {% bbcode stuff %} in the template.
4. Use firebug, google chrome's inspector/developer tools to inspect the
css that's applied to the rendered text
5. Make changes to yourcurrentcssfile.css to include styling for the BBCode.
6. GOTO 2
7. ???
8. Profit!!!

I hope I understood your question well enough. Good luck!

Cheers,
AT

On Thu, Jul 18, 2013 at 2:56 PM, Kakar Arunachal Service <
kakararunachalserv...@gmail.com> wrote:

> Thanks a lot! Was waiting for an answer. Just one more question though, I
> didnt understood much in the link you gave me. Its that, suppose I included
> it where users can post, will each post require another css, or something
> else. Please explain.
>  Liked "Impossible is nothing™"
>
>
> On Thu, Jul 18, 2013 at 10:44 PM, Andre Terra <andrete...@gmail.com>wrote:
>
>> Impossible is nothing™, but I don't see the benefits of combining rich
>> text with social networking. Things like BBCode[0] usually offer a better
>> trade-off between flexibility/usability/maintenance. Based on a quick
>> google search, it seems there are solutions tailored for use with Django
>> [1][2]
>>
>> [0] http://en.wikipedia.org/wiki/BBCode
>> [1] https://github.com/marcinn/django-bbcode full solution
>> [2] http://djangosnippets.org/snippets/853/ old (0.96!), but should be a
>> place to start in case you want to rollout your own.
>>
>>
>>  Cheers,
>> AT
>>
>> On Thu, Jul 18, 2013 at 7:24 AM, Kakar Arunachal Service <
>> kakararunachalserv...@gmail.com> wrote:
>>
>>> Hello,
>>> Just a thought, can a rich text editor be integrated to a social
>>> networking site. Or should every user have a css each? Its just a thought,
>>> was just wondering but would be glad if any of you could advice me how to
>>> if its possible.
>>> Thank you.
>>>
>>> --
>>> 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.
>>> 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.
>> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: rich text editor

2013-07-18 Thread Andre Terra
Impossible is nothing™, but I don't see the benefits of combining rich text
with social networking. Things like BBCode[0] usually offer a better
trade-off between flexibility/usability/maintenance. Based on a quick
google search, it seems there are solutions tailored for use with Django
[1][2]

[0] http://en.wikipedia.org/wiki/BBCode
[1] https://github.com/marcinn/django-bbcode full solution
[2] http://djangosnippets.org/snippets/853/ old (0.96!), but should be a
place to start in case you want to rollout your own.


Cheers,
AT

On Thu, Jul 18, 2013 at 7:24 AM, Kakar Arunachal Service <
kakararunachalserv...@gmail.com> wrote:

> Hello,
> Just a thought, can a rich text editor be integrated to a social
> networking site. Or should every user have a css each? Its just a thought,
> was just wondering but would be glad if any of you could advice me how to
> if its possible.
> Thank you.
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: A PHP framework with some Django features?

2013-06-28 Thread Andre Terra
I've heard good anecdotes about http://laravel.com/...


but I'd never ever leave Django...


Cheers,
AT

On Fri, Jun 28, 2013 at 12:52 PM, Deepak Kumar wrote:

> I have used symfony2 quite a bit and as very rightly said by *Tiago
> Almeida *in the thread below that SonataAdminBundle (in sf2 context)
> serves as very good admin management, till now I am very happy with
> Symfony2.
>
>
> On Friday, June 28, 2013 2:43:38 AM UTC+5:30, thoms wrote:
>>
>> Hello,
>>
>> I have a PHP background, and I'm learning Django.
>> Long story short: I love Django, but some things are really painful to do
>> (configuration, media/static content, etc.).
>>
>> That's why I want to know if there is a PHP framework that has some of
>> Django's really cool features:
>> - Automatically creates the SQL table from the model
>> - Automatically creates an admin
>>
>> Thanks 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Basics

2013-06-14 Thread Andre Terra
You really *should* use a database, even if you use SQLite just for
learning. SQLite saves a .db file to your hard drive, but it's a RDBMS like
many other, albeit in simpler form.

Take a look at the tutorial[1] and if you have any questions, try googling,
asking here or on stackoverflow[2]


Cheers,
AT

[1] https://docs.djangoproject.com/en/dev/intro/tutorial01/
[2] http://www.stackoverflow.com/

On Thu, Jun 13, 2013 at 5:33 PM, Rafael E. Ferrero  wrote:

> you can perfectly do what you require without a database access, just read
> your dictionary on a view on views.py. If you need a database for small
> projects you can do your model on a sqlite database.
>
> you can start with google... are tons of tutorials.  In
> www.djangoproject.com you have a nice beginner tutorial and really deep
> information of all the framework, this is almost the only one manual that i
> read.
>
> cheers
>
>
>
> 2013/6/13 ambi 
>
>> I am totally new to Django framework and to python web project. Do I have
>> to user database for django to work or it can work with the flat files. My
>> requirement is to read values form dictionary and display it on a web page.
>>  My other question is where can i= read more about Django for beginners *
>> *
>>
>> --
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: warnings.warn("The Databrowse contrib app is deprecated", DeprecationWarning)

2013-06-11 Thread Andre Terra
Hi, Snake

The databrowse contrib app has been deprecated since 1.4, but it's still
available as an external library[0].

Please read the release notes for that version to know more about that. [1]


Cheers,
AT


[0] https://pypi.python.org/pypi/django-databrowse
[1]
https://docs.djangoproject.com/en/1.4/releases/1.4/#django-contrib-databrowse


On Tue, Jun 11, 2013 at 6:09 PM,  wrote:

> Hello everyone.
>
> My question is this:
>
> I am currently doing a small system, synchronize just a few changes in my
> models.py, and try to access the browser, and I do not charge it, try
> again with the command: python manage.py syncdb and I get this error:
>
> /
> usr/local/lib/python2.7/site-packages/django/contrib/databrowse/__init__.py:
> 5: DeprecationWarning: The Databrowse contrib app is deprecated
>warnings.warn ("The Databrowse contrib app is deprecated",
> DeprecationWarning)
>
> Creating tables ...
> Installing custom SQL ...
> Installing indexes ...
> Installed 0 object (s) from 0 fixture (s)
>
> I hope can help me try to solve it, 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django with 2 subapps with same name

2013-05-15 Thread Andre Terra
Despite possibly working with different app_labels, I believe the point
still stands that if the storage and invoice apps share a lot of
functionality among vendors, they should just be 'invoice' and 'storage'
and allow for pluggable companies.


Cheers,
AT

On Mon, May 13, 2013 at 12:02 PM, Tom Evans wrote:

> Does it help if they have distinct app_labels?
>
> https://docs.djangoproject.com/en/1.5/ref/models/options/#app-label
>
> Cheers
>

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




Re: Django with 2 subapps with same name

2013-05-10 Thread Andre Terra
Granted this structure doesn't seem reasonable. Each manufacturer shouldn't
be a separate app, but rather "backends" to generic storage or invoice apps.

So you only need
INSTALLED_APPS = (
# ...
'storage',
'invoice'
)

And then work from there. The apps themselves should be able to register
and handle different backends. Take a look at what django-registration[1]
does!

Cheers,
AT

[1]
https://bitbucket.org/ubernostrum/django-registration/src/b3c41b3c7f50523b4ecb8267d6d27a918adc2e1f/registration?at=default

On Fri, May 10, 2013 at 4:43 PM, Valder Gallo  wrote:

> tnx :D
>
>
> On Fri, May 10, 2013 at 4:31 PM, Shawn Milochik wrote:
>
>> It is not possible.
>>
>>
>> https://groups.google.com/forum/#!msg/django-users/AMYLfQo6Ba4/Y-57B0i7qy4J
>>
>> --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Valder Gallo
> +55 11 9949 2911
> +55 11 2532 2911
> Skype: valdergallo
> @valdergallo
> www.valdergallo.com.br
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Dynamic forms and related models.

2013-05-09 Thread Andre Terra
On Wed, May 8, 2013 at 6:43 PM, noodlygod  wrote:

> 
> 
> <
> Class Level (Text field)>
>  Definition.objects.filter(category__label='Skill'))> field)>
>  Definition.objects.filter(category__label=Attribute'))>< Attribute score
> (Text field)>
>
> I was on my way to creating a fully custom form in templates but that
> doesn't seem very django-y. I also discovered the queryset component in
> Select fields. I feel like there should be a way to do this and it may be
> simple but I've thought myself into a tangled mess. Any help would be
> appreciated. Thanks!
>

Isn't a ModelChoiceField[0] what you need? Just customize the queryset
attribute to restrict the available choices. My django-fu is a little
rusty, but IIRC you can define fields at runtime by subclassing __init__
and extending self.fields, which is a dict.


Cheers,
AT

[0] https://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Admin pagination not digg-style

2013-04-24 Thread Andre Terra
Override the default template and add a for loop with {%
forloop.counter %}'s from 0 to max-pages or whatever the variable is
called.

Assuming you're talking about the change form, please see this:
http://stackoverflow.com/a/3729995/447485

Otherwise you can still probably work from the info provided there.



Cheers,
AT

On Mon, Apr 22, 2013 at 6:26 PM, Stanislav Mihaylov
wrote:

> I can't seem to find an easy and simple way to make the Django admin
> paginator display all page numbers rather then displaying them in 'Digg'
> style in the footer navigation.
>
> I read plenty of articles on how to make it Digg style, but it seems in
> the new Django versions it is Digg style by default, so how can I make it
> display all numbers?
>
> Thank you 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Navigation Bar

2013-03-27 Thread Andre Terra
In my last project I created a template tag that would take an app name as
an argument and build the links according to that user's permissions for
the links in that app. This made the template easier to read at the cost of
having to write the function and learning how it worked. Since I was the
only one in the project, I didn't have to worry too much about that, so it
was just a matter of using {% menu 'profiles' %} and {% menu 'blog' %}, for
example.

I don't know if this is design pattern is The Right Way (TM), but It Just
Works (TM).

You can find documentation on writing custom tags here:
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/


Cheers,
AT

On Wed, Mar 27, 2013 at 11:16 AM, Venkatraman S  wrote:

>
> On Wed, Mar 27, 2013 at 5:55 PM, Simon Shaw wrote:
>
>> I am Django/Web newbie developer and I am looking for the correct way to
>> add a navigation bar (hopefully the correct term) to my ticketing app such
>> that the options "Admin", "Open New Ticket", "View New Ticket",
>> "Dashboard", "Logout" will always appear at the top of the page and that
>> the page where the user is currently located will be highlighted.  Ideally,
>> for users that are not logged in as Admin I would prefer not to show the
>> admin option, should this not be possible I would like the admin option to
>> be grayed out.
>>
>
>
> django-tabs
>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Is file based cache is safe for concurrent process?

2013-03-26 Thread Andre Terra
safe or not, it is slow. why not use redis?

On Tue, Mar 26, 2013 at 9:57 PM, Ivan Smirnoff  wrote:

> Hi all.
> Can anyone tell, does django.cache locks file for writing by concurrent
> process?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using values_list and extra on same queryset

2013-03-26 Thread Andre Terra
Could you provide us any examples or code at all?


Cheers,
AT

On Tue, Mar 26, 2013 at 7:51 PM, Larry Martell wrote:

> I have some existing code that calls values_list on a queryset. I need
> to add something using extra to this queryset. If I call extra before
> values_list the extra stuff is gone from the query after the
> values_list. If I call extra after the call to values_list it seems to
> have to effect - the extra stuff is not in the query. Is there some
> way to use both values_list and extra on same queryset?
>
> --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread Andre Terra
This is a much better explanation on the use of *args and **keywordargs
(**kwargs)

http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/

On Thu, Mar 14, 2013 at 6:22 PM, Andre Terra <andrete...@gmail.com> wrote:

> About the asterisks, please checkout this link:
>
> http://stackoverflow.com/questions/4306574/python-method-function-arguments-starting-with-asterisk-and-dual-asterisk
>
> the difference between dict['key'] and dict.get('key', 'something') is
> that the second doesn't raise a KeyError exception when 'key' isn't in the
> dict; instead, it returns 'something'. this allows for shorter code. please
> compare:
>
> try:
> max_retries = config['max_retries']
> except KeyError:
> max_retries = 10
>
> versus
>
> max_retries = config.get('max_retries', 10)
>
>
>
> Cheers,
> AT
>
>
> On Thu, Mar 14, 2013 at 6:17 PM, lamen <lamenra...@gmail.com> wrote:
>
>> Hello,
>>
>> Not sure what the difference is in the usage of attrs
>> I could not find the documentation for this although I'm sure it's going
>> to be obvious after the fact.
>>
>> Also, could someone tell me what the double asterisks mean in the line
>> return Comment(**attrs)
>> ?
>>
>> Is this some type of variable length parameter list?  How would
>>
>> return Comment(*attrs)
>>
>> and
>>
>>  return Comment(attrs)
>>  vs
>>
>> be different?
>>
>> Thank you!
>>
>> class CommentSerializer(serializers.Serializer):
>> email = serializers.EmailField()
>> content = serializers.CharField(max_length=200)
>> created = serializers.DateTimeField()
>>
>> def restore_object(self, attrs, instance=None):
>> if instance is not None:
>> instance.title = attrs['title']
>> instance.content = attrs['content']
>> instance.created = attrs['created']
>> return instance
>> return Comment(**attrs)
>>
>>  --
>> 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread Andre Terra
About the asterisks, please checkout this link:
http://stackoverflow.com/questions/4306574/python-method-function-arguments-starting-with-asterisk-and-dual-asterisk

the difference between dict['key'] and dict.get('key', 'something') is that
the second doesn't raise a KeyError exception when 'key' isn't in the dict;
instead, it returns 'something'. this allows for shorter code. please
compare:

try:
max_retries = config['max_retries']
except KeyError:
max_retries = 10

versus

max_retries = config.get('max_retries', 10)



Cheers,
AT


On Thu, Mar 14, 2013 at 6:17 PM, lamen  wrote:

> Hello,
>
> Not sure what the difference is in the usage of attrs
> I could not find the documentation for this although I'm sure it's going
> to be obvious after the fact.
>
> Also, could someone tell me what the double asterisks mean in the line
> return Comment(**attrs)
> ?
>
> Is this some type of variable length parameter list?  How would
>
> return Comment(*attrs)
>
> and
>
>  return Comment(attrs)
>  vs
>
> be different?
>
> Thank you!
>
> class CommentSerializer(serializers.Serializer):
> email = serializers.EmailField()
> content = serializers.CharField(max_length=200)
> created = serializers.DateTimeField()
>
> def restore_object(self, attrs, instance=None):
> if instance is not None:
> instance.title = attrs['title']
> instance.content = attrs['content']
> instance.created = attrs['created']
> return instance
> return Comment(**attrs)
>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Impossible? Django with NTLM SSO auth on windows?

2013-03-04 Thread Andre Terra
FYI, I found a nginx module for Kerberos authentication too:
https://github.com/fintler/nginx-mod-auth-kerb
http://michaelshadle.com/2010/01/17/spnego-for-nginx-a-start-at-least

It hasn't been updated in quite some time, but it is apparenlty working and
perhaps one of you will feel like taking a swing at it.


Cheers,
AT

On Mon, Mar 4, 2013 at 6:24 PM, Avraham Serour  wrote:

> Hi,
>
> Does anyone think using ntlm instead of/on top of oauth/social logins.
> Ideally this could be given as another choice of login/authentication on
> top of oauth options, this would be a solution to the user not having to
> remember yet another password. does linux have anything like that?
>
> would this be practical, has anyone thought of this?
>
> avraham
>
>
> On Mon, Mar 4, 2013 at 11:19 PM, Anton  wrote:
>
>> @Branko,
>>
>> no...I didn't think about Kerberos, I only realised
>> in the last day that Ad use this system which I don't know either)
>>
>> Do you know some tutorial/howto describing this SSO
>>
>> with Django/apache on windows?
>>
>> Or I am the only one on this planet with this ides?
>>
>> Thanks
>>
>>   Anton
>>
>> Branko Majic wrote:
>>
>> > On Mon, 25 Feb 2013 21:06:33 +0100
>> > Anton  wrote:
>> >
>> >> Hi,
>> >>
>> >> I am using my django in the following way:
>> >>
>> >> OS: Windows 7 (64 bit)
>> >>
>> >>  + Python 2.7.3 (32bit)
>> >>
>> >>  + apache 2.4.3 (32 bit) from apachelounge
>> >>(I use the version which was build with vs2008 like python 2.7.3)
>> >> http://www.apachelounge.com/download/win32/binaries/httpd-2.4.3-
>> win32-
>> >> VC9.zip
>> >>
>> >>  + django 1.4.5
>> >>
>> >>  + mod_wsgi 3.4 (32 bit) from http://code.google.com/p/modwsgi/
>> >>(compiled manually with vs2008 since no binaries available)
>> >>
>> >> I would like to use the typical Windows intranet scenario
>> >> where you have a single-sign-on with the internet explorer.
>> >>
>> >> At least in our company the ASP .NET powered intranet sites
>> >> work fine with this.
>> >>
>> >> I googled around, as if I understood right, this auth system
>> >> is called NTLM and if you want to use it, you need
>> >> the apache module "mod-auth-sspi".
>> >>
>> >> If I look at the project page
>> >> http://sourceforge.net/projects/mod-auth-sspi/?source=dlp
>> >> I see only stuff dated from 2011 and only for *apache 2.2*.
>> >>
>> >> And if I read this article on apachelounge:
>> >>
>> >> http://www.apachelounge.com/viewtopic.php?t=4548
>> >>
>> >> then there will be *never* a support for Apache 2.4.
>> >>
>> >> In the Django docs:
>> >> "Authentication using REMOTE_USER"
>> >> https://docs.djangoproject.com/en/1.4/howto/auth-remote-user/
>> >>
>> >> you get links to mod_auth_sspi but its has be forgotten to mention
>> >> that this module (seems) now obsolete.
>> >>
>> >> So the question is:
>> >>
>> >> Is it possible to obtain SSO with Django on a Windows powered machine,
>> >> or do I have to give up and try my luck with ASP.NET or perhaps php
>> >> for windows or whatever.
>> >>
>> >> I love Django & python, but I am here in a dead end.
>> >>
>> >> Is there somebody using this scenarion (which is quit common in big
>> >> companies)?
>> >>
>> >> Thanks.
>> >> Anton
>> >>
>> >
>> > Hm... Did you maybe think about using Kerberos part of the AD for
>> > authentication instead?
>> >
>> > Best regards
>> >
>>
>>
>> --
>> 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?hl=en.
>> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Andre Terra
Please post traceback, settings.py, etc.

On Fri, Feb 8, 2013 at 5:18 AM, Some Developer wrote:

> I have a model for a Tag object with simply has two fields. A title (which
> has the unique constraint) and a description. I also have a FormView based
> view class which handles the creation of Tag objects.
>
> When I try and save the object in the form_valid() method I always get an
> IntegrityError stating that the title column is not unique. This is
> somewhat puzzling as I have deleted the SQLite database file and recreated
> it using syncdb / migrate so it is completely empty.
>
> I'm completely baffled by this error.
>
> --
> 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+unsubscribe@**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?hl=en
> .
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Kindly help for an interview with Google on python django

2013-01-31 Thread Andre Terra
I don't have any experience in interviews for developer positions, but I
have general job interview tips that you might like.

First, get to know your resumé. This is my #1 advice. Interviewers usually
want to know why you made your decisions. What was the reason behind
picking this or that school? Why did you apply to your last job? And why
did you want to leave the company before that? Basically, anything on your
resumé is fair game, and while you may not have made completely rational
choices at all times (we were all 18 at one point), your story should be
consistent.

Secondly, get to know yourself. Know what motivates you, why you want to
apply for this position (this is **paramount**) and what your expectations
are coming into the new job. Do you admire the company values, mission, or
goals? As a developer, not a consumer, how are you going to keep yourself
motivated after the honeymoon months in the new job? Are you able to work
in a fast-paced environment? What values do you consider especially
important so that you will strive to uphold while at Google? Innovation?
Transparency? Collaboration? None?

Finally, in order for you to be hired the interviewer should be able to
conclude you a) can add to the team and organization in general; b) are
able to actively engage yourself in order to perform at an excellent level
throughout your stay at the company; and c) Google specifically and this
position in particular are the best match to your ambitions at this point
in life, which is why you are



Cheers,
AT

On Thu, Jan 31, 2013 at 1:15 PM, laxmikant ratnaparkhi
wrote:

> Hello Everybody,
>   I have an interview scheduled on monday with google. So can you
> anybody have an related information  or any experience. Please help me what
> would be asked for this interview.
>  I have 2 years of exp in python and django.
>
> Thanks in advance!!!
>
> regards,
>
> Laxmikant
>
> --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django support for ms SQL

2013-01-31 Thread Andre Terra
http://django-mssql.readthedocs.org/en/latest/


Cheers,
AT

On Thu, Jan 31, 2013 at 11:34 AM,  wrote:

> is there any support for MS SQL ?
>
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Long url parameter in GET request locks python

2013-01-30 Thread Andre Terra
I posted this answer on SO and thought I should share it here for the
benefit of other and future readers:

--

 The accepted answer is spot on about the regex, but since we're discussing
optimization, I thought I should note that the code for checking whether a
project exists could be modified to generate a much quicker query,
especially in other contexts where you could be counting millions of rows
needlessly. Call this 'best practices' advice, if you will.

p = Project.objects.filter(projectName__exact = aProjectName).count()if p > 0:

 could instead be

if Project.objects.filter(project_name__iexact=aProjectName).exists():

 for two reasons.

First, you're not using p for anything so there's no need to store it as a
variable as it increases readability and p is an obscure variable name and the
best code is no code at
all
.

Secondly, by This way we only ask for a single row instead of saving the
results to the queryset cache. Please see the official Queryset API
docs
, a related question on Stack
Overflow
 and the discussion about the latter on the django-developers
group
.

Additionally, it is customary in python (and Django, naturally) to name
your fields lower_cased_separated_by_underscores. Please see more about
this on the Python Style Guide (PEP 8)
.

--

Cheers,
AT



On Wed, Jan 30, 2013 at 4:07 PM, Shawn H  wrote:

> Indeed it was.  As Alisdair posted, simplify the regex and validate
> elsewhere.  Thanks.
>
> On Wednesday, January 30, 2013 11:26:51 AM UTC-6, fgallina wrote:
>>
>> 2013/1/30 Shawn H :
>> > I posted this question yesterdat at stack overflow, but I'm wondering
>> if
>> > this is a bug.  I have a url that accepts one text parameter, allows
>> spaces,
>> > and calls a very simple view that checks if there are objects with a
>> project
>> > name that matches the text parameter value. The view returns a simple
>> json
>> > string indicating whether there's a project with that name already in
>> the
>> > database.  It works great, repeatedly, with short parameter values.  It
>> > locks up python on certain long string values.  I've tested up to 50
>> > characters, and just length doesn't trigger it.  What does seem to
>> > repeatedly trigger it are long strings with multiple spaces.  I've
>> tested my
>> > url regex matching and those long strings match just fine; my concern
>> is
>> > that for some reason inside the view that long string is causing
>> problems.
>> > I'm using Django 1.4 with the built in webserver for testing.  Any help
>> that
>> > can be provided will be greatly appreciated.
>> >
>>
>> I have a strong feeling it is related on how your regexp matches the
>> passed string, I don't know why in the world you would sanitize the
>> project's name directly in the url and not the view, in any case if
>> the user happen to enter garbage then filter will not find anything,
>> right? Also this seems a job for a GET parameter rather than a view
>> param, but YMMV.
>>
>>
>> Regards,
>> --
>> Fabián E. Gallina
>> http://www.from-the-cloud.com
>>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Return SQL calculation within queryset

2012-07-25 Thread Andre Terra
Please read the following bits of documentation:

https://docs.djangoproject.com/en/dev/topics/db/sql/#performing-raw-sql-queries
https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.extra



Cheers,
AT

On Tue, Jul 24, 2012 at 9:03 PM, jondbaker wrote:

> I've implemented the spherical law of cosines to aid in proximity-based
> searching. Everything works correctly, but I'm a bit stumped as to how I
> can return the calculated distance for a record given that it's not a field
> in the model. In the Model Manager below, row[1] represents the dynamically
> calculated distance, but I need to find a way to "attach" each calculation
> to it's corresponding record so that I can print the distance in a template.
>
> class LocationManager(models.Manager):
> '''
> '''
> def nearby_locations(self, latitude, longitude, radius):
> '''
> '''
> cursor = connection.cursor()
> if settings.DATABASES['default']['ENGINE'] ==
> 'django.db.backends.sqlite3':
> # sqlite doesn't natively support math functions, so add them
> connection.connection.create_function('acos', 1, math.acos)
> connection.connection.create_function('cos', 1, math.cos)
> connection.connection.create_function('radians', 1,
> math.radians)
> connection.connection.create_function('sin', 1, math.sin)
>
> sql = """SELECT id, (3959 * acos(cos(radians(%f)) *
>   cos(radians(latitude)) * cos(radians(longitude) -
> radians(%f)) +
>   sin(radians(%f)) * sin(radians(latitude
>   AS distance FROM locations_location
>   GROUP BY id HAVING distance < %d
>   ORDER BY distance ASC""" % (latitude, longitude, latitude,
>   int(radius))
> cursor.execute(sql)
> data = [(row[0], row[1]) for row in cursor.fetchall()]
> ids = [i[0] for i in data]
> return self.filter(id__in=ids)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/pfZSZB1nLVIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Hierarchy Model

2012-07-15 Thread Andre Terra
I recommend using django-mptt. I can't link to it cause I'm writing on my
phone, but it's easy to find it on Google.

Also, your foreign key should target self rather than Employee, IIRC.

Cheers,
AT

-- Sent from my phone, please excuse any typos. --
On Jul 15, 2012 11:02 AM, "Setiaman Lee"  wrote:

> Hi,
>
> I want to implement hierarchy data model which is quite common in
> Relational Data Model.
>
> Let's say I have Employee model which has the relation to the boss which
> link to the employee model itself.
> It will look like this:
>
> class Employee(models.Model):
> empname = models.CharField(max_length=60)
> boss = models.ForeignKey(Employee)
> salary = models.integer()
>
>
> Sample Data:
>
> IDempname  bosssalary
> --
> 1  albertnull  1
> 2  bert  1  5000
> 3  Chuck  1  5000
> 4  Donna  3  3000
> 5  Jack3  2000
>
> Albert is the root with Bert and Chuck under him and Chuck has Donna and
> Jack under him.
>
> I got an error when I tried to sync to the database where Django telling
> me that the employee is not exist in the Foreign key part.
> Is there any way to manipulate this situation?
>
> Cheers,
> Setiaman
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Hierarchy Model

2012-07-15 Thread Andre Terra
-- Sent from my phone, please excuse any typos. --
On Jul 15, 2012 11:02 AM, "Setiaman Lee"  wrote:

> Hi,
>
> I want to implement hierarchy data model which is quite common in
> Relational Data Model.
>
> Let's say I have Employee model which has the relation to the boss which
> link to the employee model itself.
> It will look like this:
>
> class Employee(models.Model):
> empname = models.CharField(max_length=60)
> boss = models.ForeignKey(Employee)
> salary = models.integer()
>
>
> Sample Data:
>
> IDempname  bosssalary
> --
> 1  albertnull  1
> 2  bert  1  5000
> 3  Chuck  1  5000
> 4  Donna  3  3000
> 5  Jack3  2000
>
> Albert is the root with Bert and Chuck under him and Chuck has Donna and
> Jack under him.
>
> I got an error when I tried to sync to the database where Django telling
> me that the employee is not exist in the Foreign key part.
> Is there any way to manipulate this situation?
>
> Cheers,
> Setiaman
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: from future url -- argh

2012-06-14 Thread Andre Terra
Ah, here it is:

https://docs.djangoproject.com/en/dev/internals/deprecation/#id2


Cheers,
AT

On Thu, Jun 14, 2012 at 8:54 PM, Andre Terra <andrete...@gmail.com> wrote:

> I was having the same problem, but with the development version (that is,
> 1.4+, or soon to be 1.5).
>
> Just remove the {% load url from future %} because the future is NOW! :O
>
> The old {% url %} tag has apparently been deprecated, but I can't find any
> notes on this change after 2 mins of googling.
>
> Let me know how it goes.
>
>
> Cheers,
> AT
>
>
> On Thu, Jun 14, 2012 at 4:00 PM, JeffH <je...@delasco.com> wrote:
>
>> django 1.4
>>
>> topapp
>>   urls.py
>> ...
>> url(r'^shows/', include('shows.urls')),
>>   template
>> base.html
>> ... {% url shows.views.customers %}
>>
>> shows
>>   urls.py
>> ..
>> url(r'^customers/$', 'shows.views.customers')
>>
>> The above works just fine -- everything is happy except for the
>> deprecation warning in debug mode.
>>
>> So I modify base.html  and add {% load url from future %}  to the top,
>> and then put single quotes around the argument {% url
>> 'shows.views.customers' %} and django goes Boom!
>> "django.core.urlresolvers.NoReverseMatch -- NoReverseMatch: Reverse for
>> '' with arguments '()' and keyword arguments '{}' not found."
>>
>> I've become dizzy trying the different methods specified in the docs
>> including setting a name= attr in the shows/urls.py
>> url(r'^customers/$', 'shows.views.customers', name='fido')
>> {% url 'fido' %}
>>
>> and I get the same message.  Other variations tried:
>> {% url 'shows_views.customers' %}  - same error
>>
>> If someone can help me out,I'd appreciate it.
>>
>> Best,
>>
>> Jeff
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/x4uqjgipT9YJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

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



Re: from future url -- argh

2012-06-14 Thread Andre Terra
I was having the same problem, but with the development version (that is,
1.4+, or soon to be 1.5).

Just remove the {% load url from future %} because the future is NOW! :O

The old {% url %} tag has apparently been deprecated, but I can't find any
notes on this change after 2 mins of googling.

Let me know how it goes.


Cheers,
AT

On Thu, Jun 14, 2012 at 4:00 PM, JeffH  wrote:

> django 1.4
>
> topapp
>   urls.py
> ...
> url(r'^shows/', include('shows.urls')),
>   template
> base.html
> ... {% url shows.views.customers %}
>
> shows
>   urls.py
> ..
> url(r'^customers/$', 'shows.views.customers')
>
> The above works just fine -- everything is happy except for the
> deprecation warning in debug mode.
>
> So I modify base.html  and add {% load url from future %}  to the top, and
> then put single quotes around the argument {% url 'shows.views.customers'
> %} and django goes Boom!
> "django.core.urlresolvers.NoReverseMatch -- NoReverseMatch: Reverse for
> '' with arguments '()' and keyword arguments '{}' not found."
>
> I've become dizzy trying the different methods specified in the docs
> including setting a name= attr in the shows/urls.py
> url(r'^customers/$', 'shows.views.customers', name='fido')
> {% url 'fido' %}
>
> and I get the same message.  Other variations tried:
> {% url 'shows_views.customers' %}  - same error
>
> If someone can help me out,I'd appreciate it.
>
> Best,
>
> Jeff
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/x4uqjgipT9YJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Filter by today

2012-06-12 Thread Andre Terra
You're missing result in your queries because your timestamp DateTimeField
includes time information (otherwise it would be a DateField).

Cheers,
AT

-- Sent from my phone, please excuse any typos. --
On Jun 12, 2012 7:55 AM, "Simon Pickles"  wrote:

>  Hi, if my model has a timestamp field,
>
> class Attempt(models.Model):
> timestamp = models.DateTimeField('Timestamp')
>
> How would I query to get entries from today? I tried:
>
> result = Attempt.objects.filter(timestamp = date.today())
>
> but it always says DoesNotExist (I can see entry in table in other ways).
> I think my query is wrong.
>
> Thanks for any help
>
>
> Simon
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: about_dajngo

2012-06-06 Thread Andre Terra
You can also use the Google Chart Tools, if you only need low to moderate
complexity charts.

https://developers.google.com/chart/


Cheers,
AT

On Wed, Jun 6, 2012 at 4:11 AM, Pierre de LESPINAY wrote:

> If you only need to draw HTML charts, I would suggest to use jQPlot
> Le 6 juin 2012 09:06, "kenneth gonsalves"  a
> écrit :
>
>  On Wed, 2012-06-06 at 12:26 +0530, Satvir Toor wrote:
>> > On Wed, Jun 6, 2012 at 10:47 AM, kenneth gonsalves
>> >  wrote:
>> >
>> > > any library that you ordinarily use in your html pages will work.
>> > What are the major uses of numpy and matplotlib libraries in django.
>>
>> django is just python - any python library can be used in a view
>> function to generate data/information which can be passed to a template.
>> You will have to use some js library to render this data in the html
>> page. There are lots of these libraries available - from your question
>> it looks like you are not aware of how django works - I suggest that you
>> do the official tutorial or take a look at how django works with
>> reportlab to create pdfs.
>> --
>> regards
>> Kenneth Gonsalves
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: OpenSource IDE with debugger capabilities of PyCharm

2012-06-01 Thread Andre Terra
"AFAIK" implies "I might be wrong", but.. sure.

Template Debugging threads in django-developers:
https://groups.google.com/forum/?fromgroups#!searchin/django-developers/template$20debugging


Efforts in better template debugging, none included in core:
https://github.com/codysoyland/django-template-repl
https://github.com/t0ster/django-debug-template


And if you were instead referring to my comment that there are threads
aplenty regarding IDEs, then:
https://groups.google.com/forum/?fromgroups#!searchin/django-users/best$20IDE




Sincerely,
André Terra


On Thu, May 31, 2012 at 7:55 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Thu, May 31, 2012 at 6:54 PM, Andre Terra <andrete...@gmail.com> wrote:
> > No IDE recommendations, please!
> >
> > There are many threads regarding that, so please search around, OP.
> >
> > As for template debugging, this is currently a limitation in Django
> itself
> > AFAIK, but efforts are being made to improve the situation.
>
> It is? And there are? That's news to me - can you shed any light on this?
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: OpenSource IDE with debugger capabilities of PyCharm

2012-05-31 Thread Andre Terra
No IDE recommendations, please!

There are many threads regarding that, so please search around, OP.

As for template debugging, this is currently a limitation in Django itself
AFAIK, but efforts are being made to improve the situation.

Sincerely,
Andre Terra

-- Sent from my phone, please excuse any typos. --
On May 31, 2012 4:07 AM, "Houmie" <hou...@gmail.com> wrote:

> Hi,
>
> I have a question to the seasoned Django developers, I am relatively
> new to Django and have been developing on Aptana Studio 3.0 since one
> month.  While I think its a great free product, it seems debugging is
> only limited to url.py and views.py. Beyond that there is no way to
> set a break point in a template.
>
> I just watched a video of pycharm and it seems pycharm is able to do
> it.
>
> I was wondering if I have setup Aptana incorrectly, and it would
> support template debugging as well.
>
> Otherwise is there any other open source django IDE you would
> recommend that could debug templates?
>
> Many thanks,
> Houman
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Python IDLE

2012-05-28 Thread Andre Terra
For one thing, I don't know of anybody who uses IDLE as their editor for
writing complex code like when developing a website with Django.

You can always type 'python manage.py runserver' instead of just 'manage.py
runserver' to make sure python is the program that's opening your .py file.

It seems like you have a problem with your file associations. To fix this,
go to the registry (Start Menu, Run, regedit) and browse to:

*HKEY_CLASSES_ROOT\Python.File\shell\open\command*

You should have a string there named '(Default') and its value should be
exactly this (including quotes): *"C:\Python26\python.exe" "%1" %**

You could have a different python path depending on your installation (say,
C:\Program Files\Python27), but you get the gist. Don't forget the quotes
and the trailing %*


Cheers,
AT


On Mon, May 28, 2012 at 9:37 AM, coded kid  wrote:

> I'm in a big mess now, I've lost my projects due to this errror. I'm
> on windows, This is how I encounter the problem; I try to edit my
> settings.py in IDLE. After right clicking on the files, I choose open
> program with these default file. I choose idle window bat file, and I
> clicked Ok. It didn't open, I try to run manage.py runserver on my
> DOS. Not working, it will pop up the IDLE Shell and mange.py script by
> displaying it in IDLE. It didn't run the server. The logo of my python
> files have changed. How can I revert it back to open with IDLE? And
> use it as default for my python script?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: GeoIP install failure, advice needed

2012-05-24 Thread Andre Terra
sudo brew link geoip? Total guess, btw.


Cheers,
AT

On Thu, May 24, 2012 at 6:39 PM, DF  wrote:

> Several hours of frustration here and looking to see if anyone has any
> advice.
>
> I'm trying to install GeoIP vie Homebrew and receive the following error
> just prior to the install finishing:
>
> "Error: The linking step did not complete successfully
> The formula built, but is not symlinked into /usr/local
> You can try again using `brew link geoip'"
>
>
> brew link geoip returned this error:
>
> "Error: Could not symlink file:
> /usr/local/Cellar/geoip/1.4.8/etc/GeoIP.conf.default
> /usr/local/etc is not writable. You should change its permissions."
>
>
> I'm not entirely familiar with permissions and such and was wondering what
> I needed to do from the command line to get this to link properly. Any help
> greatly appreciated.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/nmmmuD9eA0gJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: track change

2012-05-23 Thread Andre Terra
Google for Django Audit Log and/or Audit Trail. While some of the packages
might not be under active development, they may be able to point you in the
right direction.

Cheers,
AT

-- Sent from my phone, please excuse any typos. --
On May 23, 2012 5:45 PM, "Carsten Jantzen"  wrote:

> Hi
>
> I am looking for a way to track a skill change for a player in a
> online game.
>
> model:
> Player 1
> skill_x=1
> skill_y=1
>
> During next update I get a change
>
> Player 1
> skill_x=2
> skill_y=1
>
> When I load the player I would like to see his latest stats.
> If I goto the players page I would like to be able to view when and
> what skill changed.
>
> I am looking for a good way to implement it.
> I was thinking to make the skill it's own object and make a one to
> many relation on the player.
> What I am afraid of is that the same skill will show up multiple times
> when loading the player.
>
> Hope to get some input.
>
> /Carsten
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Generic views create_object and prefill form data?

2012-05-23 Thread Andre Terra
For the record, you could go even further (and you may already have), and
make the get_initial part of a WebsiteMixin so that you can reuse it in
other views without having to repeat yourself.


Cheers,
AT

-- Forwarded message --
From: Paul 
Date: Wed, May 23, 2012 at 5:09 PM
Subject: Re: Generic views create_object and prefill form data?
To: Django users 


Solved it by migrating to the class based generic views, then fed
initial form data to the constructor of the form by overloading
get_initial on the view class.
Paul

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

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



Re: Getting Started-Introduction

2012-05-22 Thread Andre Terra
https://docs.djangoproject.com/en/dev/internals/contributing/

On Tue, May 22, 2012 at 11:17 AM, vishrut mehta
wrote:

> Thank you a lo..! But i tld u im a bit new to all this...Can u
> please explain how to solve bugs and submit the patches,means the procedure
> ??I am just new to this...
>
> On Tue, May 22, 2012 at 3:54 PM, kenneth gonsalves  > wrote:
>
>> ...
>>
>

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



Re: import error: no model named .....

2012-05-17 Thread Andre Terra
Everyone, please follow these guidelines before asking other questions:

https://code.djangoproject.com/wiki/UsingTheMailingList



Cheers,
AT

On Thu, May 17, 2012 at 4:14 PM, Tanveer Ali Sha wrote:

> even am getting *page not found* error
>
> 1.^notes/
> the current URL,didnt match any of these
>
>
>
> for that wikicamp example which is available in showmedo.com..
>
> I donno why I getting these error ...??:(
>
>
> On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin wrote:
>
>> You should import models into views.py.
>>
>> For Example;
>>
>> from hdyazi.models import *
>> from hdmakale.models import *
>> from hdsayfalar.models import *
>>
>> My models' names are hdyazi,mdmakale,hdsayfalar ...
>>
>> --
>> *www.halitalptekin.com | Halit Alptekin*
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: New Release of IBM_DB_DJANGO (1.0.4)

2012-05-16 Thread Andre Terra
I don't even use IBM databases, but I just wanted to say thank you and
great job!

I'm always happy to see Django being embraced all across the IT industry
and to see IBM developing and maintaining an part of this great framework
is always heart warming.

Keep up the good work!


Cheers,
AT


On Wed, May 16, 2012 at 7:20 AM, Rahul  wrote:

> IBM_DB_DJANGO-1.0.4
> ---
> IBM_DB_DJANGO adaptor enables access to IBM databases from Django
> applications http://www.djangoproject.com/. The adaptor is developed
> and maintained by IBM.
>
> What's New?
> 
>  - Added support for Django-1.4
>
>  - Backward compatibilty - Same codebase works with older supported
> version of Django
>
>  - Added support to enable Django's USE_TZ feature
>
>  - Added support for Django's bulk_create
>
>  - Added support for 'SELECT FOR UPDATE'
>
>  - Added module version string __version__
>
>
> SVN access to the source
> ---
> http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django/
>
> Installation
> 
> $ easy_install ibm_db_django
>
> Feedback/Suggestions/Issues
> 
> You can provide us feedback/suggestions, or report a bug/defect, or
> ask for help by using any of the following channels:
> 1. Mailing us at open...@us.ibm.com
> 2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
> 3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
> For prerequisites, installation steps and help details, visit -
> http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
> Try this out and let us know you valuable feedback. Have fun.
>
> Cheers,
> Rahul Priyadarshi
>
> Download Express-C for free, go to:
> ---
> -
>
> http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01_TACT=ACDB2011
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: i need to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread Andre Terra
Or just deploy on heroku

http://heroku.com


Cheers,
AT


On Thu, May 10, 2012 at 11:13 AM, eihli  wrote:

> This won't be a complete list but it's what I can remember off the top of
> my head.
> Things to do:
> Install Python
> Install Django
> Install database software (I chose Postgres. I guess you don't need this
> if you are using SQLite3).
> Create database and users and assign permissions.
> Install mod_wsgi.
> Edit your apache httpd.conf file to use mod_wsgi:
> http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
> If you are using apache to serve static html files (like your .css or
> image files) then you'll need to add an Alias to your apache config.
> Something like: Alias /myproject/static/
> /var/www/djangoapps/myproject/media/static
>
> Here are some links I bookmarked while trying to set up a VPS with Django:
>
> http://www.epicserve.com/blog/2011/nov/3/ubuntu-server-setup-guide-django-websites/
>
>
> http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/
>
>
> http://blog.kevin-whitaker.net/post/725558757/running-django-with-postgres-nginx-and-fastcgi-on
>
>
> http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/
>
>
>
>
> On Thursday, 10 May 2012 07:23:11 UTC-5, doniyor wrote:
>>
>> Hi there,
>>
>> i need a small help: i have a django site, which is ready to test. now i
>> talked to a hosting service, they had only php and mysql supporting server,
>> but not django. they gave me a virtual server, where i can install django
>> and put my site there. now i am stuck. i dont know how to install django on
>> server and which python modules to install that run my site and where to
>> install. is there any list of steps to do this kind of job? it would be
>> very helpful. i just dont find a clue where to start. what i understand is:
>> apache is webserver and it is there on server. so i need some module that
>> supports python, right? i decided for mod_wsgi. i dont know why i decided
>> for this. before that i installed easy_install then i installed all python
>> packages including django. now when i log in to server thru Putty including
>> switching to root, i land to: domainname: /www/vhtdocs/domainname # and
>> this folder has some html files of my old site. they just copied from old
>> server to this virtual one. now the question is: is it the place where i
>> can just upload my whole django-site?
>>
>> i would be very thanksful for some instructions..
>>
>> thanks thanks.
>>
>> Doni
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/3jzFFzJ9KoEJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: 1.4 on git

2012-05-07 Thread Andre Terra
add "django==1.4" to a requirements.txt file (no quotes!)
$ pip install -R requirements.txt



On Mon, May 7, 2012 at 1:00 AM, Rivsen  wrote:

> Hi Larry,
>
> I cloned django and django-old from github, and I found the git index of
> yours.
>
> It's in django-old repo, not in django.
>
> So you need clone django-old not django.
>
> git clone git://github.com/django/django-old.git
>
> cd django-old
>
> git checkout -b test -f *6fbf282ac2*
>  *
> *
> git log
>
> commit *6fbf282ac2*b467bd71f807cad45e12a86aa371bd
> Author: claudep 
> Date:   Fri Mar 23 19:44:52 2012 +
>
> Now, The 'test' branch is the same to your system 1.
>
> Best regards,
>
> Rivsen
>
> 2012/5/7 Larry Martell 
>
>> On Sun, May 6, 2012 at 12:54 PM, Ramiro Morales  wrote:
>> > You will need to read the Git documentation because we are in Git
>> territory now.
>> >
>> > )ou got the latest development code by default but remember that when
>> > you clone you get (most of) the development history and it is
>> > available locally.
>> >
>> > You need to get a checkout of the commit pointed to by the '1.4' tag.
>> > IIRC you can achieve that with::
>> >
>> >  git checkout 1.4
>>
>> Ok, Thanks. I'll try that next time. I ended up just scp-ing the
>> django dir from my working system.
>>
>>
>> > On 5/6/12, Larry Martell  wrote:
>> >> On Sat, May 5, 2012 at 7:06 PM, Ramiro Morales 
>> wrote:
>> >>> On Sat, May 5, 2012 at 8:42 PM, Larry Martell <
>> larry.mart...@gmail.com>
>> >>> wrote:
>>  Last month I set up a system and when I cloned django from git I got
>>  version 1.4. Now I an setting up another system, and when I clone
>>  django from git I get 1.5, and my app is failing. How I can get 1.4?
>> I
>>  see a django-nonrel / django-1.4 but it says "Work in progress 1.4
>>  port, DON'T USE"
>> >>>
>> >>> The github.com/django/django repository is now the official Django
>> >>> development repository, we migrated from SVN a week ago.
>> >>>
>> >>> Problem is that we've only migrated the development mainline. We are
>> >>> working to also migrate the release tags (1.4, 1.3, ...) and the
>> >>> post-release maintenance branches. The plan is to have it ready in a
>> >>> couple of days.
>> >>>
>> >>> The repository that previously was at github.com/django/django is
>> called
>> >>> now github.com/django/django-old and it has the 1.4 tag. You can
>> clone
>> >>> from it if you can't wait.
>> >>
>> >> i cloned from django-old, and I get 1.5 alpha (which does not work for
>> me):
>> >>
>> > django.VERSION
>> >> (1, 5, 0, 'alpha', 0)
>> >>
>> >> My working system has:
>> >>
>> > django.VERSION
>> >> (1, 4, 0, 'final', 0)
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Django users" group.
>> >> To post to this group, send email to django-users@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/django-users?hl=en.
>> >>
>> >>
>> >
>> > --
>> > Sent from my mobile device
>> >
>> > Ramiro Morales
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: transaction.commit_on_success committing prematurely?

2012-04-24 Thread Andre Terra
This may actually solve one of the problems I've been having regarding slow
bulk inserts. I'll look into it, thanks for the pointer!!!

Cheers,
AT

On Tue, Apr 24, 2012 at 2:16 PM, John Begeman  wrote:

> My app uses multiple databases and my saves were against something
> that was not the default DB.  I needed to specify the proper db to
> manage transactions against, as commit_on_success was trying to manage
> connections on the default database.
>

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



Re: Avoid verbose_name HTML escaping in admin

2012-04-13 Thread Andre Terra
I'm only guessing, but I think the escaping is being done at rendering time
by the template itself. Take a look at the default admin templates and
check the docs for an explanation on how to override them with your own.

Protip: do not edit the original files!

Cheers,
AT

-- Sent from my phone, please excuse any typos. --
On Apr 13, 2012 6:16 AM, "FraMazz"  wrote:

> Is it possible to avoid HTML escaping in admin?
> I have defined a model with verbose_name for several fields.
> In verbose_name I need HTML code to highlight part of the string e.g.
> d1 = models.CharField(max_length=1, blank=False, default='0',
> verbose_name="Hi all!'').
> In admin the text gets escaped resulting in the whole string being shown
> (Hi all!) instead of Hi *all*!
> I also tried verbose_name=mark_safe("Hi all!'') to no avail
>
> Suggestions?
> Thanks
> Francesca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/LYnO1AIlc_EJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django ORM - query help

2012-04-12 Thread Andre Terra
On Thu, Apr 12, 2012 at 10:01 AM, David  wrote:

> Log.objects.distinct('thing__id').order_by('thing__id',
> '-modified_on').select_related().filter(thing__deleted=0)[:20]
>
> By avoiding the use of values() I was able to then use the result as an
> object and access everything I needed.
>
> The above ORM statement however does not look as elegant to read as I have
> come to expect from Django though. The resulting SQL doesn't seem too
> shabby however.
>


Django has a tendency of making you write really long lines, but I guess
you could break it into smaller chunks to improve readability.

logs = Log.objects.distinct('thing__id').order_by('thing__id',
'-modified_on')
related = logs.select_related().filter(thing__deleted=0)[:20]


Cheers,
AT

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



Re: Comparing QuerySets

2012-04-05 Thread Andre Terra
Not sure if this is efficient, but you can try wrapping the values_list in
a set() call.

>>> set(ids1) == set(ids2)

True

>>> set(ids1) & set(ids2)

set([1])

>>> ids3 = set([])

>>> r = set(ids1) & set(ids3)

>>> r

set([])

>>> len(r)

0


Cheers,
AT

On Thu, Apr 5, 2012 at 6:07 AM, Thomas Guettler  wrote:

> I was surprised, that comparing querysets does not work:
>
> {{{
> from django.contrib.auth.models import User
> user_id=User.objects.all().**order_by('id')[0].id
>
> if not User.objects.filter(id=user_**id)==User.objects.filter(id=**
> user_id):
>print 'Not equal? I think they should be'
>
> ids1=User.objects.filter(id=**user_id).values_list('id', flat=True)
> ids2=User.objects.filter(id=**user_id).values_list('id', flat=True)
> if not ids1==ids2:
>print 'Not equal? I think they should be: %s %s' % (ids1, ids2)
>
> }}}
>
> Both, django 1.3 and 1.4 print this result:
>  Not equal? I think they should be
>  Not equal? I think they should be: [1] [1]
>
> I could not find a documentation of this in the django docs[1].
>
> Before creating a doc-ticket I want to ask here.
>
> [1] 
> https://docs.djangoproject.**com/en/dev/ref/models/**querysets/
>
> --
> Thomas Guettler, http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

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



Re: Difficult setup on Suse Linux

2012-04-05 Thread Andre Terra
There's a chance you have a logging module in your PATH that is shadowing
the default package.

Did you create an app or project named logging by any chance?

Ideas:
- From an interactive python shell, import logging and check
logging.__file__

In my Ubuntu install, I get:
/usr/lib/python2.7/logging/__init__.pyc

- Install virtualenv and create an environment using the --no-site-packages
and install nothing but Django. Try running it from there and see what
happens. Ideally, you'll want to use virtual environments always.

I'm hoping one of these solutions will help, but I'm really just guessing.

Cheers,
AT

-- Sent from my phone, please excuse any typos. --

On Apr 5, 2012 8:22 AM, "Martin Sommer"  wrote:
>
> Its Django 1.3.1, with Python 2.4.1. The Django docs say that this
> would work.
>
> https://docs.djangoproject.com/en/1.3/intro/install/
>
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

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



Re: Problem using django-admin.py in a virtual environment

2012-04-04 Thread Andre Terra
When you type 'django-admin.py foo' in a command prompt, windows will use
the system wide python install which is what is associated with the .py
extension. In order to avoid this, you must call 'python django-admin.py
foo'.

If you don't like having to type 'python' before calling a script, you can
alter your virtualenv activate script so that window's file association for
Python files gets changed when a new environment gets activated. This has
the downside of not reverting the association when you close a prompt
without properly deactivating (by typing 'deactivate'), but I still like
it, so there's a how-to below.


In order to tell the virtualenv to use your virtual python install when
calling file.py directly, you need to modify the activate.bat script and
add the following line somewhere in the beginning (after @echo off):

FTYPE Python.File="C:\Environments\django1.3\Scripts\python.exe" "%1" %*

Then add a line to revert this association change in deactivate.bat
(located in the same folder):

FTYPE Python.File="C:\Python27\python.exe" "%1" %*

I did my best to guess the paths, but you might have to adjust them
appropriately.


Hope that helps!

Cheers,
AT

On Wed, Apr 4, 2012 at 6:01 AM, DIEGO CENZANO PRADO
wrote:

> I have install django with 'python setup.py install' in a virtual
> environment called 'django1.3'
>
> I run it and receive the following error mesage:
>
> (django1.3) C:\Documentos de Diego\Dropbox\Codigo\Django>django-admin.py
>
> Traceback (most recent call last):
>
>   File "C:\Environments\django1.3\Scripts\django-admin.py", line 2, in
> 
>
> from django.core import management
>
> ImportError: No module named django.core
> Can anybody help me, please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/WKzPnfWfh9UJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: dynamically adding form fields

2012-04-03 Thread Andre Terra
Hi Matt,

Search the docs for inlines, inline formsets and inline formset factories,
and you'll find exactly what you need [0].

Read them carefully cause it's easy to make mistakes and debugging inlines
has always been frustrating for me.

Good luck and happy coding.

Cheers,
AT

[0] https://docs.djangoproject.com/en/dev/topics/forms/modelforms/

On Apr 3, 201
>
> I'm working on a complex form and not sure if there is an elegant way to
> handle it in django.
>
> The form creates an invoice and it uses jQuery to dynamically add/remove
> extra form fields into the HTML for line items.  Each line item contains
> several fields including description, unit price, quantity etc.
>
> On the server I need to create all these line item objects and set the
> foreign key back to the invoice model object.  It needs to validate
> everything and return errors for the appropriate fields.
>
> I'd like to use a ModelForm or Form for the whole invoice but not sure how
> to represent the line item fields.
>
> Suggestions?
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/xaYRsc5sZxwJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Profiling Django (WAS Django database-api)

2012-04-03 Thread Andre Terra
Hey Javier,

Thanks for the reply. My problem with the logs in the past was that they
tended to make the task even slower (due to recursion) but I guess that's
probably because I didn't call the logging from the appropriate places in
the code.

To make things a little more complicated, the task involves writing a large
amount of data to a temp database, handling it and then saving some
resulting queries to the permanent DB. This makes it a tad harder to
analyze what goes on in the first part of the code.

I'll try logging again over the weekend and see how that works.. I just
wish there were third party apps and tools for debugging this sort of
problem.

Thanks again for your input.

Cheers,
AT

On Apr 3, 2012 3:47 PM, "Javier Guerra Giraldez" <jav...@guerrag.com> wrote:
>
> On Tue, Apr 3, 2012 at 8:21 AM, Andre Terra <andrete...@gmail.com> wrote:
> > I have some complex and database intensive asynchronous tasks running
under
> > celery which take a LONG time to complete and I'd just love to be able
to
> > keep track of the queries they generate in order to optimize and
possibly
> > remove the biggest bottlenecks.
>
> the easiest would be to write detailed logs, which _can_ be analysed
> in real time, not only 'after the fact'.
>
> my second idea would be to hack the log output so instead of writing
> to a file, it would store messages (probably with some structure) to
> some comfortable database.  I'd use Redis, but i guess MongoDB or even
> an SQL-based DB could work too.  then you can easily filter and
> aggregate times according to task type, when it happened, etc.
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

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



Re: Need help

2012-04-03 Thread Andre Terra
It could be a regression bug.

To be honest, I don't see a reason why '' should become 'localhost'
automagically. I'd much prefer if users were forced to write 'localhost'
rather than having Django do it (and fail) for them.

Explicit is better than implicit.

If you haven't yet, please file a bug report:
https://code.djangoproject.com/newticket


Cheers,
AT


On Tue, Apr 3, 2012 at 12:25 PM, thongor  wrote:

> Wow this post is really old but this also solved my problem strangely
> enough.
>
> On Thursday, June 25, 2009 2:48:32 PM UTC-4, amy wrote:
>>
>> I had this same problem...the user and pass were fine but no users
>> could authenticate on any DB, regardless of settings.
>>
>> Turns out my issue was only that I needed to add the string
>> "localhost" to the host parameter.
>>
>> It's odd since the comments specifically state to leave it blank for
>> localhost...but oh well. It worked.
>>
>> DATABASE_HOST = 'localhost' # Set to empty string for
>> localhost. Not used with sqlite3.
>>
>> Odd.
>>
>> On May 31, 6:14 am, Tim Chase  wrote:
>> > mizan rahman wrote:
>> > > No, i've checked that i've created a user named "djangouser" and the
>> > > problem still exist what will i do? Plz help me
>> >
>> > and you've checked that the password in settings.py is correct?
>> > You only confirmed one of the two problems I suggested.
>> >
>> > If both are correct, you may have to include the section of your
>> > pg_hba.conf that defines access permissions.  It usually looks
>> > something like
>> >
>> > ##**##**##
>> > local   all postgres  ident sameuser
>> >
>> > # TYPE  DATABASEUSERCIDR-ADDRESS  METHOD
>> >
>> > # "local" is for Unix domain socket connections only
>> > local   all all   ident sameuser
>> > # IPv4 local connections:
>> > hostall all 127.0.0.1/32  md5
>> > # IPv6 local connections:
>> > hostall all ::1/128   md5
>> > ##**##**##
>> >
>> > along with information about how your connecting in Django (to
>> > localhost, to the local machine by IP address, to a remote
>> > machine, etc)
>> >
>> > -tkc
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/BI0mwz_xsrsJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Problemas con syncdb

2012-04-03 Thread Andre Terra
I guess you could check if you're actually looking at the right file.

$ python manage.py shell

>>> import settings

>>> print settings.__file__



Cheers,
AT

On Tue, Apr 3, 2012 at 10:28 AM, DIEGO CENZANO PRADO  wrote:

> I am trying to do the tutorial and I get an error doing 'python manage.py
> syncdb'. I am using the DATABASES as it is created and I've try to use
> sqlite3 and mysql backends. I tried it in windows and in unix. Rasult is
> always the same:
>  raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
> django.core.exceptions.ImproperlyConfigured: settings.DATABASES is
> improperly configured. Please supply the ENGINE value. Check settings
> documentation for more details.
> But settings.py is:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'polls.db',  # Or path to database
> file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for
> localhost. Not used with sqlite3.
> 'PORT': '',  # Set to empty string for
> default. Not used with sqlite3.
> }
> }
> ¿Any idea?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Yl-oyPgbgLYJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Profiling Django (WAS Django database-api)

2012-04-03 Thread Andre Terra
While I know of the two methods mentioned by Anssi, I've often wondered how
to profile my code from a project level.

I have some complex and database intensive asynchronous tasks running under
celery which take a LONG time to complete and I'd just love to be able to
keep track of the queries they generate in order to optimize and possibly
remove the biggest bottlenecks.

"Real time" updates would be great, but I can settle for after-the-fact
logs. I know of django-debug-toolbar [0] but since these aren't happening
in a view, I'm not sure that app can help.

Any suggestions? Thanks in advance!

Cheers,
André Terra

[0] http://pypi.python.org/pypi/django-debug-toolbar
 On Apr 3, 2012 6:13 AM, "KasunLak"  wrote:

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



Re: Looking for Django IDE

2012-04-02 Thread Andre Terra
OP, there are about a dozen threads regarding django and IDEs in the
mailing list. Please search the archive before asking the same question
again. Let's try not e-mail thousands of people needlessly!


Sincerely,
André Terra


2012/4/2 Sells, Fred 

> Thanks; actually I can use the nightly build for an IDE plugin so your
> response "saves the day".  I just cannot use it in software deployed in
> production.
>
> Thanks again,
>
> Fred.
>
> -Original Message-
> From: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> On Behalf Of N.Aleksandrenko
> Sent: Monday, April 02, 2012 7:18 AM
> To: django-users@googlegroups.com
> Subject: Re: Looking for Django IDE
>
> sublime 2 + plugin for djando syntax
>
> 2012/4/2 Alexandros Karypidis :
> > This is a problem in PyDev, not Django.
> >
> > The fix is already committed in the PyDev repository and will be
> > released in PyDev 2.5.0:
> > http://sourceforge.net/tracker/?func=detail=3512322_id=85796
> > =577329
> >
> > If you can't wait until PyDev 2.5.0, the only solution is to use a
> > nightly build.
> >
> > You should explain to your "management" that they should get out of
> > your way and let you do your job.
> >
> >
> > On 2/4/2012 7:17 πμ, Sells, Fred wrote:
> >>
> >> Is there a Django 1.4.1 in the works that would solve this problem?
> >> I also use Eclipse+PyDev and am planning to upgrade to Django 1.4
> shortly.
> >> However my management is not going to allow using a nightly build in
> >> a production system regardless of the justification.  I guess my
> >> options are to stick with 1.3 or create a dummy project manually and
> >> copy and tweak it whenever I need a new project.  Any suggestions.
> >>
> >> > From the forum post, it was not clear if this is a Django, PyDev or
> >> Eclipse issue.  Any thoughts?
> >>
> >> Fred.
> >>
> >> -Original Message-
> >> From: django-users@googlegroups.com
> >> [mailto:django-users@googlegroups.com] On Behalf Of Alexandros
> >> Karypidis
> >> Sent: Sunday, April 01, 2012 3:57 PM
> >> To: django-users@googlegroups.com
> >> Subject: Re: Looking for Django IDE
> >>
> >> Hi,
> >>
> >> I'm using PyDev in Eclipse and it seems quite nice: http://pydev.org/
> >>
> >> Have a look at the Django-specific stuff:
> >> http://pydev.org/manual_adv_django.html
> >>
> >> Please note that you must use a nightly build for Django 1.4 due to
> >> this:
> >> http://sourceforge.net/projects/pydev/forums/forum/293649/topic/51586
> >> 43
> >>
> >> Cheers,
> >> Alex
> >>
> >>
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How Admin can be able to configure Model fields

2012-03-29 Thread Andre Terra
Deepak,

Please read through this before posting again:

https://code.djangoproject.com/wiki/UsingTheMailingList


Cheers,
AT

On Thu, Mar 29, 2012 at 5:04 AM, Deepak RK  wrote:

> Admin can add another field in any model (lets say UserProfile ) and
> it should start appearing in registration form.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: is doing text manipulations in django's template faster than doing same in views

2012-03-29 Thread Andre Terra
If you're doing a lot of operations with your data, there's a chance it
should be moved to the view. The template should usually be restricted to
defining *how* data gets displayed, whereas the view defines *what* your
data is.


Cheers,
AT

On Thu, Mar 29, 2012 at 7:30 AM, vijay shanker wrote:

> which one is faster or considered better in terms of performance ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: IE9+Django,Don't respond or Socket error!!!

2012-03-28 Thread Andre Terra
On Mon, Mar 26, 2012 at 11:31 PM, br  wrote:

> 2) If you want to use the runserver that comes with django:
> - to run runserver, use "manage.py runserver 0.0.0.0:8000" instead of
> the default (which goes to localhost or 127.0.0.1) , and then figure
> out your computer's IP address in your intranet (ivarious ways to do
> this, i use "ipconfig" from command line and pick the one that
> probably starts with 192.168).  Then when you want to access your app,
> do it at http://:8000
>


To make things easier, create a free host redirect on no-ip.org[1] and name
it something like 'mydjangoserver.no-ip.org', then install the No-IP
service for automatically updating the redirect to match your current IP
(on a defined interval, which I usually set for 30 mins). This way you can
always point to http://mydjangoserver.no-ip.org regardless of which network
you're currently on. Helps if you're on the go often, or if you've got a
dynamic IP (my original problem back when I started using it).


Cheers,
AT

[1] http://no-ip.org/

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



Re: ANNOUNCE: Django 1.4 released

2012-03-23 Thread Andre Terra
Hooray!

Congrats to everyone involved, especially all that worked on bringing
timezone support to this increasingly amazing web framework.

I don't mean to nitpick but a minor detail in the release notes requires
some attention:

"Django does not support Python 3.x at this time. At some point before the
release of Django 1.4, we plan to publish a document outlining our full
timeline for deprecating Python 2.x and moving to Python 3.x."

Have we got a timeline yet?

Cheers,
AT
On Mar 23, 2012 2:11 PM, "James Bennett"  wrote:

> Django 1.4 is finally here!
>
> For details, checkout the weblog:
>
> https://www.djangoproject.com/weblog/2012/mar/23/14/
>
> And the release notes:
>
> https://docs.djangoproject.com/en/dev/releases/1.4/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>

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



Re: Is there a place for new Django specialized hosting?

2012-03-22 Thread Andre Terra
Forgive me if I sound pessimistic, I'm just a hobbyist developer offering
my most sincere 2 cents.

There are many services that offer similar features and sometimes even
more. From a business perspective, the only way to thrive in this market is
by having technology that provides competitive advantage and through
marketing aimed at receiving endorsement from trendsetters in the web
development field.

Google ep.io, gondor, apphosted, djangozoom, heroku,
cloudfoundry.com(built by a former Google/Microsoft engineer) and
others.

Considering these have already launched or at least reached beta stage,
you're off to a tough start if you do go through with the plan.

Cheers,
AT



On Mar 21, 2012 10:24 PM, "Martin Tiršel"  wrote:

> Hello,
>
> I am playing with an idea to create a hosting service specialized for
> Django. I would be glad if you can provide some feedback if you would use
> such service (or why not) and what monthly fee would you pay for this.
>
> This would be based on virtual servers without root access (only
> unprivileged shell access) with web based administration:
>
> * create so many webs you want (or resources allows)
> * separated webserver for media files/static content
> * virtualenv support, multiple python versions
> * SVN/Git
> * testing/production environment (clone production data to testing
> environment [app, media, database] -> export project from svn/git -> apply
> migrations -> test -> apply to production)
> * one click trac installation
> * integrated web based editor for some quick changes/fixes (
> http://ace.ajax.org/)
> * backup/restore
> * some tools that makes life easier like one click project initialization
> inside svn/git and prepared settings (so you don't need to create project,
> add it to repository and rewrite common settings), ...
> * basic support for Django
> * easy SSL certificate installation
> * and many others :)
>
> There could be two programs, for example 1GB RAM, 2 vCPU's, 30 GB HDD or
> 2GB RAM, 3 vCPU's, 50GB HDD
>
> My goal is to provide an environment for developers with multiple projects
> that wants virtual server but don't want/know to install/configure such
> virtual server. Or is there already a service like this?
>
> Thanks,
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

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



Re: using forloop.counter to access data

2012-03-21 Thread Andre Terra
You could always try writing a custom template tag or filter as someone
else suggested earlier in the thread before resorting to JavaScript.

Cheers,
AT
On Mar 21, 2012 5:41 PM, "Larry Martell"  wrote:

> On Wed, Mar 21, 2012 at 12:52 PM, James  wrote:
> >
> >
> > On Wednesday, March 21, 2012 10:41:08 AM UTC-4, Larry@gmail.comwrote:
> >>
> >> On Wed, Mar 21, 2012 at 7:53 AM, James <> wrote:
> >> >
> >> >
> >> > On Wednesday, March 21, 2012 8:47:23 AM UTC-4, larry@gmail.com
> >> > wrote:
> >> >>
> >> >> This is probably a stupid newbie question 
> >> >>
> >> >> I want to access a column of data in a row using forloop.counter, but
> >> >> I cannot get it to work.
> >> >>
> >> >> In my test code, if I display {{ forloop.counter }} I get 2
> >> >> If I display {{ headers.0.2 }} I get ToolType
> >> >> But if I display {{ headers.0.forloop.counter }} I get nothing
> >> >>
> >> >> What is the proper syntax for this?
> >> >
> >> >
> >> > the forloop.counter and friends will simply give you information about
> >> > the
> >> > iteration, it won't give you any information about the data in the
> >> > queryset
> >>
> >> Yes, I realize that. I am using it withing a loop to try an access a
> >> specific item of data. The code I showed was just an example from one
> >> iteration of the loop.
> >>
> >> > (I'm assuming this is what you mean when you say column).
> >> >
> >> > Here are the
> >> >
> >> > docs
> https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#for
> >> >
> >> >  If you want to access the column of data, assuming it's referenced
> from
> >> > a
> >> > model, just the attribute of that model. If you passed in a list to
> the
> >> > template, you just use the django "dot" look-up syntax.
> >>
> >> Perhaps my question wasn't clear. I have a list called headers. From
> >> within a for loop I want the n'th item from the first row. In the loop
> >> I am trying to access {{ headers.0.forloop.counter }} but I get no
> >> value from that. But if I hard code the number (as a test), e.g.:  {{
> >> headers.0.2 }} then I do get the value.
> >
> >  With regards to your reply:
> >
> >
> >>  Yes, I realize that. I am using it withing a loop to try an access a
> >> specific item of data. The code I showed was just an example from one
> >> iteration of the loop.
> >
> >
> > You can't use forloop and friends in the manner you attempting to use it.
> > It's The reason is, headers.0 has no attribute named "forloop"
> >
> > The best that you could do here, in this situation, is to create a custom
> > filter and pass it forloop.counter as variable like so:
> > {{ headers.0|forloop.counter }} You will of course have to write that
> filter
> > out first, register it, and install it in the template.
> >
> > I'm still not sure if this is the right approach. Why not just iterate
> over
> > the list itself, if you want to print the nth item within the list?
>
> That would be really inefficient, as the table can have thousands of
> rows, with 30 columns each. I'd have to iterate through the header row
> for each column in each row to get the value to put into the href.
>
> > Or,
> > structure the list/queryset from the view such that you don't have to do
> > such acrobatics.
> >
> >>  But if I hard code the number (as a test), e.g.:  {{
> >> headers.0.2 }} then I do get the value.
> >
> >
> > This works because headers.0 has an attribute that works by way of the
> > django dot look up. See Tom Evan's post regarding this.
> >
> > It seems to me that you have a list of lists (and not a single list). In
> > which case, you can just iterate over the first list and iterate over the
> > second list. If you need some control flow, just use the standard if /
> else
> > conditions. But, maybe I'm missing something?
>
> Yes, I think you are. I have 2 header rows, and thousands of data
> rows. For each column in each data row I have to construct a href. One
> of the parameters in the href comes from the first header row. The
> header rows get processed first, then the data rows (to build the
> table). So by the time I am processing the data I don't have the
> header any more. I should probably just do this in javascript.
>
> > Even easier would be to use django's introspect feature and create models
> > based on the tables in the DB, query the DB using the models and create
> > querysets. Then you can access and display the data in a more
> > coherent manner.
> >
> > see the docs here for
> > introspection:
> https://docs.djangoproject.com/en/dev/howto/legacy-databases/?from=olddocs
>
>
> That already is the case. I am trying to add functionality to an existing
> app.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this 

Re: Preventing JOIN while checking if a self referencing FK is null

2012-03-21 Thread Andre Terra
Sorry. In the process of changing model names to fit my own installation
and test the code, I also managed to invert the relation.

Pay no attention to the man behind the curtains!

Cheers,
AT
On Mar 21, 2012 6:42 PM, "diafygi" <diaf...@gmail.com> wrote:

> I cannot confirm that behavior. Can others verify?
>
> I'm using Django 1.3 and I get:
> >>> print Blog.objects.filter(editor=None).values('id').query
> SELECT `myapp_blog`.`id` FROM `myapp_blog` LEFT OUTER JOIN
> `myapp_user` ON (`myapp_blog`.`editor_id` = `myapp_user`.`id`) WHERE
> `myapp_user`.`id` IS NULL
>
> -Daniel
>
> On Mar 21, 2:07 pm, Andre Terra <andrete...@gmail.com> wrote:
> > On Wed, Mar 21, 2012 at 5:41 AM, diafygi <diaf...@gmail.com> wrote:
> > > >>> Blog.objects.filter(editor=None)
> >
> > >>> print Blog.objects.filter(editor=None).values('id').query
> >
> > SELECT "myapp_blog"."id" FROM "myapp_blog" WHERE "myappblog"."editor_id"
> IS
> > NULL
> >
> > Cheers,
> > AT
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: [bump] Preventing JOIN while checking if a self referencing FK is null

2012-03-21 Thread Andre Terra
Because django offers a nice ORM that makes it easy to do most queries,
especially one-liners like this one.

And refactoring raw SQL is a royal PITA.


Cheers,
AT

On Wed, Mar 21, 2012 at 3:14 PM, Python_Junkie <
software.buy.des...@gmail.com> wrote:

> Use straight sql.
>
> There are always potentially limitations with an abstraction such as the
> ORM.
>
> Why try to fit a square peg into a round whole.
>
>
> On Wednesday, March 21, 2012 4:41:32 AM UTC-4, diafygi wrote:
>>
>> There is an old thread that didn't end in a resolution about
>> preventing joins in a filter(foreign_key=None) scenario.
>>
>> http://groups.google.com/**group/django-users/browse_**
>> thread/thread/61ee2fb22deae326
>>
>> I'd like to bring it up again and ask if there is now a way to prevent
>> joins from a query.
>>
>> An example:
>> class Blog(model.Models):
>>editor = models.ForeignKey(User, null=True)
>>
>> # find all the blogs with no editors
>> >>> Blog.objects.filter(editor=**None)
>> DEBUG:django.db.backends:(0.**039) SELECT `myapp_blog`.`id` FROM
>> `myapp_blog` LEFT OUTER JOIN `myapp_user` ON (`myapp_blog`.`editor_id`
>> = `myapp_user`.`id`) WHERE `myapp_user`.`id` IS NULL;
>>
>> # Is there a way to do this query?
>> >>> Blog.objects.filter(editor=**None)
>> DEBUG:django.db.backends:(0.**039) SELECT `myapp_blog`.`id` FROM
>> `myapp_blog` WHERE `myapp_blog`.`editor_id` IS NULL;
>>
>> Thanks!
>> Daniel
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/NfvXnYxnHBkJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Problem with Django starting up

2012-03-21 Thread Andre Terra
What I recommend is that you install pip and virtualenv, create a folder
(say, C:\virtual\) where you will place different python "environments" per
virtualenv, then create a folder (say, C:\projects) where you will create
different django projects.

This way you can always use virtualenv to "activate" different environments
and not need to install libraries system-wide.


Basically (blue commands are to be typed in the command prompt):
01. Go to http://pypi.python.org/pypi/pip#downloads
02. Download the archive, extract the contents to a given folder (you might
need 7-zip[1]).
03. Open the command prompt (Winkey+R, type in "cmd" with no quotes)
04. cd into the folder created by the extracted archive in step 02
05. python setup.py install
06. Make sure you have C:\Python27\Scripts in your PATH.
06.1. Do this by typing set PATH=C:\Python27\Scripts;%PATH% in the command
prompt
07. pip install virtualenv
08. mkdir c:\virtual && mkdir c:\projects
09. cd c:\virtual
10. virtualenv --no-site-packages myfirstenvironment (you can name this
after your project if you want to)
11. cd myfirstenvironment

*12. Activate your environment:
C:\virtual\myfirstenvironment\Scripts\activate.bat*

If you want the development version of Django:
13.A. pip install git+https://github.com/django/django.git#egg=django

If you want a stable release:
13.B. pip install django

14. Whenever you need to install a package, just do the same as in step #12
but type the package name instead of django. Don't forget to activate your
environment whenever you open a command prompt window and BEFORE you start
working on your project!


I think that about sums it up. Using this on linux is of course easier. I
hope I didn't miss any steps, but I'm sure others will correct me if I
forgot anything.


Cheers,
AT


[1] http://www.7-zip.org/download.html


On Wed, Mar 21, 2012 at 3:48 AM, Jani Tiainen  wrote:

> 21.3.2012 7:50, Samuel Muiruri kirjoitti:
>
>  I can't get the first part to work
>>
>>
> I assume that you have python installed to c:\python27\
>
> You need to add c:\python27\scripts to your path.
>
> Or alternatively:
>
> c:\python27\scripts\django-**admin.py startproject mysite
>
> --
>
> Jani Tiainen
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

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



Re: Having all objects defined in Models.py editable in one admin page

2012-03-21 Thread Andre Terra
Try writing your own views rather than expanding the Admin. It's well worth
it in the long run!


Cheers,
AT

On Wed, Mar 21, 2012 at 1:50 PM, Sithembewena Lloyd Dube
wrote:

> Hi guys,
>
> I am building a learning application for a client. The problem we are
> experiencing is that of inlines. We have multiple related objects and the
> client wants to be able to edit all objects from one CRUD. Unfortunately,
> there seems to be no solution for multiple inlines in a Django admin.
> application. Is there a sensible way to address this problem?
> --
> Regards,
> Sithembewena Lloyd Dube
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: where did I install Django

2012-03-21 Thread Andre Terra
How to have a sane python setup:

1. use pip and virtualenv[1]
2. ???
3. PROFIT!

Cheers,
AT

[1]
http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/




On Tue, Mar 20, 2012 at 8:30 PM, jdw  wrote:

> got it!  This one worked.  Thanks.
>
> On Tuesday, March 20, 2012 3:52:05 PM UTC-7, Furbee wrote:
>>
>> From an answer on stackoverflow.com (http://stackoverflow.com/**
>> questions/122327/how-do-i-**find-the-location-of-my-**
>> python-site-packages-directory
>> **):
>>
>> Enter python shell by executing python binary:
>>
>> from distutils.sysconfig import get_python_lib
>>
>>
>> print(get_python_lib())
>>
>>
>> It usually resides in a folder named site-packages or dist-packages
>> somewhere in the Python directory. In Windows it is different than in Unix.
>>
>> When all else fails, you can run a find command on Unix, or a do an
>> advanced search in Windows.
>>
>> On Tue, Mar 20, 2012 at 3:30 PM, jdw 
>> 
>> > wrote:
>>
>>> Newbie alert...
>>>
>>> I installed Django and finished the first tutorial.  On the second one,
>>> I could not log in to the website because  I didn't set a superuser.
>>> Ultimately, I figured out my problem, but I realized I have no idea where I
>>> installed Django.  Is there an easy way to find out where the code lives?
>>>
>>> I realized I had no idea when the tutorial suggested running this:
>>>
>>> python /path/to/django/contrib/auth/c**reate_superuser.py
>>>
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**9FZCBitFicMJ
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/bHhVJmu5AJEJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: [bump] Preventing JOIN while checking if a self referencing FK is null

2012-03-21 Thread Andre Terra
On Wed, Mar 21, 2012 at 5:41 AM, diafygi  wrote:

> >>> Blog.objects.filter(editor=None)
>


>>> print Blog.objects.filter(editor=None).values('id').query
SELECT "myapp_blog"."id" FROM "myapp_blog" WHERE "myappblog"."editor_id" IS
NULL


Cheers,
AT

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



Re: "Dynamyc" modells

2012-03-13 Thread Andre Terra
This is so not what Django was built to do...

I have a feeling that if you ever do manage to write it, it's going to be
slower than slow and error prone...


Sincerely,
AT


On Tue, Mar 13, 2012 at 4:59 AM, Ervin Hegedüs  wrote:

> hello,
>
> On Tue, Mar 13, 2012 at 09:38:34AM +0200, Jani Tiainen wrote:
>
> > Ultimate solution sounds more like using document oriented
> > databases, like CouchDB or MongoDB. (Just the few I happened to
> > remember).
>
> okay, lets look an another example: I have a model, which
> describes RDBMS connections: DBdesc, DBhost, DBuser, DBpassword,
> DBdbname, DBtable, DBkeycolumn, DBvalcolumn, and so on...
>
> Now I can filter() a row by DBdesc, which gives me de full
> description of DB connection - sometimes that DB exists on an
> external host. As I wrote my previous email, all data model in
> different data source have an intersect of columns, these columns
> are stored in my model.
>
> (Security is important, usually I used this through VPN's, and
> currently all stored connection has just select privilege - these
> are not sensitive datas of course.)
>
> After I get the DB desc, I use "row" SQL connection, eg. when DB
> is MySQL, I import the MySQLdb modul, create a mysql connection,
> a cursor...
>
> This is different from marketing agencies example, but I can use
> the "ultimate" solution at every cases.
>
>
> Thanks:
>
>
> a.
>
>
> --
> I � UTF-8
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: django facebook api

2012-03-12 Thread Andre Terra
Suresh,

If you want to get any answers, you must first learn how to make the
questions.


Please follow the guidelines in this wiki article before posting to the
mailing list:
https://code.djangoproject.com/wiki/UsingTheMailingList


Cheers,
AT


On Thu, Mar 8, 2012 at 9:24 AM, suresh dokania wrote:

> Hi,
>
> I got my login working. Redirect uri was d problem. I created a redirect
> uri stormy-sunset in facebook using django
>
> I followed this link http://djangosnippets.org/snippets/2065/
>
> but  the problem is here are my requirements
> When i press the login button  n enter my username n password , i need to
> be redirected to a particular template in my localhost
> but its nt working with local uri
>
> second only for the account i ve created my app , its logging. when i try
> using another username and password it says requested user name and
> password cannot be used by facebook at the moment
> i want to use the details of the user logged in to build  a social graph
> using django
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Problems getting started

2012-03-07 Thread Andre Terra
Again, don't install as root, use virtualenv. This will save you headaches
in the future, and unless you have an inexcusable reason to have Django run
as root, you shouldn't.


Sincerely,
AT

On Wed, Mar 7, 2012 at 6:28 PM, backdoc  wrote:

> I think you might need to install as root or sudo.
>
> From memory.
>
> sudo python setup.py install
>
> Also, try executing "which django-admin.py" at the terminal.  That
> will tell you the location of the executable.  Basically, I'm curious
> if it will even find it, as I'm thinking it didn't install at all.  I
> just installed the 1.4 rc last night on Debian.  I didn't have any
> issues.
>
> On Mar 7, 8:36 am, Clark  wrote:
> > After installing Django I am attempting to start a new project.  After
> > creating a directory for this, I tried using the command: "django-
> > admin.py startproject mysite".
> >
> > but I'm getting the message "-bash: django-admin.py: command not found
> > ".
> >
> > So, I've tried running this:
> >
> > "sudo ln -s library/python/2.6/site-packages/django/bin/django-
> > admin.py /usr/local/bin/django-admin.py" in which i get "file exists"
> > and I still get the same problem when running the startproject.
> >
> > Only other piece of info is that during installation I had a "error: /
> > usr/local/bin/django-admin.py: No such file or directory".  But I can
> > cd into that directory and see the django-admin.py file.
> >
> > Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: User permission

2012-03-07 Thread Andre Terra
What I do:

1) Control user rights in views, always, no matter what.
2) Pass user perms to template so that you only display accessible,
permitted links.


Cheers,
AT

On Wed, Mar 7, 2012 at 2:10 PM, Xavier Pegenaute wrote:

> Hi,
>
> Which one is the best option?
>
> a- Control the user rights in the views
> b- Control the user rights in the templates
> c- Control the user rights in both locations
>
> I guess is (c), but it's too much work.
>
> Thanks,
> Regards.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

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



Re: Problems getting started

2012-03-07 Thread Andre Terra
On Wed, Mar 7, 2012 at 2:53 PM, Sandro Dutra  wrote:

> I don't know how it's works on a Linux box, but on Windows we've to put
> Python/Scripts on PATH variable to use the command directly.



Or you can use virtualenv like I mentioned in the other thread.


Cheers,
AT

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



Using django and virtualenv on Mac OS X. (WAS: Getting Started with Mac OS X)

2012-03-07 Thread Andre Terra
You should use pip and virtualenv to create a sane development environment.

This guide [1] is originally aimed at ubuntu/linux, but I think you can
probably follow in mac os x as well. I've also listed a few other links
with instructions that look alright, but that I haven't tested.

Basically, don't "ln -s". Use virtualenv instead.

Quote from one of the links:

*"On my systems, virtualenv, virtualenvwrapper, and Mercurial are the only
Python packages that are always available — every other package is confined
to its virtual environment."*

While you might prefer something other than mercurial, the point still
stands. Add only the bare minimum to the system-wide install and everything
else to virtualenvs instead.



Cheers,
AT

[1]
http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/


http://www.arthurkoziel.com/2008/10/22/working-virtualenv/
http://hackercodex.com/2011/08/30/python-install-django-on-mac-osx-lion-10.7/
http://www.djangoapp.com/blog/2011/07/25/django-installation-on-mac-os-x-lion/




On Wed, Mar 7, 2012 at 2:31 PM, Clark Corey  wrote:

> I am typing mine into a shell promptI posted the thread, but I don't
> know that it has posted yet...here it is:
>
> After installing Django I am attempting to start a new project.  After
> creating a directory for this, I tried using the command: "django-
> admin.py startproject mysite".
>
> but I'm getting the message "-bash: django-admin.py: command not found".
>
> So, I've tried running this:
>
> "sudo ln -s library/python/2.6/site-packages/django/bin/django-admin.py
> /usr/local/bin/django-admin.py" in which i get "file exists"
> and I still get the same problem when running the startproject.
>
> Only other piece of info is that during installation I had a "error:
> /usr/local/bin/django-admin.py: No such file or directory".  But I can
> cd into that directory and see the django-admin.py file.
>
> Thanks!
>
> -Clark
>
>
>
> On Wed, Mar 7, 2012 at 7:54 AM, Tom Evans wrote:
>
>> On Wed, Mar 7, 2012 at 2:43 PM, Clark  wrote:
>> > I am having a similar issue, so I tried the $ pip uninstall django,
>> > but I got a "IOError: [Errno 13] Permission denied"
>> >
>> > Advice?
>> >
>> > Thanks.
>> >
>>
>> You should have started a new thread for your new error. The error
>> here was that the new user was typing shell commands into a python
>> prompt - is that what you are doing?
>>
>> The error that you have shown means that pip tried to access (read or
>> delete) a file to which it did not have access. That could happen for
>> any number of reasons, but most likely you installed django as root
>> and are trying to uninstall it as a regular user.
>>
>> Of course, that is just speculation, as you have not shown what
>> happened, or what your original error was that made you think "I know,
>> a reinstall of Django will fix everything".
>>
>> Cheers
>>
>> Tom
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: best resources for learning django

2012-03-02 Thread Andre Terra
First of all, welcome to Django!

If you're not familiar with python (and specially managing python
packages), I recommend you setup a sane development environment. Namely
using virtualenv and pip, and optionally mkvirtualenv (if you're not on
windows).

Having to figure out import errors is usually very a frustrating obstacle,
especially for newbies.



http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/
http://www.doughellmann.com/docs/virtualenvwrapper/


Cheers,
AT


On Fri, Mar 2, 2012 at 3:48 PM, Javier Guerra Giraldez
wrote:

> On Fri, Mar 2, 2012 at 1:23 PM, gowtham  wrote:
> > Not sure if it is the best one (would like to here from Pros on this).
> But
> > following really helped me to get started. I  finishing this tutorial in
> 2
> > days and the next two days, i started and had a working application
> (simple
> > though) for my project..
> >
> > https://docs.djangoproject.com/en/1.2/intro/tutorial01/
>
>
> even if you find any other 'better' source, the tutorials are a
> necessary prerequisite.  there are lots of times where a newcomer asks
> something in the list and even if the answer might not be in the
> tutorials themselves, not doing them leads to a big obstacle to
> communication.
>
> for me, the best order is:
>
> - the tutorials (all of them, even if they're not related to your needs)
> - ask a little in the list.
> - read other sections in the documentation.
> - read the Django Book.  even if it's a little dated, the concepts stay
> valid.
> - ask a little more on the list
> - read the whole docs.
> - start answering on the list!  yes, that helps learning too
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Error while importing URLconf 'permitprint.urls': day is out of range for month

2012-02-29 Thread Andre Terra
use something like >>> d + datetime.timedelta(days=365)

http://docs.python.org/library/datetime.html#timedelta-objects


Cheers,
AT

On Wed, Feb 29, 2012 at 12:59 PM, furby  wrote:

> Caught it.  Haha.  What a funny bug.  From models.py:
>
> 196 d = dt.datetime.today()
> 197 expires = d.replace(year=d.year+1)
>
> There is no Feb. 29th, 2013.  So this breaks.  Thx for the help!
>
> On Feb 29, 9:50 am, Tom Evans  wrote:
> > On Wed, Feb 29, 2012 at 3:33 PM, furby  wrote:
> > > The guy I built this for does not want to pay me to maintain it, so
> > > it's still on .96.  And yet when something breaks randomly he wonders
> > > why.  Debug enabled today for debugging.  There is no dev
> > > environment.  Only production for this.
> >
> > Customer is always right. Plus, job for life ;)
> >
> >
> >
> > > Here's the urlconf.  I've literally commented out every urlpattern
> > > expect the top one on line 4.  Still breaks:
> >
> > >  1 from django.conf.urls.defaults import *
> > >  2 from permitprint.app.models import *
> > >  3 urlpatterns = patterns('django.views.generic.simple',
> > >  4 (r'^/?$', 'direct_to_template', {'template': 'index.html'}),
> > >  5 """
> >
> > Hmmpf. One of the things improved since 0.96 is that error reporting
> > of this kind has improved. There is an import error coming from one of
> > the imports in the urlconf, and that is why it cannot import the
> > urlconf. Is there any date handling code in the top level of the
> > permitprint.app.models?
> >
> > Cheers
> >
> > Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Post data Query Dict - Why not a list ?

2012-02-29 Thread Andre Terra
Excuse my brainfart moment.. sets and dicts are not ordered!

On Wed, Feb 29, 2012 at 11:32 AM, Tom Evans <tevans...@googlemail.com>wrote:

> On Wed, Feb 29, 2012 at 1:46 PM, Andre Terra <andrete...@gmail.com> wrote:
> > I may be misunderstanding something, but for one reason lists are not
> > ordered, so you'd never know which item to get, agreed?
> >
>
> Lists are ordered, I think you are confusing something :)
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Post data Query Dict - Why not a list ?

2012-02-29 Thread Andre Terra
On Wed, Feb 29, 2012 at 5:46 AM, Szabo, Patrick (LNG-VIE) <
patrick.sz...@lexisnexis.at> wrote:

> Should I not get  lists ?
>
> ** **
>
> i.e:
>
> ** **
>
> [Monatsreport]
>
> [2,29,42]
>


I may be misunderstanding something, but for one reason lists are not
ordered, so you'd never know which item to get, agreed?


Cheers,
AT

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



Re: Django Contract - London - Immediate Start - £250pd - £350pd

2012-02-27 Thread Andre Terra
Meanwhile, as you wait for answers, do check http://djangopeople.me/

Perhaps you could contact some locals directly and even schedule a couple
of interviews.


Cheers,
AT

On Mon, Feb 27, 2012 at 12:22 PM, Tim Abbott  wrote:

> Good Afternoon all,
>
> Firstly, sorry to use the group like this, however the company I am
> working with are one of my longest standing clients and I really want to
> make sure they get the right calibre person. I have been recommended to
> this user group by a friend of mine who is a Python freelancer.
>
> I need an experienced Django Developer to work a 6 week - 2 Month contract
> in London paying between £250pd up to £350pd. The company are a leading
> Marketing Digital Agency. This will be a frontend web development role with
> some CMS and Mobile CMS elements.
>
> As I said, this is really urgent and they need someone on site as soon as
> possible. I can give you a few more details over the phone, the best number
> to get me on is 01189 256 144 or outside normal hours it would be
> 07852232361.
>
> If you are available please can you send your CV to me by return email or
> email my work email address tim.abb...@zetman.com. Either is fine, I just
> need to find someone available!
>
> Thanks in advance
>
> Tim Abbott
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Models inheritance in django: how to change PK "_ptr_id" on "id"?

2012-02-07 Thread Andre Terra
I just read your e-mail quick and somewhat carelessly, so forgive me if I'm
missing something.


Here's a list of things for you to check:

* Have you defined your Client model with abstract = True in its Meta
options?[1]
* Have you syncdb'd[2]?
* If you must name your pk something else, just follow the docs[3]

[1] http://django.me/abstract-base-classes
[2] http://django.me/syncdb
[3] http://django.me/automatic-primary-key-fields


Cheers,
AT


On Tue, Feb 7, 2012 at 4:26 PM, Artyom Chernetzov wrote:

> Here is model structure: Client is User, Client can be corporate or person:
>
> class Client(User):
> #fields
>
> class ClientCorporate(Client):
> #fields
>
>
> class ClientPerson(Client):
> #fields
>
> And client can make orders:
>
> class Order(models.Model):
> client=models.ForeignKey(Client)
> #fields
>
> I try to create common orders list for any type of client, here is view:
>
> def orders_list(request):
> client=request.user.client
> return list_detail.object_list(request,
> queryset = client.order_set.all(),
> #templates ...
> )
>
> And it leads to an error:
>
> **DatabaseError while rendering: no such column: cabinets_order.client_id**
>
> I browse db and find that all User childs have column "user_prt_id". I
> can't find way to change pk name in inherited models. But maybe there is
> some better approach?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/RrPQgVp3R2EJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: High cpu usage for wsgi apache processes

2012-01-23 Thread Andre Terra
Hello,

Unless you tell us what your app is supposed to be doing, there's very
little chance any of us can offer any real help.


Cheers,
AT

On Mon, Jan 23, 2012 at 5:47 PM, TINO THOMAS  wrote:

> Hello,
>
> I have a Django setup on cpanel  server with python 2.7, virtual env and
> mod_wsgi. I can see that cpu usage is high for these wsgi apache processes.
> Is there any way to control this behavior ?
>
>
> Regards
> Tino
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-23 Thread Andre Terra
the >>> indicates you are IN a python shell, which is different from your
OS prompt. Try exiting the shell first (with exit()) and then run "python
manage.py runserver" from a command prompt or terminal window.


Cheers,
AT

On Mon, Jan 23, 2012 at 4:11 PM, JJ Zolper  wrote:

>
> >>> python manage.py runserver
>   File "", line 1
> python manage.py runserver
> ^
> SyntaxError: invalid syntax
> >>>
>

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



Re: what is the best IDE to use for Python / Django

2012-01-19 Thread Andre Terra
*** Everyone, please DO NOT reply to this thread. ***

Krondaj, feel free to search the archives for similar threads. This
question has been asked an answered at least a dozen times.


Cheers,
André Terra

On Thu, Jan 19, 2012 at 12:08 PM, Krondaj  wrote:

> Hi,
>
> I was wondering what the best IDE to use for Python / Django would
> be?
>
> I am currently using Geany, but i'm sure there is a better (hopefully
> free) one out there!?!
>
> Regards,
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Missing something obvious? Question about forms

2012-01-18 Thread Andre Terra
In this case, I think he can subclass it and override the validate
method[0] and simply allow any choice to pass, right?

Cheers,
AT


[0]
https://code.djangoproject.com/browser/django/trunk/django/forms/fields.py#L780


On Wed, Jan 18, 2012 at 1:54 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Wed, Jan 18, 2012 at 3:51 PM, Andre Terra <andrete...@gmail.com> wrote:
> > https://docs.djangoproject.com/en/dev/ref/forms/fields/#choicefield
> >
> https://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.MultipleChoiceField
> >
> >
>
> That is how I almost replied, but a MultipleChoiceField constrains the
> submitted values to be within a predefined list of acceptable values.
> You couldn't use a MultipleChoiceField to collect an arbitrary number
> of arbitrary strings, it would fail validation.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: url name to generic class-based views with parameters?

2012-01-18 Thread Andre Terra
https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#url

# template.html
{% load url from future %}

{% url videos pk=video.pk %}


# 

While we're at it, consider defining a more verbose name to the url, such
as 'video-detail'. I personally like to map url names to an
'app-model-view' syntax, so you can do something like 'myapp-video-detail'
and rename your 'VideoView' to 'VideoDetail'. Then later have
'myapp-video-list' routing to VideoList and so forth. This is also
consistent with the generic class based views offered by Django and helps
keeping your urls.py organized.



Cheers,
AT


On Wed, Jan 18, 2012 at 1:46 PM, Mark Stahler  wrote:

> Can someone explain how to link using url names to class-based views
> that include parameters?
>
> Example:
>
> url(r'^video/(?P\d+)/$', VideoView.as_view()),
>
> works but all my links have to manually have "/video/{{ video.id }}/"
> or similar. I cannot get {% url videos %}{{ video.id }} to work with
> the following route for some reason.
>
> url(r'^video/(?P\d+)/$', VideoView.as_view(), name='videos'),
>
> I cant find anything in the documentation about this. Can anyone
> explain?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Missing something obvious? Question about forms

2012-01-18 Thread Andre Terra
https://docs.djangoproject.com/en/dev/ref/forms/fields/#choicefield
https://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.MultipleChoiceField


Cheers,
AT

On Wed, Jan 18, 2012 at 12:42 PM, Jeff Heard wrote:

> I have a largish API I have to implement from a standard, and it requires
> very complex HTTP processing.  I'd like to use django.forms.Form for that,
> but I can't figure out how to use a form to store a list of parameters.
>
> So while my homemade code might be:
>
> foo = int(request.get('foo', '1'))
> bar = request.getlist(bar)
>
> I can't figure out the corresponding Form class.  What I would *want* is
> something like this:
>
> class MyForm(Form):
>foo = IntegerField()
>bar = ListField(CharField)
>
> but there is no "ListField"  How is this normally handled?
>
> -- Jeff
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: mac vs windows installation /deployment

2012-01-16 Thread Andre Terra
On Mon, Jan 16, 2012 at 2:43 PM, Python_Junkie <
software.buy.des...@gmail.com> wrote:

> I guess I am digging in a lot deeper into this topic that I had
> intended, but your statement above
> about each developer compiling their own source code seems to go
> against the DRY
> principle.
>


The DRY principle applies to writing code, not executing it. Besides, if
different people aren't running the same command once, no one's repeating
themselves.

There are numerous advantages to installing everything manually. When
you're dealing with multiple projects on the same machine, it's the only
way to keep things sane, especially with the advent of virtualenv[1].
Binary python packages will give you an option of which Python install you
are going to use that library for, at the most. They are not made to work
with virtualenv, which I'm willing to bet is running in at least 2/3 of the
stacks running Django in the wild.

If I haven't made myself clear, I'll try again: virtual environments are a
must and they don't mix well with binary packages. Even on windows, you
should 'python setup.py install' from a virtualenv or, even better, use
pip[2].


Cheers,
AT

[1] http://pypi.python.org/pypi/virtualenv
[2] http://pypi.python.org/pypi/pip

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



Re: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?

2012-01-13 Thread Andre Terra
nginx runs on windows xp, and should run on vista/7 too.

I've even managed to compile a version on cygwin with an additionally
patched module that allows for file upload progress tracking.

If anyone wants it, i can put it on github with a sample .conf file, but no
strings attached at all.


Cheers,
AT

On Fri, Jan 13, 2012 at 1:36 PM, Stuart Laughlin wrote:

> On Jan 12, 9:16 pm, Andres Reyes  wrote:
> > You mean that the webserver that Django itself recommends in
> https://docs.djangoproject.com/en/dev/howto/deployment/is not a good
> > choice?
> >
>
> When that documentation was written, apache/mod_wsgi was likely the
> best, easiest, and most stable option. That combination still works
> today and many people use it successfully. To that extent, it is a
> good choice.
>
> However, I am saying it is not the best choice anymore -- at least not
> for people who are just getting started and/or people who lack prior
> apache experience. In this case I would recommend nginx or lighttpd or
> cherokee for the web server and gunicorn or uwsgi for the application
> server. By this time they are stable, and they are faster and easier
> than apache/mod_wsgi.
>
> I wrote more about this in a reply to this thread where I changed the
> subject to "Web Servers for Django Projects".
>
> If I recall correctly, I have heard some of the core devs mention
> updating the docs to include some of these other options. I wonder if
> anyone has submitted a patch for those doc updates. If not, maybe I've
> found my weekend project.
>
> A final thought that I did not consider until just now -- cross-
> platform compatibility might be a factor. I use linux for everything,
> so that's all I care about. To be frank I have no idea whether nginx /
> lighttpd / cherokee / gunicorn / uwsgi run on Windows or Mac. If they
> do not then that can tend to complicate the docs somewhat.
>
>
> --Stuart
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How to avoid "no such column" error when I add a new property to a model?

2012-01-11 Thread Andre Terra
Or use a GUI tool like PgAdmin[0] for PostgreSQL, which is packaged into
most psql distributions.


Cheers,
AT

[0] http://www.pgadmin.org/



On Wed, Jan 11, 2012 at 6:30 PM, Python_Junkie <
software.buy.des...@gmail.com> wrote:

> For those who do not want to use another abstraction module, just use
> sql on the database to add the column.
>
> Look up the alter table command for the database that you are using.
>
> On Jan 11, 5:26 am, callum  wrote:
> > I created an "Article" model with a few simple properties. I ran
> > syncdb, and set up the Django admin site, and added
> > "admin.site.register(Article)" in admin.py. Using the Django admin
> > site, I created an article by filling in the form.
> >
> > I then went into models.py and added another property. I ran syncdb
> > again, ran the server again, then when I opened the Django admin site
> > again, I got the "no such column" error.
> >
> > When I Googled this, the only obvious solutions I found were to reset
> > the app, or at least drop the database table that changed, and start
> > over.
> >
> > But how do I do this without losing my data?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



  1   2   3   4   5   >