Saturday, April 30, 2011

blank=True, null=True dont work with UserProfile

Hello friends, I have the following models,

the problem is that the fields null = True and blank = True,

are being validated when they should enter zero plumb, can someone help me?



class UserProfile(models.Model):
    sexo = models.CharField(choices=(("masculino","masculino"),("feminino","feminino")),max_length=100)
    cpf = models.CharField("Cpf", max_length=15,blank=False)
    telefone = models.CharField(max_length=100, blank=True, null=True)  <-- Here the problem
    celular = models.CharField("Celular",blank = True, null = True ,max_length=100)
    endereco = models.CharField(u"Endereço",max_length=100,blank=False)
    numero = models.CharField(u"Número",max_length=100,blank=False)
    complemento = models.CharField("Complemento",max_length=100,blank=True,null=True)
    bairro = models.CharField("Bairro",max_length=100,blank=False)
    cidade = models.CharField("Cidade",max_length=100,blank=False)
    estado = models.CharField("Estado",choices=UF_CHOICES,max_length=100)
    cep = models.CharField("Cep",max_length=100,blank=False)

    data_nascimento = models.DateField(blank=True,null=True,)
    saldoBid = models.IntegerField("Saldo de Bids",blank=True,null=True,default=5)
    user = models.OneToOneField(User, unique=True, primary_key=True, related_name='profile')
  

    def __unicode__(self):
        return self.user.first_name

def user_post_save(sender, instance, signal, *args, **kwargs):
    profile, new = UserProfile.objects.get_or_create(user=instance)

signals.post_save.connect(user_post_save, sender=User)

--
Daniel Corbe Hahne Latorre
daniel@corbe.com.br
55 48 9618-5115 
skype: daniel_corbe

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

Troubleshooting: How do I make JavaScript shotcuts 'today' and 'now' display?

Hello and thanks in advance,

I am running Django 1.3 on Firefox 4.0.1 under Python 2.7.1 on Windows Vista.  The second page of the introductory tutorial at Django's official homepage says:

"Each DateTimeField gets free JavaScript shortcuts. Dates get a 'Today' shortcut and calendar popup, and times get a 'Now' shortcut and a convenient popup that lists commonly entered times."

I can clearly see what the author is talking about on his screenshots, however, I don't see, nor am I able to click on or use in any way, these graphical 'shortcuts' when I am logged into the Django admin area.  I have already googled this in vain.

Thanks for your help!
-Rodney


___________
Please visit my homepage:
http://www.squidoo.com/dotcomboy

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

Re: django-cas-consumer template question

Your user must be registered on service with django-cas-provider.
Insead of django-cas-consumer i recomend to use django-cas [1]

[1] http://code.google.com/p/django-cas/

On Fri, Apr 29, 2011 at 8:48 PM, Stodge <stodge@gmail.com> wrote:
Of course! Thanks - I have the template working, now I need to get the
login functionality working for the consumer.



On Apr 29, 9:35 am, Alex Kamedov <kame...@gmail.com> wrote:
> Your user must be redirected from django-cas-consumer login view to
> django-cas-provider
> login. Login form is shown on service with django-cas-provider.
>
> On Fri, Apr 29, 2011 at 7:30 PM, Stodge <sto...@gmail.com> wrote:
> > django-cas-consumer
>
> --
> Alex Kamedov
> skype: kamedov    www: kamedov.ru

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




--
Alex Kamedov
skype: kamedov    www: kamedov.ru

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

Re: How do I set permissions for manual install of 1.3 for ubuntu 11.04?

On Sat, Apr 30, 2011 at 12:57, jsierra <joshuasierra@gmail.com> wrote:
> I installed django 1.3 manually on my laptop, since ubuntu 11.04 does not
> ship with 1.3 and I want to be able to run django-admin without having to
> sudo the command when creating projects and subsequently having to use sudo
> with manage.py. I want to mimic whatever permissions that allowed me to use
> the django-admin as a normal user, just like the ubuntu package does.

You will need to be able to save things in /usr/local/lib/python*/

I've made those dirs owner root, group "staff", chmod 775 with
setguid, and put myself in staff. I think that's how it's done.

The other thing you could try is installing it somewhere else, using
the command line switch (eg ~/src), and then symlinking to that dir
from /usr/local/lib/python*/dist-packages

That's off the top of my head and may be completely the wrong way to
go about it.


> Here is the error i get with running django-admin without sudo:
>
> Traceback (most recent call last):
>   File "/usr/local/bin/django-admin.py", line 5, in <module>
>     management.execute_from_command_line()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 429, in execute_from_command_line
>
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 379, in execute
>
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 191, in run_from_argv
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 220, in execute
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 322, in handle
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/startproject.py",
> line 30, in handle_label
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 407, in copy_helper
> IOError: [Errno 13] Permission denied:
> '/usr/local/lib/python2.7/dist-packages/django/conf/project_template/settings.py'
>
> Regards,
> Joshua Sierra
>
> --
> 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.
>

--
Benford's law, also called the first-digit law, states that in lists
of numbers from many (but not all) real-life sources of data, the
leading digit is distributed in a specific, non-uniform way. According
to this law, the first digit is 1 almost one third of the time, and
larger digits occur as the leading digit with lower and lower
frequency, to the point where 9 as a first digit occurs less than one
time in twenty. (via @cyberu)
from The Best of Wikipedia http://bestofwikipedia.tumblr.com/

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

Unable to log in to admin using RemoteUserMiddleware

Hello,

I'm having difficulty finding a fix for this problem. Someone posted
the exact same problem I am having about a year ago. Has there been
any solution to this?

Basically, RemoteUserMiddleware is working just fine after I followed
these directions:
http://docs.djangoproject.com/en/dev/howto/auth-remote-user/#configuration

My problem is that I can not seem to log into the admin site with any
users, even superusers created via manage.py

Here is a link to the old article:
http://groups.google.com/group/django-users/browse_thread/thread/0fe27b2ca4056c8a/7a12438967014133?show_docid=7a12438967014133

Any help will be extremely appreciated :)

Thank you,
Dustin

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

Re: form input

As a newbie I recommend you taking the Django tutorial. Here's the
part about forms:
http://docs.djangoproject.com/en/dev/intro/tutorial04/

Kenny

On Sat, Apr 30, 2011 at 7:24 PM, Pulkit Mehrotra
<mehrotra.pulkit@gmail.com> wrote:
> can anyone tell me the precise way of taking an input from a form and
> storing it in a database
> or provide a good link where i can find one
>
> i am a newbie so please help me
>
> thank you
>
> --
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Attribute error

changed the name but nothing happened
the django version is 1.3

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

form input

can anyone tell me the precise way of taking an input from a form and storing it in a database
or provide a good link where i can find one

i am a newbie so please help me

thank you

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

Re: probably a simple query: looping for an integer number within an html page

This works:

{% for val in the_list %}

{{ val }} <br/>

{% endfor %}

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

Re: Attribute error

On Sat, Apr 30, 2011 at 3:45 PM, Pulkit Mehrotra <mehrotra.pulkit@gmail.com> wrote:
'module' object has no attribute 'CharField'

What does this error means ???

View for this is:
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect,HttpResponse
from wishlist.models import wish
from wishlist.forms import wish

Somebody else tried to point this out on your previous question, but you apparently didn't see that answer, or didn't understand it? As long as you have two different things you are trying to call by the same name, you are going to get odd errors like this. Change the name of one of your wishes to something else: you cannot call both the model and the form "wish". And if you've done the same sort of thing elsewhere, undo it as well. The error message rather sounds like you've done something similar with re-binding the name 'models' or 'forms' to your own thing rather than django.db.models and django.forms.

Karen
--
http://tracey.org/kmt/

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

Re: user and perms context variables from auth context processor (in Django 1.2.3)

On Fri, Apr 29, 2011 at 9:22 AM, simon <kagwewest@gmail.com> wrote:

I am using Django 1.2.3. I was trying to check user permissions on a
certain model using the perms context variable from
contrib.auth.context_processors.auth. As per the documentation, I
tried this (foo is the app label, Bar is the model, and I'm using
default permissions):

{% if perms.foo.change_bar %} do stuff {% endif %}

It's always false even when logged in as a superuser. I tried doing
{{user.username}} to see if the user variable worked and it also
displayed nothing. So I checked in the debug toolbar and the variables
I get from the auth context processor are these:

{'messages':
<django.contrib.messages.storage.user_messages.LegacyFallbackStorage
object at 0xa38284c>,
 'perms': <django.utils.functional.__proxy__ object at 0xa2f236c>,
 'user': <django.utils.functional.SimpleLazyObject object at
0xa31748c>}

Is your view using a RequestContext to render the response? If not, that would explain why user does not appear to be set in your context. In order for context processors to affect your template's context, you must use a RequestContext for rendering. Context processors are not run for templates rendered with a regular Context.

Note the debug toolbar displaying the context processor and the variables it would set for the response don't imply that those variables were actually set in the context used to render the response: debug toolbar shows this information for all responses, regardless of whether a RequestContext was used to render the response.

Karen
--
http://tracey.org/kmt/

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

probably a simple query: looping for an integer number within an html page

Hi there,

I am writing a list with values to a web page. Within that page a list item (somelist.int_item) takes an integer value. What I'm trying (and failing) to do is to write a for loop that repeats for the number in the integer item.

So far I've got

{% for number in somelist.int_item %}
   <p> Item number {{ number }} </p>
{% endfor %}

At the moment this isn't running at all...

Any ideas?

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

Re: Print "flash" messages in templates for certain levels

> Or is there other better solution?
I think you should handle this in the view, like checking there if the
user has sufficient privileges for seeing the message.

Kenny

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

Re: Attribute error

class wish(models.Model):
wish=models.CharField(max_length=200)

what's your django version

On Sun, May 1, 2011 at 3:45 AM, Pulkit Mehrotra <mehrotra.pulkit@gmail.com> wrote:

AttributeError at /mysite/wishlist/

'module' object has no attribute 'CharField'

What does this error means ???

View for this is:
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect,HttpResponse
from wishlist.models import wish
from wishlist.forms import wish

def wishlist(request):
wish_list=wish.objects.all()
return render_to_response(
'wishlist/wishlist.html',
{'list':wish_list}
)

def wish_form(request):
return render_to_response('wishlist/wish_form.html', {'form': form, })

def search(request):
if 'q' in request.GET:
message = 'You searched for: %r' % request.GET['q']
else:
message = 'You submitted an empty form.'
return HttpResponse(message)

The models.py for this is:
from django.db import models

class wish(models.Model):
wish=models.CharField(max_length=200)
wish_date=models.DateTimeField('date published')

the urls.py for this is:
from django.conf.urls.defaults import patterns, include, url
from mysite.wishlist import views

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
(r'^mysite/wishlist/$','wishlist.views.wishlist'),
(r'^mysite/wish/$','wishlist.views.wish_form'),
(r'^mysite/wishsearch/$','wishlist.views.search'),
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^mysite/', include('mysite.foo.urls')),

# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Attribute error

AttributeError at /mysite/wishlist/

'module' object has no attribute 'CharField'

What does this error means ???

View for this is:
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect,HttpResponse
from wishlist.models import wish
from wishlist.forms import wish

def wishlist(request):
wish_list=wish.objects.all()
return render_to_response(
'wishlist/wishlist.html',
{'list':wish_list}
)

def wish_form(request):
return render_to_response('wishlist/wish_form.html', {'form': form, })

def search(request):
if 'q' in request.GET:
message = 'You searched for: %r' % request.GET['q']
else:
message = 'You submitted an empty form.'
return HttpResponse(message)

The models.py for this is:
from django.db import models

class wish(models.Model):
wish=models.CharField(max_length=200)
wish_date=models.DateTimeField('date published')

the urls.py for this is:
from django.conf.urls.defaults import patterns, include, url
from mysite.wishlist import views

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
(r'^mysite/wishlist/$','wishlist.views.wishlist'),
(r'^mysite/wish/$','wishlist.views.wish_form'),
(r'^mysite/wishsearch/$','wishlist.views.search'),
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^mysite/', include('mysite.foo.urls')),

# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),

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

Re: django uwsgi

Thanks Shawn,
That is exactly what it is. I could have added one path up. I just
changed my
ROOT_URLCONF = 'urls' instead of ROOT_URLCONF = 'project.urls' in my
settings and it works fine.

On Apr 30, 1:42 pm, Shawn Milochik <sh...@milochik.com> wrote:
> It sounds like your project directory is not on your PYTHONPATH, so when
> settings tries to import your default urls.py it fails.
>
> I'm not familiar with uwsgi, so maybe that's what the addsitedir is
> supposed to do, but other wsgi files I've seen there's always been a
> line like sys.path.append(project_path).

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

Re: problem installing django 1.3 in virtualenv

You shouldn't have to. Django should be installed within the virtualenv -- that's kind of the point of virtualenv.

You can have any versions of any Python packages (like Django) without any effect on your OS's Python installation or other virtualenvs.

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

Input element radio button group across rows of change list view in Admin?

Hello all,

I'm attempting to create a change list view in the Admin where the first column is a single radio button.  I want the radio buttons to be a group that is shared across the rows.  I want the change list view to show the Save button so that the form can be posted.  When the form is posted I want to store info about the single row selected but not on the model instance.

I've attached a mock-up image that may aid you in understanding what I'm trying to achieve.

This seems to be outside the normal use case for the admin so I realize it might be a bit of work.  If it's doable without an excessive effort I'd like to give it a go.  Of course this could be a case where I can get 90% of the way there but the last 10% is really hard! :-)

I have been tinkering but so far no joy.

If you have successfully implemented such a technique I'd like to see some code if it's available online somewhere or perhaps you could describe your method.

TIA

Toodle-loooooooooo..............
creecode

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

Re: problem installing django 1.3 in virtualenv

its just dawned on me what i've done.

forgot to add the lines into the top of the django-admin.py to
activate the virtualenv when it is used

tjhanks for the help guys.

On Apr 30, 6:11 pm, Andres Lucena <andresluc...@gmail.com> wrote:
> El 30/04/11 18:06, shofty escribi :
>
> > recreated the virtualenv from scratch totally, still got the same
> > result. what am i doing wrong here? really cant work it out.
>
> Exactly what is the output?
>
> What is the content of $HOME/.pip/pip.log?
>
> $ cat $HOME/.pip/pip.log
>
> Also, I don't understand what you say later, about that you installed it
> but not the right version. Pass the output of this command:
>
> $ source envname/bin/activate
> $ python -c 'import django ; print django.VERSION '

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

Re: problem installing django 1.3 in virtualenv

1.3.0 final

and this time after a clean reinstall, django-admin has indeed created
the settings file i was expecting.

i think im coming round to the idea that i might have django installed
outside of the virtualenvs and somehow the settings.py was created
from that.

On Apr 30, 6:11 pm, Andres Lucena <andresluc...@gmail.com> wrote:
> El 30/04/11 18:06, shofty escribi :
>
> > recreated the virtualenv from scratch totally, still got the same
> > result. what am i doing wrong here? really cant work it out.
>
> Exactly what is the output?
>
> What is the content of $HOME/.pip/pip.log?
>
> $ cat $HOME/.pip/pip.log
>
> Also, I don't understand what you say later, about that you installed it
> but not the right version. Pass the output of this command:
>
> $ source envname/bin/activate
> $ python -c 'import django ; print django.VERSION '

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

Re: django uwsgi

It sounds like your project directory is not on your PYTHONPATH, so when
settings tries to import your default urls.py it fails.

I'm not familiar with uwsgi, so maybe that's what the addsitedir is
supposed to do, but other wsgi files I've seen there's always been a
line like sys.path.append(project_path).


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

django uwsgi

I am trying to deploy a django project with nginx and uwsgi. I think I
have it all set up right but when I hit the site I get the following
error:

No module named project.urls

I know everything else is working because I still have debug on and
can see that settings.py is being read.
I know I'm forgetting something stupid but I can't figure it out so
any help appreciated.

Here is the wsgi.py file I am running:

import os
import sys

from os.path import abspath, dirname, join
from site import addsitedir

PROJECT_ROOT = abspath(dirname(__file__))

addsitedir(PROJECT_ROOT)
os.environ['DJANGO_SETTINGS_MODULE']='settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

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

Deploy to stodgy Apache

I have a somewhat stodgy Apache server, running under SunOS, and I would like an appropriate way to deploy a Django application based at /shop/ or some other URL. The server seems set up to allow FastCGI in some form; there is an /fcgi-bin/ directory with one entry.

Apache does not recognize the FastCGIExternalServer directive.

Is there a way I can leverage the /fcgi-bin/ directory and httpd.conf so that requests for /shop/foo/ are serviced by Django?

--
Christos Jonathan Hayward
Christos Jonathan Hayward, an Orthodox Christian author.

Author Bio • Books • Email • Facebook • LinkedIn • Twitter • Web • What's New?

I invite you to visit my "theology, literature, and other creative works" site.

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

Re: django help

El 30/04/11 14:56, Marcos Moyano escribió:
> Read the static-files docs
>

Also read this document:

http://www.catb.org/~esr/faqs/smart-questions.html


> On Sat, Apr 30, 2011 at 4:14 AM, Sunil Chugh <sunilchugh08@gmail.com
> <mailto:sunilchugh08@gmail.com>> wrote:
>
> how can i used static_root
>
> --
> 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
> <mailto:django-users@googlegroups.com>.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com
> <mailto:django-users%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
> --
> Some people, when confronted with a problem, think "I know, I'll use
> regular expressions." Now they have two problems.
>
> Jamie Zawinski, in comp.emacs.xemacs
>
> --
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: problem installing django 1.3 in virtualenv

El 30/04/11 18:06, shofty escribió:
> recreated the virtualenv from scratch totally, still got the same
> result. what am i doing wrong here? really cant work it out.

Exactly what is the output?

What is the content of $HOME/.pip/pip.log?

$ cat $HOME/.pip/pip.log


Also, I don't understand what you say later, about that you installed it
but not the right version. Pass the output of this command:

$ source envname/bin/activate
$ python -c 'import django ; print django.VERSION '

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

Re: problem installing django 1.3 in virtualenv

nah, theres something else going on here, i've successfully
uninstalled then downloaded 1.3 with pip but when i open up the
settings file, the staticfiles stuff and the logging stuff are
missing.

used pip install django==1.3 -E envname

but on the mac its definitely brought down the right version.

anyone else seeing the same?

On Apr 30, 3:40 pm, christian verkerk <christianverk...@gmail.com>
wrote:
> Sometimes virtualenv does not delete an existing install out of the
> MY_ENV/build directory causing an upgrade to fail. delete that build
> directory and try again.
>
> Also using sudo can somethings screw things up...
>
> On Apr 30, 4:34 pm, shofty <m...@shofty.me> wrote:
>
>
>
>
>
>
>
> > is there something wrong with the packages at whatever server they are
> > hosted?
>
> > pip install upgrade django==1.3 -E envname just isnt working.
>
> > installed django into the virtualenv just this morning and its put
> > 1.2.3 in there. can get it to upgrade to 1.3 at all.
>
> > if i recall theres a possibility that a version will be taken down if
> > there is a security issue? or am i making that up?

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

Re: problem installing django 1.3 in virtualenv

Sometimes virtualenv does not delete an existing install out of the
MY_ENV/build directory causing an upgrade to fail. delete that build
directory and try again.

Also using sudo can somethings screw things up...

On Apr 30, 4:34 pm, shofty <m...@shofty.me> wrote:
> is there something wrong with the packages at whatever server they are
> hosted?
>
> pip install upgrade django==1.3 -E envname just isnt working.
>
> installed django into the virtualenv just this morning and its put
> 1.2.3 in there. can get it to upgrade to 1.3 at all.
>
> if i recall theres a possibility that a version will be taken down if
> there is a security issue? or am i making that up?

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

Re: problem installing django 1.3 in virtualenv

just managed to install 1.3 on my mac, so i guess the problem is on
the debian vps.
is there some sort of package manager i need to point somewhere else?
i'll go do a google.

On Apr 30, 3:34 pm, shofty <m...@shofty.me> wrote:
> is there something wrong with the packages at whatever server they are
> hosted?
>
> pip install upgrade django==1.3 -E envname just isnt working.
>
> installed django into the virtualenv just this morning and its put
> 1.2.3 in there. can get it to upgrade to 1.3 at all.
>
> if i recall theres a possibility that a version will be taken down if
> there is a security issue? or am i making that up?

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

problem installing django 1.3 in virtualenv

is there something wrong with the packages at whatever server they are
hosted?

pip install upgrade django==1.3 -E envname just isnt working.

installed django into the virtualenv just this morning and its put
1.2.3 in there. can get it to upgrade to 1.3 at all.

if i recall theres a possibility that a version will be taken down if
there is a security issue? or am i making that up?

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

django postgresql error

hi, im deploying my django app in a webhost (mochahost) and i get this error


MOD_PYTHON ERROR

 
ProcessId:      23641
Interpreter:    'gruporole.com'
 
ServerName:     'gruporole.com'
DocumentRoot:   '/home/gruporol/public_html'
 
URI:            '/services'
Location:       None
Directory:      '/home/gruporol/public_html/'
Filename:       '/home/gruporol/public_html/services'
PathInfo:       ''
 
Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'
 
Traceback (most recent call last):
 
  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)
 
  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)
 
  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)
 
  File "/home/gruporol/soft/django/core/handlers/modpython.py", line 213, in handler
    return ModPythonHandler()(req)
 
  File "/home/gruporol/soft/django/core/handlers/modpython.py", line 191, in __call__
    response = self.get_response(request)
 
  File "/home/gruporol/soft/django/core/handlers/base.py", line 169, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
 
  File "/home/gruporol/soft/django/core/handlers/base.py", line 214, in handle_uncaught_exception
    if resolver.urlconf_module is None:
 
  File "/home/gruporol/soft/django/core/urlresolvers.py", line 274, in _get_urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
 
  File "/home/gruporol/soft/django/utils/importlib.py", line 35, in import_module
    __import__(name)
 
  File "/home/gruporol/soft/role/urls.py", line 4, in <module>
    from django.contrib import admin
 
  File "/home/gruporol/soft/django/contrib/admin/__init__.py", line 3, in <module>
    from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
 
  File "/home/gruporol/soft/django/contrib/admin/helpers.py", line 3, in <module>
    from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
 
  File "/home/gruporol/soft/django/contrib/admin/util.py", line 1, in <module>
    from django.db import models
 
  File "/home/gruporol/soft/django/db/__init__.py", line 78, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
 
  File "/home/gruporol/soft/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
 
  File "/home/gruporol/soft/django/db/utils.py", line 33, in load_backend
    return import_module('.base', backend_name)
 
  File "/home/gruporol/soft/django/utils/importlib.py", line 35, in import_module
    __import__(name)
 
  File "/home/gruporol/soft/django/db/backends/postgresql_psycopg2/base.py", line 9, in <module>
    from django.db import utils
 
ImportError: cannot import name utils
 
in my pc this code work fine but in the hosting gaveme this, what can i do to solve this. help please.


----------------------------------------------------------------------------------------

El ayer es un recuerdo, el mañana es un misterio y el ahora es un regalo...por eso se llama presente.


Ing. Yasmany Cubela Medina:

Linux user 446757

Ubuntu user 13464

Re: django-admin.py startproject mysite

I have just did what you said and the result was (no project created)
and the output was:
--------------------------------------------


Usage: django-admin.py subcommand [options] [args]

Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal
output,
2=all output
--settings=SETTINGS The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't
provided, the
DJANGO_SETTINGS_MODULE environment variable
will be
used.
--pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
--traceback Print traceback on exception
--version show program's version number and exit
-h, --help show this help message and exit

Type 'django-admin.py help <subcommand>' for help on a specific
subcommand.

Available subcommands:
cleanup
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
reset
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqlflush
sqlindexes
sqlinitialdata
sqlreset
sqlsequencereset
startapp
startproject
syncdb
test
testserver
validate
--------------------------------------------------------

while surfing the net I found this solution, write in the console

python C:\Python27\Scripts\django-admin.py startproject mysite


I don't know if there is another solution instead of writing the above
line every time or not.

thanks for help.

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

Re: django form inputs

2011/4/30 Pulkit Mehrotra <mehrotra.pulkit@gmail.com>:

>from wishlist.models import wish
>from wishlist.forms import wish

After a quick glance: you're binding wishlist.forms and wishlist
models to the same name.

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

django form inputs

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/mysite/wish

Django Version: 1.3
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'wishlist']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  89.                     response = middleware_method(request)
File "/usr/local/lib/python2.7/dist-packages/django/middleware/common.py" in process_request
  68.                     _is_valid_path("%s/" % request.path_info, urlconf)):
File "/usr/local/lib/python2.7/dist-packages/django/middleware/common.py" in _is_valid_path
  154.         urlresolvers.resolve(path, urlconf)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
  342.     return get_resolver(urlconf).resolve(path)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
  252.                     sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
  158.             return ResolverMatch(self.callback, args, kwargs, self.name)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in _get_callback
  170.             raise ViewDoesNotExist("Tried %s in module %s. Error was: %s" % (func_name, mod_name, str(e)))

Exception Type: ViewDoesNotExist at /mysite/wish
Exception Value: Tried WishForm in module wishlist.views. Error was: 'module' object has no attribute 'CharField'

THIS IS MY VIEWS FUNCTION

from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect,HttpResponse
from wishlist.models import wish
from wishlist.forms import wish

def wishlist(request):
    wish_list=wish.objects.all()
    return render_to_response(
        'wishlist/wishlist.html',
        {'list':wish_list}
    )

def WishForm(request):
    if request.method == 'POST':
        form = wish(request.POST)
            if form.is_valid():
                wish.wish = form.cleaned_data['wish']
                wish.wish_date = form.cleaned_data['wish_date']
                wish.save()
    else:
            form = WishForm()       
    return render_to_response('wishlist/wish_form.html', {'form': form, })

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

Re: django help

Read the static-files docs

On Sat, Apr 30, 2011 at 4:14 AM, Sunil Chugh <sunilchugh08@gmail.com> wrote:
how can i used static_root

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




--
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

Jamie Zawinski, in comp.emacs.xemacs

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

Re: django-admin.py startproject mysite

The path of django-admin.py is YOUR_PYTHON_PATH\Lib\site-packages\django\bin
after this, you can just type django-admin.py startproject mysite to start a project.
but make sure that your .py file default open by Python, if not, right-click(Shift + right-click in XP) a .py file and select open with..., choose Python, or remove file association in you Notepad++
On Sat, Apr 30, 2011 at 5:39 PM, Daisy <omnia.zayed@gmail.com> wrote:
Thank you for your reply,
Python is in my system PATH but How to add django-admin in my path. I
mean what will be the enviroment variable for django-admin that i have
to put in my system PATH?

On Apr 30, 4:37 am, Yongning Liang <liangyongn...@gmail.com> wrote:
> type this in Windows
> python django-admin.py startproject mysite
> if it doesn't work, make sure that both python and django-admin in you
> system PATH
>
>
>
>
>
>
>
> On Sat, Apr 30, 2011 at 5:38 AM, Daisy <omnia.za...@gmail.com> wrote:
> > Greetings all;
>
> > I have a problem also with the "django-admin.py startproject mysite"
> > command
>
> > when i type it, it didn't create the directory mysite instead it opens
> > the django-admin.py in a notepad++
>
> > I don't know how to fix this?
> > any ideas please.
>
> > --
> > 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+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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: How do I set permissions for manual install of 1.3 for ubuntu 11.04?

I figured it out, i chmod -R 775 the django directory located in /usr/local/lib/python2.7/dist-packages and was able to use the commands without sudo. Whether or not that's a good idea, I don't know, but it's my personal laptop anyway. Thanks for tying to help Shawn. Much appreciated.

Regards,
Joshua Sierra

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

Re: How do I set permissions for manual install of 1.3 for ubuntu 11.04?

well, i install using sudo setup.py install and django is installed in /usr/local/lib/python2.7/dist-packages. Everything works fine when I use sudo before each command. I just want to make it less strict in that regard and allow myself to use the commands without having to sudo. I am not sure whether i have to set permissions on the django install (chmod?) or on the directory that contains my django projects (which reside in another partition). Maybe I'm asking in the wrong place...

Regards,
Joshua Sierra

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

Re: django-admin.py startproject mysite

Thank you for your reply,
Python is in my system PATH but How to add django-admin in my path. I
mean what will be the enviroment variable for django-admin that i have
to put in my system PATH?

On Apr 30, 4:37 am, Yongning Liang <liangyongn...@gmail.com> wrote:
> type this in Windows
> python django-admin.py startproject mysite
> if it doesn't work, make sure that both python and django-admin in you
> system PATH
>
>
>
>
>
>
>
> On Sat, Apr 30, 2011 at 5:38 AM, Daisy <omnia.za...@gmail.com> wrote:
> > Greetings all;
>
> > I have a problem also with the "django-admin.py startproject mysite"
> > command
>
> > when i type it, it didn't create the directory mysite instead it opens
> > the django-admin.py in a notepad++
>
> > I don't know how to fix this?
> > any ideas please.
>
> > --
> > 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Print "flash" messages in templates for certain levels

Hi,
django.contrib.messages is very handy and useful app. When I use it in
template I'd like to print in one place in template only messages with
certain level. That's not possible as I can understand it. You can
print all of them (as described in documentation):

{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}
>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}

But you can't print only for example success messages like:
{% for message in messages.success %}


Use case is for example if you want to print different level of
messages for different type of users (administrators, users etc.). Or
you don't want to print all type of level messages unordered but want
to print some levels first and some others later on the page.

Have you been discovered similar use cases? Would it be useful to add
"level as a list behaviour messages.whatever" in template? Or is there
other better solution?

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

django help

how can i used static_root

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

Friday, April 29, 2011

queryset._clone() in generic views

What is 'queryset = queryset._clone()' statement in
django.views.generic.list_detail.object_list view used for?
Has it something to do with prevention of usage of cached results, to
allow QuerySet to reflect changes made to the database?
Should I use _clone(), too, if I'm reimplementing this view in order
to add some filtering? Or, maybe, I should use QuerySet.all() method
instead (i.e., 'queryset = queryset.all())?

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

Re: How do I set permissions for manual install of 1.3 for ubuntu 11.04?

What's the actual command you're typing, and from which directory?

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

Re: please help

more  over how to use the admin django login system in my own created templates and views.
please help lil bit desciptively.

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

please help

for a particular project with login system which type u all suggest is the best.

1. login system to be create by self model
2. to use the login system provided by 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

How do I set permissions for manual install of 1.3 for ubuntu 11.04?

I installed django 1.3 manually on my laptop, since ubuntu 11.04 does not ship with 1.3 and I want to be able to run django-admin without having to sudo the command when creating projects and subsequently having to use sudo with manage.py. I want to mimic whatever permissions that allowed me to use the django-admin as a normal user, just like the ubuntu package does.

Here is the error i get with running django-admin without sudo:

Traceback (most recent call last):
  File "/usr/local/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 429, in execute_from_command_line
   
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
   
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 322, in handle
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/startproject.py", line 30, in handle_label
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 407, in copy_helper
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/django/conf/project_template/settings.py'

Regards,
Joshua Sierra

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

Re: Does django 1.3 has a ubuntu deb package released!

It's always better to download the latest, and use virtualenv.

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

Re: Using composition in Django

Thanks for the clarification, I put in the ForeignKey in employee class and is working.
Regards!

2011/4/27 Tom Evans <tevans.uk@googlemail.com>
On Sun, Apr 17, 2011 at 9:21 PM, W Craig Trader <craig.trader@gmail.com> wrote:
> If your goal is to have an employee object that has direct access to all of
> its related person object, and whose only new data field is a reference to
> an address object, then you should change the Employee model to this:
>
> class Address(models.Model):
>    pass
>
> class Person(models.Model):
>    name = models.CharField(max_length=50)
>    date_inclusion = models.DateField()
>
> class Employee(models.Model):
>    person = models.OneToOneField(Person)
>    address = models.ForeignKey(Address)
>

Just to point out, this is MTI reinvented, without any of the Django
syntactic magic sprinkled on top. It is exactly equivalent to this:

class Address(models.Model):
   pass

class Person(models.Model):
   name = models.CharField(max_length=50)
   date_inclusion = models.DateField()

class Employee(Person):
   address = models.ForeignKey(Address)

"""
The second type of model inheritance supported by Django is when each
model in the hierarchy is a model all by itself. Each model
corresponds to its own database table and can be queried and created
individually. The inheritance relationship introduces links between
the child model and each of its parents (via an automatically-created
OneToOneField).
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+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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Does django 1.3 has a ubuntu deb package released!

In the repository of ubuntu 10.04.2 the version 1.1.1 is available, better download version 1.3 of the Django site and install. Is very easy.
Regards!


2011/4/29 Korobase <boyee118@gmail.com>
Does django 1.3 has a ubuntu deb package released !
I have googled but get none,Any one have done this?
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+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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.