Re: Code written by Senior Django Developers

2023-06-11 Thread Babatunde Akinyanmi
Hi Joseph,
Django is open source. Feel free to dive in. Or better still, go through
pull requests so that you can see the context for parts of the code and
also what functionality they provide.

On Sun, 11 Jun 2023 at 20:00, Joseph Balogun  wrote:

> Hi Django fam!
>
> Can you pls recommend a resource where I can get reliable Django/Python
> code?
>
> I recently learned about code transcription- that by writing and analyzing
> code written by Senior Django Developers, I can become a better programmer.
>
> Your input would be greatly appreciated.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/17f8c6ee-bf6e-42a6-9449-b2149f990672n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BWjgXPreEO2BsqRB5c1_jBzic%2BftNK5v1V5jse4zPaVQkjJ_A%40mail.gmail.com.


Re: django-db-log import Exception

2012-01-30 Thread Babatunde Akinyanmi
Seems like the app depends on paginator. Why not install the paginator app?


On 1/30/12, Timothy Makobu  wrote:
> Hi all,
>
> I'm on Django 1.3
>
> I just now installed django-db-log via pip, but after adding it to
> installed_apps, I get this Exception:
>
> Traceback (most recent call last):
>   File "/bundles/port-8233/app_image/epio_wsgi.py", line 32, in __call__
> output = wsgi_entrypoint(environ, self.start_response)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py",
> line 273, in __call__
> response = self.get_response(request)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
> line 169, in get_response
> response = self.handle_uncaught_exception(request, resolver,
> sys.exc_info())
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
> line 214, in handle_uncaught_exception
> if resolver.urlconf_module is None:
>   File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py",
> line 274, in _get_urlconf_module
> self._urlconf_module = import_module(self.urlconf_name)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File "/bundles/port-8233/app_image/redapps/urls.py", line 5, in
> admin.autodiscover()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py",
> line 26, in autodiscover
> import_module('%s.admin' % app)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File
> "/bundles/port-8233/app_image/pyenv/lib/python2.7/site-packages/djangodblog/admin.py",
> line 4, in
> from django.contrib.admin.views.main import ChangeList, Paginator
> ImportError: cannot import name Paginator
>
>
> --
> sent from my two tin cans via hangerwire
>
> --
> 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

-- 
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-db-log import Exception

2012-01-30 Thread Babatunde Akinyanmi
**scratching head**
So are you saying you have paginator installed already? Cos your
traceback says you have a admin.py file in a djangodblog directory and
that file is trying to import paginator which it can't find. That's
the root of the error being thrown

On 1/30/12, Timothy Makobu  wrote:
> It's trying to import it from django.contrib.admin.views.main
>
>
> On Mon, Jan 30, 2012 at 4:29 PM, Babatunde Akinyanmi
> wrote:
>
>> Seems like the app depends on paginator. Why not install the paginator
>> app?
>>
>>
>> On 1/30/12, Timothy Makobu  wrote:
>> > Hi all,
>> >
>> > I'm on Django 1.3
>> >
>> > I just now installed django-db-log via pip, but after adding it to
>> > installed_apps, I get this Exception:
>> >
>> > Traceback (most recent call last):
>> >   File "/bundles/port-8233/app_image/epio_wsgi.py", line 32, in __call__
>> > output = wsgi_entrypoint(environ, self.start_response)
>> >   File
>> > "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py",
>> > line 273, in __call__
>> > response = self.get_response(request)
>> >   File
>> > "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
>> > line 169, in get_response
>> > response = self.handle_uncaught_exception(request, resolver,
>> > sys.exc_info())
>> >   File
>> > "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py",
>> > line 214, in handle_uncaught_exception
>> > if resolver.urlconf_module is None:
>> >   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py",
>> > line 274, in _get_urlconf_module
>> > self._urlconf_module = import_module(self.urlconf_name)
>> >   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
>> > line 35, in import_module
>> > __import__(name)
>> >   File "/bundles/port-8233/app_image/redapps/urls.py", line 5, in
>> > admin.autodiscover()
>> >   File
>> >
>> "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py",
>> > line 26, in autodiscover
>> > import_module('%s.admin' % app)
>> >   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
>> > line 35, in import_module
>> > __import__(name)
>> >   File
>> >
>> "/bundles/port-8233/app_image/pyenv/lib/python2.7/site-packages/djangodblog/admin.py",
>> > line 4, in
>> > from django.contrib.admin.views.main import ChangeList, Paginator
>> > ImportError: cannot import name Paginator
>> >
>> >
>> > --
>> > sent from my two tin cans via hangerwire
>> >
>> > --
>> > 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
>>
>> --
>> 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 two tin cans via hangerwire
>
> --
> 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

-- 
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-db-log import Exception

2012-01-30 Thread Babatunde Akinyanmi
Oh I see. I was reading djangodblog as django-dblog instead of
django-db-log so I was thinking djangodblog was a directory you
created yourself.

As long as Paginator remains on that line there's no way to go
forward. If I was you, I'd try to go through the source and figure out
if Paginator should be in the source.

To me it looks like the app was shipped broken. Maybe if you go
through the source, you might find that removing Paginator would mend
things.

On 1/30/12, Timothy Makobu  wrote:
> This is how Paginator is imported
> https://docs.djangoproject.com/en/dev/topics/pagination/
>
> from django.core.paginator import Paginator
>
> (this is part of django.core on my 1.3, so doesn't need installing)
>
> This is how djangodblog is trying to import it:
>
> from django.contrib.admin.views.main import ChangeList, Paginator
>
> ..
>
> see the difference?
>
> --
> 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

-- 
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-db-log import Exception

2012-01-30 Thread Babatunde Akinyanmi
Hi Tim,
Django-db-log is no longer maintained. Its like its not compatible
with 1.3. Use django-sentry instead.

On 1/30/12, Timothy Makobu  wrote:
>  right.
>
> Hi guys. If someone could kindly alert the dev? I emailed him already
> but no response yet. Pip needs to pick up the fixed  dangodblog as a
> dep where the app is hosted. It's all automated.
>
>
> On Mon, Jan 30, 2012 at 6:45 PM, Babatunde Akinyanmi
>  wrote:
>> Oh I see. I was reading djangodblog as django-dblog instead of
>> django-db-log so I was thinking djangodblog was a directory you
>> created yourself.
>>
>> As long as Paginator remains on that line there's no way to go
>> forward. If I was you, I'd try to go through the source and figure out
>> if Paginator should be in the source.
>>
>> To me it looks like the app was shipped broken. Maybe if you go
>> through the source, you might find that removing Paginator would mend
>> things.
>>
>> On 1/30/12, Timothy Makobu  wrote:
>>> This is how Paginator is imported
>>> https://docs.djangoproject.com/en/dev/topics/pagination/
>>>
>>> from django.core.paginator import Paginator
>>>
>>> (this is part of django.core on my 1.3, so doesn't need installing)
>>>
>>> This is how djangodblog is trying to import it:
>>>
>>> from django.contrib.admin.views.main import ChangeList, Paginator
>>>
>>> ..
>>>
>>> see the difference?
>>>
>>> --
>>> 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
>>
>> --
>> 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 two tin cans via hangerwire
>
> --
> 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

-- 
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: Hosting Alwaysdata: install dajax libraries

2012-01-30 Thread Babatunde Akinyanmi
Alwaysdata allows you to install your own apps. Alwaysdata also IMHO
the best customer support available.

First search the forum at http://forum.alwaysdata.com and if you don't
get the instructions there, log in to your admin account
(http://admin.alwaysdata.com), click on support and then raise a
ticket.

On 1/30/12, ElDoge  wrote:
> Hi, I am a newbie of Django and I have to try a web application (not
> made by me, but founded in the web)  that manages the shifts rounds of
> the volunteers of my association.
>
> I installaed it into alwaysdata.com free hosting, but the web app need
> the dajax and dajaxice library. It is possible to install it in the
> free hosting? How?
>
> Thanks for you 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
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: same code runs on two machines and barfs on the third

2012-02-06 Thread Babatunde Akinyanmi
Perhaps you made a change to a model and forgot to syncdb on your
Fedora 15 machine.

On 2/7/12, kenneth gonsalves  wrote:
> hi,
>
> this is the relevant part of my model:
>
> class Team(models.Model):
> name = models.CharField(_("Team Name"),max_length=150,unique=True)
> members =
> tournament = models.ForeignKey(Tournament)
>
> in my view I have the following line of code:
> cr = Team.objects.filter(tournament_id=tournid)
>
> I have three installations of this app. All have the latest trunk (all
> the same version). The only difference between the three is that one is
> on Fedora 14, one on Fedora 15 and one on Fedora 16. Deployment is the
> same. All are on python 2.7 with slightly differing versions of
> postgresql. On Fedora 14 and 16 the code runs ok. On Fedora 15, django
> barfs saying:
> 'cannot resolve tournament_id into a field, fields available are: name,
> tournament ...'
>
> any clues?
> --
> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Finding It Hard To Make It Work!

2012-02-08 Thread Babatunde Akinyanmi
Use AJAX or asynchronous programming

On 2/8/12, coded kid  wrote:
> Hello, I want to make the below codes let users update their status in
> the Django . And their update should display on the same template. But
> it’s not working.  E.g when a user type in “To be a hacker is not a
> day’s job” in the status textarea and click on update button below the
> form. The update should display on the same template for his or her
> friends to see. Just like how we post status update on fb.
>
> In models.py
> from django.contrib.auth.models import User
> from django.forms import ModelForm, Textarea, HiddenInput
> from django.db import models
>
>
>
> class mob (models.Model):
> username=models.ForeignKey(User, unique=True)
> state_province=models.CharField(max_length=50)
> body=models.TextField(max_length=1)
> date=models.DateTimeField()
>
> def __unicode__(self):
> return u"%s - %s - %s - %s" % (self.username,
> self.state_province, self.body,   self.date)
>
> def get_absolute_url(self):
> return "/post/%s/" % unicode(self.id)
> def get_author_url(self):
> return "/u/%s/p/0" % (self.username)
>
> class mobForm(ModelForm):
> class Meta:
> model=mob
> fields=('body','username','state_province','date')
> widgets={
> 'body':Textarea(attrs={"rows":2, "cols":40}),
> 'username': (HiddenInput),
> 'state_province': (HiddenInput),
> 'date':(HiddenInput),
> }
>
>
> In views.py
> from myweb.meekapp.models import mobForm, mob
> from django.shortcuts import render_to_response
> from django.contrib.auth.models import User
> from django.http import HttpResponse, Http404
> from django.template import RequestContext
> from django.http import HttpResponseRedirect
>
> def homey(request):
>  #if there’s nothing in the field do nothing.
> if request. method != "":
> return HttpResponseRedirect('/homi/')
>
> newmob=mob()
> newmob.username=request.user
> newmob.date=datetime.datetime.now()
> newmob.body=request.POST['body']
> if request.POST['body'] <> '':
> newmob.body=body.objects.get(id=request.POST['body'])
> newmob.save()
> return HttpResponseRedirect('/homi/')
> else:
> return render_to_response('meek_home.html', {'mobForm':
> mobForm },context_instance=RequestContext(request))
>
>
>
>
> in template
>
> {% extends "base_meek.html" %}
>   {% block body %}
>
>   
> 
>   {{ mobForm }}
> 
> 
>   
>{% endblock %}
>
>
>
> What am I doing wrong? Would love to hear your opinion.
>
>
> --
> 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

-- 
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: Comments Link- How to?

2012-02-13 Thread Babatunde Akinyanmi
Please Rephrase. I don't get the part of "comment link name"

On 2/13/12, coded kid  wrote:
> Hi Guys, How can I link to “Django Comment form”, so that when a user
> clicks on the “Comment Link Name” It will display the Comment Form on
> the same page with the post. I hope you get my point? If you do please
> answer and if you don’t ask me to explain further.
>
> --
> 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

-- 
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: sqlite3 database error

2012-02-13 Thread Babatunde Akinyanmi
After specifying the path to where you want your sqlite database to be
i.e db name setting, after your syncdb, the database will be created
automatically if it doesn't already exist in the path you stated.

On 2/13/12, Marcus Maximus  wrote:
> Hey guys,
>
> i am using sqlite3 for my django app. BUT I have problems installing
> it. Here are my configs:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',  # Add
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-
> win32-x86-3071000\test.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.
> }
> }
>
> I tried this:
>
 from django.db import connection
 cursor = connection.cursor()
>
> But I got this error:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Python27\lib\site-packages\django\db\backends\__init__.py",
> line 250,
>  in cursor
> cursor = self.make_debug_cursor(self._cursor())
>   File "C:\Python27\lib\site-packages\django\db\backends
> \sqlite3\base.py", line
> 207, in _cursor
> self.connection = Database.connect(**kwargs)
> OperationalError: unable to open database file
>
> Can sb pls help me?
>
> greetings
>
> Maximus
>
> PS.: I created my sqlite3 file like that:
>
>>sqlite3 test.db
> ...>
> ...>
> ...>);
> ...>Syntax error
>>
>
> Can sb show me a better way to create an empty sqlite3 db file?
>
> --
> 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

-- 
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: Comments Link- How to?

2012-02-13 Thread Babatunde Akinyanmi
Oh ok. Just render the comments as usual then use jquery of pure
javascript to hide it by default. Tie the link to the onclick event
such that it triggers the unhiding of the comment div. Simple.


On 2/13/12, coded kid  wrote:
> Okay. Just like this.  Comment
> Link Name 
>
> Where "Comment Link Name" is the name you want to give to your link.
> So when a user click on it, it should show the comment form on the
> same page.  I hope you now get my point?
>
> On Feb 13, 1:26 pm, Babatunde Akinyanmi  wrote:
>> Please Rephrase. I don't get the part of "comment link name"
>>
>> On 2/13/12, coded kid  wrote:
>>
>> > Hi Guys, How can I link to “Django Comment form”, so that when a user
>> > clicks on the “Comment Link Name” It will display the Comment Form on
>> > the same page with the post. I hope you get my point? If you do please
>> > answer and if you don’t ask me to explain further.
>>
>> > --
>> > 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
>
> --
> 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: DATABASE in settings file not working

2012-02-17 Thread Babatunde Akinyanmi
Try to connect to mysql with the same credentials on your terminal. If
it doesn't work then you need to reset your root password.

sudo dpkg-reconfigure mysql-server-5.1

Should do the trick and then restart the server (That works on ubuntu).

Also you should consider creating a separate user instead of using root.

On 2/17/12, Detectedstealth  wrote:
> Hi,
>
> I am just coming back to django development after a while of
> developing with pyramid. I have taking over an application.
>
> For some reason with the newest version of django it is not reading
> the password I set in settings:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'mydatabase',  # Or path to
> database file if using sqlite3.
> 'USER': 'root',  # Not used with sqlite3.
> 'PASSWORD': 'mypassword',  # 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.
> }
> }
>
> When starting the server I get the following error:
> ...MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/connections.py",
> line 187, in
> __init__
> _mysql_exceptions.OperationalError: (1045, "Access denied for user
> 'root'@'localhost' (using password: NO)")
>
> Not sure why it is saying there was not password. For the newest
> version of django is there a new way to tell python manage.py
> runserver what password/username/database to use?
>
> --
> 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

-- 
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: DATABASE in settings file not working

2012-02-17 Thread Babatunde Akinyanmi
Yes I do get it. I didn't realize that while I was typing my reply
your message had already been delivered to the group.

On 2/17/12, Detectedstealth  wrote:
> I can connect with the same credentials that isn't the problem.
>
> The problem is if I set a password in settings.py it doesn't use a
> password as the error message states. However when I force the
> settings file with the --settings option then it reads the file
> correctly and uses the password.
>
> On Feb 17, 7:06 am, Babatunde Akinyanmi  wrote:
>> Try to connect to mysql with the same credentials on your terminal. If
>> it doesn't work then you need to reset your root password.
>>
>> sudo dpkg-reconfigure mysql-server-5.1
>>
>> Should do the trick and then restart the server (That works on ubuntu).
>>
>> Also you should consider creating a separate user instead of using root.
>>
>> On 2/17/12, Detectedstealth  wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > Hi,
>>
>> > I am just coming back to django development after a while of
>> > developing with pyramid. I have taking over an application.
>>
>> > For some reason with the newest version of django it is not reading
>> > the password I set in settings:
>>
>> > DATABASES = {
>> >     'default': {
>> >         'ENGINE': 'django.db.backends.mysql', # Add
>> > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>> >         'NAME': 'mydatabase',                      # Or path to
>> > database file if using sqlite3.
>> >         'USER': 'root',                      # Not used with sqlite3.
>> >         'PASSWORD': 'mypassword',                  # 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.
>> >     }
>> > }
>>
>> > When starting the server I get the following error:
>> > ...MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/connections.py",
>> > line 187, in
>> > __init__
>> > _mysql_exceptions.OperationalError: (1045, "Access denied for user
>> > 'root'@'localhost' (using password: NO)")
>>
>> > Not sure why it is saying there was not password. For the newest
>> > version of django is there a new way to tell python manage.py
>> > runserver what password/username/database to use?
>>
>> > --
>> > 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
>
> --
> 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

-- 
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: Dumb newbie question

2012-02-17 Thread Babatunde Akinyanmi
I'm also a noob. If I had code that would use the same models then I
would keep everything inside one app but divide them into modules

On 2/17/12, Bob Carlson  wrote:
> I'm well into beginning building my actual app after going through the
> tutorial,
> but I have no feel yet for the answer to this question.
>
>
>
> Can apps share a set of models? My application neatly divides into three
> pieces,
> but all the pieces share the same data. Should these be 3 apps or 1? Can
> apps
> freely share access to data models?
>
>
>
> Cheers, Bob
>
>
>
> --
> 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

-- 
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: Dumb newbie question

2012-02-17 Thread Babatunde Akinyanmi
I'm also a noob. If I had code that would use the same models then I
would keep everything inside one app but divide them into modules

On 2/17/12, Bob Carlson  wrote:
> I'm well into beginning building my actual app after going through the
> tutorial,
> but I have no feel yet for the answer to this question.
>
>
>
> Can apps share a set of models? My application neatly divides into three
> pieces,
> but all the pieces share the same data. Should these be 3 apps or 1? Can
> apps
> freely share access to data models?
>
>
>
> Cheers, Bob
>
>
>
> --
> 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

-- 
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 am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Babatunde Akinyanmi
@Daniel
Your __unicode__ should always return a string  so like Shawn said,
when you check your phone model, its __unicode__ method should be
returning str() or unicode() not int

On 2/20/12, Shawn Milochik  wrote:
> Read the error message in your subject line. Then look at the
> __unicode__ method of your Phone model. It appears that this is the
> problem, and not the Device model.
>
> --
> 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

-- 
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: RemoteUserBackend not creating user

2012-02-20 Thread Babatunde Akinyanmi
I'm not too sure what you are trying to do but there's no part of your
code that tries to create a user.

Maybe you should give more information

On 2/21/12, Roberto Bouza  wrote:
> Hello,
>
> I've been hitting my head pretty hard trying to figure out what the
> problem is hope someone here can help.
>
> I've set up the remote backends and middleware as per the docs and
> blatantly I'm coding the META remote_user and nothing happens. like
> this:
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.auth.middleware.RemoteUserMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> )
>
> AUTHENTICATION_BACKENDS = (
> 'django.contrib.auth.backends.RemoteUserBackend',
> )
>
> Then on my view:
>
> def login_(request):
> request.META['REMOTE_USER'] = 'test123'
> try:
> user = User.objects.get(username=request.META['REMOTE_USER'])
> logger.debug("got user: %s, %s", user.last_name,
> user.first_name)
> except ObjectDoesNotExist:
> logger.debug("username: %s, does not exist",
> request.META['REMOTE_USER'])
>
> return render_to_response('myapp/dashboard.html',
> {'section':'dashboard'}, context_instance=RequestContext(request))
>
> All goes as planned, but the user is not being created. Am I missing
> something here?
>
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
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 project directory not defined when starting :

2012-02-21 Thread Babatunde Akinyanmi
Hi niceseb,
Please be more specific about what you mean by nothing happens. That
way you'll be able to quickly get useful assistance.

On 2/21/12, niceseb  wrote:
> Hi Python experts,
>
> I want to start a new project with :
>
> C:\Users\Django_Projects>django-admin.py startproject mysite
>
> but nothing happens
>
> I have already checked that I have Python and Django installed and
>
> defined Env Path: C:\Python27\Lib\site-packages\django\bin, where the
> django_admin.py is defined
>
> Though I am not sure C:\Python27\Scripts also has this django-admin.py
> file defined too?
>
> But if so it is not in the Path right? Should I remove one of them?
>
> --
> 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

-- 
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 Comments-Redirecting

2012-02-23 Thread Babatunde Akinyanmi
dude,
change {% url
 %}" /> to
your own custom view like the view you used to load the page where you
are collecting the comments.

Don't mean to be harsh but what were you thinking?

django.contrib.comments.views.comments.comment_done by default
redirects to the "Thanks for your comment" page.

On 2/23/12, coded kid  wrote:
> Hi guys, how can I get rid of users being directed to the “Thanks you
> for your comment” page after commenting  in Django site? I users to be
> redirected to the same page they commented.  I’m using Django
> comments.
>
> I’ve tried adding:
>
>  django.contrib.comments.views.comments.comment_done %}" />
>
> But it’s not working. Below is codes in my comment/form.html
>
> {% load comments %}
> {% get_comment_count for sol as comment_count %}
> {% get_comment_list for sol as comment_list %}
> {% get_comment_form for sol as form %}
> {% if user.is_authenticated %}
>
> {% csrf_token %}
> {% if next %}{% endif %}
> {% for field in form %}
> {% if field.is_hidden %}
> {{ field }}
> {% else %}
> {% if field.name != "name" and field.name != "email"
> and field.name != "url" %}
> {% if field.errors %}{{ field.errors }}{% endif %}
> {{ field }}
> {% endif %}
> {% endif %}
> {% endfor %}
>   >
>
> {% else %}
> I'm sorry, but you must be logged in to submit comments.
> {% endif %}
>
> --
> 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 Comments-Redirecting

2012-02-23 Thread Babatunde Akinyanmi
:)
Keep going maiyte but don't burnt out.

On Fri, Feb 24, 2012 at 4:24 AM, coded kid  wrote:

> Thanks man! I've changed it to {{request.path}}.
>
> Not thinking bout anything. Just might be tired then!
>
> On Feb 23, 4:30 pm, Babatunde Akinyanmi  wrote:
> > dude,
> > change {% url
> >  %}" /> to
> > your own custom view like the view you used to load the page where you
> > are collecting the comments.
> >
> > Don't mean to be harsh but what were you thinking?
> >
> > django.contrib.comments.views.comments.comment_done by default
> > redirects to the "Thanks for your comment" page.
> >
> > On 2/23/12, coded kid  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi guys, how can I get rid of users being directed to the “Thanks you
> > > for your comment” page after commenting  in Django site? I users to be
> > > redirected to the same page they commented.  I’m using Django
> > > comments.
> >
> > > I’ve tried adding:
> >
> > >  > > django.contrib.comments.views.comments.comment_done %}" />
> >
> > > But it’s not working. Below is codes in my comment/form.html
> >
> > > {% load comments %}
> > > {% get_comment_count for sol as comment_count %}
> > > {% get_comment_list for sol as comment_list %}
> > > {% get_comment_form for sol as form %}
> > > {% if user.is_authenticated %}
> > >
> > > {% csrf_token %}
> > > {% if next %}{% endif %}
> > > {% for field in form %}
> > > {% if field.is_hidden %}
> > > {{ field }}
> > > {% else %}
> > > {% if field.name != "name" and field.name != "email"
> > > and field.name != "url" %}
> > > {% if field.errors %}{{ field.errors }}{% endif %}
> > > {{ field }}
> > > {% endif %}
> > > {% endif %}
> > > {% endfor %}
> > > value="Comment" /
> >
> > >
> > > {% else %}
> > > I'm sorry, but you must be logged in to submit comments.
> > > {% endif %}
> >
> > > --
> > > 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: Django ExtraField

2012-02-27 Thread Babatunde Akinyanmi
Hi coded,
You can't get rid of that field and expect the comment framework to
work right. Other posters have suggested that you use a hiddenField
widget on your form class (you are using a custom comment model
right?). If that's not going smoothly, then you should do it with CSS
ie add a class selector to the honeypot field and then display: none;
(you are familiar with css right?)

If this is still confusing, you should find this useful:
stackoverflow.com/questions/4397403/how-to-format-form-fields-for-django-comments

Holla if you get it right and if you don't

On 2/27/12, coded kid  wrote:
> So you mean I will override the template? Since I will be making the
> correction is the models.
>
> On Feb 25, 3:12 pm, Carlos Leite  wrote:
>> On Fri, Feb 24, 2012 at 2:14 PM, coded kid  wrote:
>> > Sorry, How will I set that? is it from the template?
>>
>> no, its a widget ...
>>
>> you have to set the widget on your form class
>>
>> Class MyForm(model / form)
>>    hide_field = forms.CharField(widget=forms.HiddenInput)
>
> --
> 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

-- 
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 with Mac OS X

2012-02-27 Thread Babatunde Akinyanmi
I've never used mac OS but try:
python django-admin.py startproject mysite

On 2/28/12, JChlipala  wrote:
> Hello,
>
> I am a Django beginner, and am trying to get Django set up in Mac OS
> X.  I am going through the tutorial, but getting stuck very early
> (essentially at the beginning).  I have installed Python and Django.
> The next instruction is to enter the command "django-admin.py
> startproject mysite".  When I do this, I get the following error:
>
> File "", line 1
> django-admin.py startproject mysite
> ^
>
> SyntaxError:  invalid syntax
>
> Does anybody know why I am getting this error?  The tutorial has a
> note for Mac OS X users explaining what to do if you get a "permission
> denied" error, but that is obviously not what is happening to me.
>
> Thank you for any 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
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 actions logging app

2012-02-28 Thread Babatunde Akinyanmi
Yes, they definitely will.

On 2/28/12, akaariai  wrote:
> On Feb 28, 11:35 pm, Mario Gudelj  wrote:
>> Hi list,
>>
>> I was wandering if someone could recomend an easy django app for logging
>> user actions performed on models. I'd like to log changes logged in users
>> make around the app.
>
> I think there are some apps out there. The first question however is
> do you want to log "user a changed object b" or do you need an audit
> trail also, that is do you need to have the information of user a
> changed object b's field c from value "foo" to value "bar".
>
> I really am not the one to tell you which app is the correct one. I
> usually have a small create_log_entry() method for creating entries
> for modifications, and database triggers for the audit trail. The
> create_log_entry is often the right way to go, as more often than not
> I want to set all changes to the "main" record. That is, if somebody
> changes an article's attachment, it is the article that needs to have
> the changed log entry, not the attachment.
>
> The log entry model is something like this:
> class LogEntry(object):
> to_pk = models.IntegerField() #lets assume you are working only
> with integer primary keys
> to_type = models.CharField(max_length=40, choices=(('article',
> 'Article'), ...))
> mod_type = choices "INSERT/UPDATE/DELETE"
> who = FK(user)
> what = models.TextField() # A "comment" for the edit
> when = models.DateTimeField()
> @classmethod
> def create_log_entry(cls, to_obj, edit_type, user, what_done):
>   ...
>
> Combined with database-level triggers you can get a good audit trail.
> I have some scripts to ease maintain the DB triggers for PostgreSQL
> when using Django. I hope I will have some time to polish them for
> release, I believe they could be some use for the community.
>
>  - Anssi
>
> --
> 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

-- 
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: Displaying Updates

2012-03-14 Thread Babatunde Akinyanmi
What's your algorithm?

On 3/13/12, coded kid  wrote:
> Hi Guys, how can I make users who are following each other view their
> status update on their walls? In my project, users can follow and
> unfollow each other but the problem I’m facing is that, both of them
> can’t see each other statuses on their wall.
>
> I’m using a caffinehit/django follow package that handles following of
> users.
>
> I would be glad if you can try and answer this question!
>
> --
> 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

-- 
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: Displaying Updates

2012-03-14 Thread Babatunde Akinyanmi
Hi coded,
You just mentioned the features of your app not the algorithm you are
using for getting updates to a wall.
For example algorithm for authenticating a user could be:
*if user name submitted exists in database, hash submitted password
*compare hash with hash saved in database linked with user name. If
equal, authenticate


On 3/14/12, coded kid  wrote:
>
> 1. User will be able to find each other
> 2. follow each other if they feel like (it's not necessary the second user
> follow back)
> 3. followers will be able to see the users they are following updates on
> their own wall.
>
>
> On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>>
>> What's your algorithm?
>>
>> On 3/13/12, coded kid  wrote:
>> > Hi Guys, how can I make users who are following each other view their
>> > status update on their walls? In my project, users can follow and
>> > unfollow each other but the problem I’m facing is that, both of them
>> > can’t see each other statuses on their wall.
>> >
>> > I’m using a caffinehit/django follow package that handles following of
>> > users.
>> >
>> > I would be glad if you can try and answer this question!
>> >
>> > --
>> > 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
>>
>>
> On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>>
>> What's your algorithm?
>>
>> On 3/13/12, coded kid  wrote:
>> > Hi Guys, how can I make users who are following each other view their
>> > status update on their walls? In my project, users can follow and
>> > unfollow each other but the problem I’m facing is that, both of them
>> > can’t see each other statuses on their wall.
>> >
>> > I’m using a caffinehit/django follow package that handles following of
>> > users.
>> >
>> > I would be glad if you can try and answer this question!
>> >
>> > --
>> > 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
>>
>>
> On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>>
>> What's your algorithm?
>>
>> On 3/13/12, coded kid  wrote:
>> > Hi Guys, how can I make users who are following each other view their
>> > status update on their walls? In my project, users can follow and
>> > unfollow each other but the problem I’m facing is that, both of them
>> > can’t see each other statuses on their wall.
>> >
>> > I’m using a caffinehit/django follow package that handles following of
>> > users.
>> >
>> > I would be glad if you can try and answer this question!
>> >
>> > --
>> > 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
>>
>>
> On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>>
>> What's your algorithm?
>>
>> On 3/13/12, coded kid  wrote:
>> > Hi Guys, how can I make users who are following each other view their
>> > status update on their walls? In my project, users can follow and
>> > unfollow each other but the problem I’m facing is that, both of them
>> > can’t see each other statuses on their wall.
>> >
>> > I’m using a caffinehit/django follow package that handles following of
>> > users.
>> >
>> > I would be glad if you can try and answer this question!
>> >
>> > --
>> > 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
>>
>>
> On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>>
>> What's your algorithm?
>>
>> On 3/13/12, coded kid  wrote:
>> > Hi Guys, how can I make users who are following each other view their
>> > status update on their walls? In my project, users can follow and
>> > unfollow each other but the problem I’m facing is that, both of them
>> > can’t see eac

Re: calculated form field

2012-03-20 Thread Babatunde Akinyanmi
Why not just do:
useage = capital * tax_rate
Instead of your projfin function. In the projfin function, the request
you are passing is also redundant.

As for the error, I don't know how you refactored your models code but
obviously from the error message, you are not passing in ints. You can
try to debug the code by printing capital and tax_rate so you can see
what values are being passed into the function.

On 3/19/12, Tim Ney  wrote:
> Rajeesh,
>
> Following your advice, Im think I've about solved the problem.
> I've got one last exception, I hope.
>
> Here is the new iteration of views.py, all other files remain the same.
> In short the page renders to the screen, the problem arises when values are
> submitted
> to the view.
>
> I get an exception  "can't multiply sequence by non-int of type 'tuple".
> I've created a new
> function that describes the multiplication operation, that is used within
> the render function, this
> is where the error occcrs. I'm not referencing the variables properly, I
> guess.
>
> def calculation(request):
>  """function that computes submission"""
> if request.method == 'POST':
>  form = FinanceTable(request.POST)
>  if form.is_valid():
>cd =form.cleaned_data
>capital = cd['capital'],
>tax_rate = cd['tax_rate'],
>useage = projfin(request, capital, tax_rate)
>response_dict = {'capital' : capital, 'tax_rate' : tax_rate,
> 'useage' : useage}
>return render_to_response('textplusnumbers.html' , response_dict)
>else:
>  form = FinanceTable(
>   initial={'capital' : 1000, 'tax_rate' : .07}
>   )
>
>return render_to_response('textplusnumbers.html' , {'form' : form})
>
> def projfin(request, capital, tax_rate):
>  useage = capital * tax_rate
>  return useage
>
>
>
>
>
>
>
>
>
> On Mon, Mar 19, 2012 at 1:10 PM, Rajeesh Nair wrote:
>
>>
>> Your FormClass expects all 3 fields to be optional (*required=False*).
>> But your code in view always expects them to have integer values. And you
>> end up multiplying values from two blank fields! Either you provide some
>> default value to the fields or rewrite view to use
>> *form.cleaned_data.get*with a default value as 2nd argument to it.
>>
>>
>> On Monday, March 19, 2012 9:11:27 PM UTC+5:30, bolivar4 wrote:
>>
>>>
>>>
>>> "unsupported operand type(s) for *: 'NoneType' and 'NoneType'"
>>>
>>>
>>> class FinanceTable(forms.Form):
>>>capital = forms.IntegerField(required=**False)
>>>tax_rate = forms.DecimalField(required=**False)
>>>useage = forms.IntegerField(required=**False)
>>>
>>  --
>> 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/-/CFfpFTLoPSMJ.
>>
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Multiple Choice Quiz

2012-03-24 Thread Babatunde Akinyanmi
Hi jbr3,
Check scrabala.com
Is it similar to what you are working on?

On 3/23/12, jbr3  wrote:
> Hi again,
>
> I've been trying to figure this out for awhile, but to no avail. I'll
> try to list the problems I've had in understanding it.
>
> 1. I'm not sure what the forms.py file should look like.
>
> Going by Shawn's model, would it be something like:
>
> " class GuessForm(ModelForm):
>   class Meta:
>   model= Guess
>   exclude = ('user') "
>
> This gives me a dropdown list of possible answers, but no form changes
> I've tried to make give me multiple radio buttons or multiple
> checkboxes. Have I selected the wrong model to make the modelform
> from ?
>
> 2. I don't completely understand the concept of using Booleans. I've
> added admin functionality to the app so I can add questions and
> potential answers as well as select (using a checkbox) the correct
> response. Based on the model Shawn provided, selecting one of the
> checkboxes generated in admin makes that choice true and the others
> false. The user's answer needs to be compared against these, but I
> don't understand how I would achieve that. I assume I'm supposed to
> set this up in the form, but I can't get the radio buttons or
> checkboxes to work there. I can successfully submit an answer from the
> dropdown, but I still have no idea how it would be compared to the
> stored boolean value. Do I have to write more code for this ? And what
> would the best way be to retrieve it ?
>
> Also, in the examples I've seen, BooleanField() in forms involves
> creating a list of choices in the form. But it doesn't seem like I
> would need such a thing if I'm just using radio buttons whose value
> will be checked against a changing option for each question. Yet I
> can't really see how an alternative approach would work.
>
> 3. I don't know what the template should look like. It seems like I
> should be mixing the form fields with data passed directly from the
> model by using views. In my view, I've set
> "Question.objects.get(id=1)" to a variable. I've passed that to the
> template. But I've also used "{{ form.as_p }}". That gives me the
> possible answers that had been entered in the admin in the template.
> But, the answers aren't generated as radio buttons with text next to
> them. It seems like I would have to pass the actual text of the
> answers using views (setting "variable.answer_set.all()  to another
> variable and then passing it to the template) and then generate radio
> buttons some other way. When I generated the buttons in the template,
> though, the submission failed. I don't see how these could be checked
> against the boolean value stored for the right answer. And, like I
> said, I can't figure out how to make them work properly with the
> form.
>
> I know I've asked this already, but is it possible for anyone to show
> some sample code so I can understand how this should be done using
> Shawn's models. I've been trying to get this for awhile now, but I
> still don't really understand it. I know there are about fifty
> different questions here, but if anyone could help out in any way it
> would be appreciated.
>
> Thanks
>
>
>
>
> On Mar 14, 11:36 pm, jbr3  wrote:
>> Can anyone help me with some questions I still have about this ? I
>> haven't had much experience with web programming, so trying to
>> understand this is kind of challenging.
>>
>> 1. I created the models Shawn suggested. And I'm now able to add a
>> question and possible answers to it in the admin area. Each possible
>> answer has a checkbox next to it with the "Correct" label from the
>> model. Does setting the correct response require anything more than
>> selecting the appropriate checkbox and saving the question ?
>>
>> 2. I still don't understand how I'm supposed to combine these three
>> models together in order to get the right output for the user. I've
>> been trying different approaches in views.py, forms.py and my
>> template. But I can't really figure out how this should be set up. I
>> don't like to keep asking for such direct examples.
>> But would anyone be able to provide kind of an abstract view based on
>> the model Shawn provided.
>>
>> On Mar 11, 5:16 pm, jbr3  wrote:
>>
>> > Thanks for responding Shawn. I guess I was thinking that if I wanted
>> > to save the user's responses and the correct answers a different model
>> > would be needed for both.
>>
>> > On Mar 11, 4:11 pm, Shawn Milochik  wrote:
>>
>> > > I think I'd do this:
>>
>> > > Models:
>>
>> > >      Question
>> > >          question text
>>
>> > >      Answer
>> > >          question foreign key
>> > >          answer text
>> > >          correct (boolean)
>>
>> > >      Guess
>> > >          user foreign key
>> > >          answer foreign key
>>
>> > > That should be all you need (along with the User model or your own
>> > > method of tracking unique users without forcing them to register).
>>
>> > > I don't understand what your fourth model is for.
>
> --
> You 

Re: Tweepy Status Error

2012-03-25 Thread Babatunde Akinyanmi
What is wrong is clear. process_status is not defined or imported so
that's why you have that error. I don't know about tweepy but maybe
process_status is supposed to be imported from somewhere.

On 3/25/12, coded kid  wrote:
> Hi guys, I been trying to iterate over status, but I’m getting this
> error:
>
> Traceback :
>  File “”, line 2, in 
> NameError: name ‘process_status’ is not defined.
>
> Below is the codes:
>
> from tweepy import Cursor
> for status in Cursor(api.user_timeline).items():
> process_status(status)
>
> What I’m I doing wrong? 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.
>
>

-- 
Sent from my mobile device

-- 
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: Multiple Choice Quiz

2012-03-26 Thread Babatunde Akinyanmi
Ok. Let me send you a gist about how I achieved mine to give you an idea.

On Sat, Mar 24, 2012 at 4:46 PM, jbr3  wrote:

> Babatunde,
>
> Yes, that's basically the same idea. The questions would all be on the
> same page, however, and I wouldn't incorporate the time limit. But,
> that's mostly what I was thinking of.
>
> On Mar 24, 3:08 am, Babatunde Akinyanmi  wrote:
> > Hi jbr3,
> > Check scrabala.com
> > Is it similar to what you are working on?
> >
> > On 3/23/12, jbr3  wrote:
> >
> >
> >
> > > Hi again,
> >
> > > I've been trying to figure this out for awhile, but to no avail. I'll
> > > try to list the problems I've had in understanding it.
> >
> > > 1. I'm not sure what the forms.py file should look like.
> >
> > > Going by Shawn's model, would it be something like:
> >
> > > " class GuessForm(ModelForm):
> > >   class Meta:
> > >   model= Guess
> > >   exclude = ('user') "
> >
> > > This gives me a dropdown list of possible answers, but no form changes
> > > I've tried to make give me multiple radio buttons or multiple
> > > checkboxes. Have I selected the wrong model to make the modelform
> > > from ?
> >
> > > 2. I don't completely understand the concept of using Booleans. I've
> > > added admin functionality to the app so I can add questions and
> > > potential answers as well as select (using a checkbox) the correct
> > > response. Based on the model Shawn provided, selecting one of the
> > > checkboxes generated in admin makes that choice true and the others
> > > false. The user's answer needs to be compared against these, but I
> > > don't understand how I would achieve that. I assume I'm supposed to
> > > set this up in the form, but I can't get the radio buttons or
> > > checkboxes to work there. I can successfully submit an answer from the
> > > dropdown, but I still have no idea how it would be compared to the
> > > stored boolean value. Do I have to write more code for this ? And what
> > > would the best way be to retrieve it ?
> >
> > > Also, in the examples I've seen, BooleanField() in forms involves
> > > creating a list of choices in the form. But it doesn't seem like I
> > > would need such a thing if I'm just using radio buttons whose value
> > > will be checked against a changing option for each question. Yet I
> > > can't really see how an alternative approach would work.
> >
> > > 3. I don't know what the template should look like. It seems like I
> > > should be mixing the form fields with data passed directly from the
> > > model by using views. In my view, I've set
> > > "Question.objects.get(id=1)" to a variable. I've passed that to the
> > > template. But I've also used "{{ form.as_p }}". That gives me the
> > > possible answers that had been entered in the admin in the template.
> > > But, the answers aren't generated as radio buttons with text next to
> > > them. It seems like I would have to pass the actual text of the
> > > answers using views (setting "variable.answer_set.all()  to another
> > > variable and then passing it to the template) and then generate radio
> > > buttons some other way. When I generated the buttons in the template,
> > > though, the submission failed. I don't see how these could be checked
> > > against the boolean value stored for the right answer. And, like I
> > > said, I can't figure out how to make them work properly with the
> > > form.
> >
> > > I know I've asked this already, but is it possible for anyone to show
> > > some sample code so I can understand how this should be done using
> > > Shawn's models. I've been trying to get this for awhile now, but I
> > > still don't really understand it. I know there are about fifty
> > > different questions here, but if anyone could help out in any way it
> > > would be appreciated.
> >
> > > Thanks
> >
> > > On Mar 14, 11:36 pm, jbr3  wrote:
> > >> Can anyone help me with some questions I still have about this ? I
> > >> haven't had much experience with web programming, so trying to
> > >> understand this is kind of challenging.
> >
> > >> 1. I created the models Shawn suggested. And I'm now able to add a
> &

Re: Multiple Choice Quiz

2012-03-26 Thread Babatunde Akinyanmi
jbr3,
https://gist.github.com/2204408
The code is most likely buggy and might be insecure because I'm not really
sure if hackers can use radio buttons to submit malicious stuff.
The idea is using the model structure Shawn gave. I created a custom form
class which extracts some Question instances. Since Answers foreignKey to
Questions, the answers linked to each question can be retrieved. There is a
function that takes these Questions and its related Answers and then
outputs the html for the form such that the Answers are displayed as radio
buttons. If the custom form comes in with data from the request, the
customForm determines how many of them are correct. If you go through the
code you would see how the boolean in Answer can be used to determine the
correct answer.
We can talk about my fee later :D ;)
If you still have issues let me know.

On Mon, Mar 26, 2012 at 11:42 AM, Babatunde Akinyanmi
wrote:

> Ok. Let me send you a gist about how I achieved mine to give you an idea.
>
>
> On Sat, Mar 24, 2012 at 4:46 PM, jbr3  wrote:
>
>> Babatunde,
>>
>> Yes, that's basically the same idea. The questions would all be on the
>> same page, however, and I wouldn't incorporate the time limit. But,
>> that's mostly what I was thinking of.
>>
>> On Mar 24, 3:08 am, Babatunde Akinyanmi  wrote:
>> > Hi jbr3,
>> > Check scrabala.com
>> > Is it similar to what you are working on?
>> >
>> > On 3/23/12, jbr3  wrote:
>> >
>> >
>> >
>> > > Hi again,
>> >
>> > > I've been trying to figure this out for awhile, but to no avail. I'll
>> > > try to list the problems I've had in understanding it.
>> >
>> > > 1. I'm not sure what the forms.py file should look like.
>> >
>> > > Going by Shawn's model, would it be something like:
>> >
>> > > " class GuessForm(ModelForm):
>> > >   class Meta:
>> > >   model= Guess
>> > >   exclude = ('user') "
>> >
>> > > This gives me a dropdown list of possible answers, but no form changes
>> > > I've tried to make give me multiple radio buttons or multiple
>> > > checkboxes. Have I selected the wrong model to make the modelform
>> > > from ?
>> >
>> > > 2. I don't completely understand the concept of using Booleans. I've
>> > > added admin functionality to the app so I can add questions and
>> > > potential answers as well as select (using a checkbox) the correct
>> > > response. Based on the model Shawn provided, selecting one of the
>> > > checkboxes generated in admin makes that choice true and the others
>> > > false. The user's answer needs to be compared against these, but I
>> > > don't understand how I would achieve that. I assume I'm supposed to
>> > > set this up in the form, but I can't get the radio buttons or
>> > > checkboxes to work there. I can successfully submit an answer from the
>> > > dropdown, but I still have no idea how it would be compared to the
>> > > stored boolean value. Do I have to write more code for this ? And what
>> > > would the best way be to retrieve it ?
>> >
>> > > Also, in the examples I've seen, BooleanField() in forms involves
>> > > creating a list of choices in the form. But it doesn't seem like I
>> > > would need such a thing if I'm just using radio buttons whose value
>> > > will be checked against a changing option for each question. Yet I
>> > > can't really see how an alternative approach would work.
>> >
>> > > 3. I don't know what the template should look like. It seems like I
>> > > should be mixing the form fields with data passed directly from the
>> > > model by using views. In my view, I've set
>> > > "Question.objects.get(id=1)" to a variable. I've passed that to the
>> > > template. But I've also used "{{ form.as_p }}". That gives me the
>> > > possible answers that had been entered in the admin in the template.
>> > > But, the answers aren't generated as radio buttons with text next to
>> > > them. It seems like I would have to pass the actual text of the
>> > > answers using views (setting "variable.answer_set.all()  to another
>> > > variable and then passing it to the template) and then generate radio
>> > > buttons some other way. When I generated the buttons in

Re: Tutorial question regarding def _unicode_

2012-04-11 Thread Babatunde Akinyanmi
I don't know if its because I'm reading this mail from my phone but
you should have

__unicode__() not _unicode_() ie is 2 underscores before and after not 1

On 4/11/12, Brandy  wrote:
> I am working through the tutorial and have already added the def
> _unicode_ statements to my code. However, when running
> Poll.objects.all(), I still get this output: []
>
> Here is the code:
>
> from django.db import models
>
> class Poll(models.Model):
>   question = models.CharField(max_length=200)
>   pub_date = models.DateTimeField('date published')
>   def _unicode_(self):
>   return self.question
> # def was_published_recently(self):
> # return self.pub_date >= timezone.now() -
> #datetime.timedelta(days=1)
>
> class Choice(models.Model):
>   poll = models.ForeignKey(Poll)
>   choice = models.CharField(max_length=200)
>   votes = models.IntegerField()
>   def _unicode_(self):
>   return self.choice
>
> Thank you for any 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
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: cannot import name current_datetime

2012-04-18 Thread Babatunde Akinyanmi
I have a feeling you want to do:
Import datetime not import current_datetime

On 4/18/12, asherakhet06  wrote:
> H all!
>
> I am fairly new to programming (went over LPTHW) and now going through the
> Djangobook on the internet.  Quick beginners question:  In Chapter 3, where
> I am looking at a dynamic webpage in the 2nd example I am running into some
> problems with the current_datetime function I am trying to set up. When, in
> views.py I insert the "datetime.datetime.now()" statement and "import
> current_datetime" into my urls.py file, I get the following error message
> when I try to call up the webpage via runserver.  It seems like my pure
> python script is not being picked up by the server:
>
> "ImportError cannot import name current_datetime".
>
> I know this is most likely an easy question for most of you, but it's been
> a real puzzle for me to be honest:/  Anybody have any tips on how to solve
> this error?  I know it is really important to be careful to copy EXACTLY as
> mentioned in the programming book(s), so I am pretty sure I am not making
> any spelling/character errors.  I am using windows btw.  I also have python
> 2.7 and django 1.4 installed on my computer.  Anybody kind enough to help
> me out?  Much 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/-/K5CG719gkDoJ.
> 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

-- 
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: deploying django - including third party apps

2012-04-27 Thread Babatunde Akinyanmi
Asides Shawn's answer, alwaysdata's documentation educates how to
install packages on the host

On 4/26/12, Shawn Milochik  wrote:
> There's no reason a user couldn't run virtualenv, regardless of permissions.
>
> Download the virtualenv tarball and extract it. It contains a file named
> virtualenv.py.
>
> Done.
>
> Run python virtualenv.py some_path and it will work.
>
>
> --
> 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

-- 
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: system can not find specified path

2012-05-08 Thread Babatunde Akinyanmi
Hi theo,
Why not show your settings.py file and the exact traceback

On 5/8/12, AJAYI THEOPHILUS  wrote:
> I installed django with setup.py perfecctly but after configuring sqlite3
> database and running the syncdb command i received system can not find
> specified path so i uninstalled django but i kept getting the same message.
>
> --
> 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/-/4tt7BkbVvFMJ.
> 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

-- 
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 Babatunde Akinyanmi
Or alwaysdata.com
They have a free plan

On 5/10/12, doniyor  wrote:
> many thanks eihli, i will follow the steps you gave.. cool, i let you know
> about how it worked..
>
> later
>
>
> Am Donnerstag, 10. Mai 2012 16:13:05 UTC+2 schrieb eihli:
>>
>> 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/-/n7QkL8SrRTYJ.
> 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

-- 
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 do you install Django on a shared hosting without root access?

2012-05-13 Thread Babatunde Akinyanmi
Alwaysdata.com will also save you headaches, has excellent support
plus they have a free plan.

On 5/12/12, Michael Ray  wrote:
> I second Webfaction! It will save you a lot of headaches.
>
> --
> Michael Ray
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> On Saturday, May 12, 2012 at 3:22 PM, Timothy Makobu wrote:
>
>> Hi, the host needs to specifically say they support python, then you know
>> wsgi works with them. Check out webfaction.com (http://webfaction.com)
>> On May 12, 2012 9:39 PM, "Dan Santos" > (mailto:dansanto...@gmail.com)> wrote:
>> > Hi I'm confused about how to setup Django on my shared hosting account
>> > without using root.  They don't have Django or Python support so I will
>> > have to install everything from scratch I guess.
>> >
>> > Do I install things in this order for shared hosting, or have I messed
>> > up the order when not using root?
>> >
>> > 1. Python 2.7
>> > 2. virtualenv.py
>> > http://www.virtualenv.org/en/latest/index.html
>> >
>> > 3. (ENV1)$ pip install django
>> >
>> >
>> > --
>> > 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/-/_0SpeAgCoTUJ.
>> > 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+unsubscr...@googlegroups.com
>> > (mailto:django-users%2bunsubscr...@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.
>
>

-- 
Sent from my mobile device

-- 
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 do you install Django on a shared hosting without root access?

2012-05-13 Thread Babatunde Akinyanmi
Lol. Nice way to go.

On 5/13/12, Gerald Klein  wrote:
> What host?
>
>
> thanks
>
> --jerry
>
> On Sun, May 13, 2012 at 2:49 PM, Dan Santos  wrote:
>
>> I forced my local web host (twisted their arm) and the day after they
>> created a new procedure for setting up Django without having to use root
>> access.
>>
>> Problem solved :)
>>
>>
>>
>> On Saturday, May 12, 2012 8:39:27 PM UTC+2, Dan Santos wrote:
>>>
>>> Hi I'm confused about how to setup Django on my shared hosting account
>>> without using root.  They don't have Django or Python support so I will
>>> have to install everything from scratch I guess.
>>>
>>> Do I install things in this order for shared hosting, or have I messed up
>>> the order when not using root?
>>>
>>> 1. Python 2.7
>>> 2. virtualenv.py
>>> http://www.virtualenv.org/en/**latest/index.html
>>>
>>> 3. (ENV1)$ pip install django
>>>
>>>
>>>  --
>> 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/-/JbtefCDiKMIJ.
>> 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.
>>
>
>
>
> --
>
> Gerald Klein DBA
>
> contac...@geraldklein.com
>
> www.geraldklein.com 
>
> j...@zognet.com
>
> 708-599-0352
>
>
> Linux registered user #548580
>
> --
> 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

-- 
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: PLEAASSEE HEEELPP!!!!!!!!!!!

2012-05-14 Thread Babatunde Akinyanmi
You'll likely get more help from apache server's group (if they have
one), from stackoverflow or just google it

On 5/14/12, doniyor  wrote:
> hi there, please help me, i am just right on the coast of success, but
> cannot find the clue somehow.. this is my thread:
> https://groups.google.com/forum/?hl=de&fromgroups#!topic/django-users/0UYopuCkvXo
>
> my only question is: What is Docroot and what should live there?
>
> my page is showing the files thru some wrong configuration of httpd.conf,
> why does this thing happen? what is responsible for this?
>
> many many 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/-/XETFl3MtkHYJ.
> 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

-- 
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: PLEAASSEE HEEELPP!!!!!!!!!!!

2012-05-14 Thread Babatunde Akinyanmi
**ignore previous message sent in error**

On 5/14/12, Babatunde Akinyanmi  wrote:
> You'll likely get more help from apache server's group (if they have
> one), from stackoverflow or just google it
>
> On 5/14/12, doniyor  wrote:
>> hi there, please help me, i am just right on the coast of success, but
>> cannot find the clue somehow.. this is my thread:
>> https://groups.google.com/forum/?hl=de&fromgroups#!topic/django-users/0UYopuCkvXo
>>
>> my only question is: What is Docroot and what should live there?
>>
>> my page is showing the files thru some wrong configuration of httpd.conf,
>> why does this thing happen? what is responsible for this?
>>
>> many many 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/-/XETFl3MtkHYJ.
>> 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
>

-- 
Sent from my mobile device

-- 
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: pkg_resources.distributionnotfound django==1.3.1

2012-05-20 Thread Babatunde Akinyanmi
Hi,
If you're really sure completely reinstalling django is the way to go,
what I do is perform a file system search with keyword "django" and
delete as needed

On 5/18/12, doniyor  wrote:
> Hey guys,
>
> i am getting this error while trying the command: django-admin.py
> startproject test
>
> can it be that i am using 2 versions of django at the same time? first what
> i did was: i wanted to install django1.4 and i did. then many errors came,
> then i switched back to django1.3, in between i did this several times,
> once with easy_install and once right from package using python setup.py
> install. now this error, i cannot figure out what is happening actually..
> can you please help me how to delete the version of django completely from
> my OS and the reinstall it..
>
> 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/-/SsHZm_5s3UcJ.
> 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

-- 
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: 'str' object has no attribute 'resolve'

2012-06-19 Thread Babatunde Akinyanmi
Hi. Give the full traceback please. It'll be easier to assist with the
information

On 6/19/12, Sabbineni Navneet  wrote:
> it still shows the same error
>
> On Tuesday, June 19, 2012 9:23:50 PM UTC+5:30, Sabbineni Navneet wrote:
>>
>> This is my url.py file:
>> from django.conf.urls.defaults import *
>>
>> # Uncomment the next two lines to enable the admin:
>> #from django.contrib import admin
>> #admin.autodiscover()
>>
>>
>>
>> urlpatterns = patterns('',
>>
>>  (r'^admin/$', include('django.contrib.admin.urls')),
>> )
>> # 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:
>> Please help
>>
>
> On Tuesday, June 19, 2012 9:23:50 PM UTC+5:30, Sabbineni Navneet wrote:
>>
>> This is my url.py file:
>> from django.conf.urls.defaults import *
>>
>> # Uncomment the next two lines to enable the admin:
>> #from django.contrib import admin
>> #admin.autodiscover()
>>
>>
>>
>> urlpatterns = patterns('',
>>
>>  (r'^admin/$', include('django.contrib.admin.urls')),
>> )
>> # 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:
>> Please help
>>
>
> --
> 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/-/7Y67BJIlJyMJ.
> 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

-- 
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: Affordable Django hosting solution in India/around?

2012-06-25 Thread Babatunde Akinyanmi
Alwaysdata(.com) offers free hosting but its shared hosting

On 6/25/12, Phang Mulianto  wrote:
> Hi,
>
> some thing people search... reliable and cheap / affordable.
>
> Afforadble / cheap is relative variable there in my opinion. you mention 8$
> / month stil expensive and unaffordable for you.
> in other country it is cheap (us).
>
> even the cheap one in amazon aws around 8 -10 $ / month with standart
> package.
>
> but you know amazon have free account for 1 years you can try. but if you
> need permanent you need to pay.
>
> better way you lease a vps and join with other fellow there to share the
> resource and split the payment.
>
> Regards,
>
> Mulianto
>
> On Mon, Jun 25, 2012 at 8:52 PM, Kartik Singhal
> wrote:
>
>> Hi
>>
>> We are a small non-profit all-students organization conducting a
>> TEDxevent in our college soon. We have built a
>> basic django-based web app for
>> speaker nomination, participant registration, blog, etc. and other mostly
>> static content.
>>
>> Regarding this I am looking for a reliable and affordable web hosting
>> solution (preferably in India). Since our requirement is pretty small,
>> hosting on a VPS on upwards of 8$/month or more seems expensive and
>> unaffordable for us. Are there any web hosts catering to requirements of
>> small organizations like us?
>>
>> I should also add - our previous website was based off Drupal (PHP based
>> CMS) and we would like to maintain an archive of that too, if possible,
>> on
>> this new hosting solution, but this is not a primary requirement.
>>
>> --
>> Kartik
>> http://k4rtik.wordpress.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+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.
>
>

-- 
Sent from my mobile device

-- 
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: Handling millions of rows + large bulk processing (now 700+ mil rows)

2012-07-05 Thread Babatunde Akinyanmi
For the knowledge of it, me two

On 7/4/12, Timothy Makobu  wrote:
> I'm in.
>
> On Tue, Jul 3, 2012 at 2:35 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Just in case anyone missed the URL, you can book your slot here:
>>
>> http://www.doodle.com/8ptehyqr6uezhtsy
>>
>> Voting open until 14th July.
>>
>> Cal
>>
>> On Mon, Jul 2, 2012 at 9:59 AM, Cal Leeming [Simplicity Media Ltd] <
>> cal.leem...@simplicitymedialtd.co.uk> wrote:
>>
>>> Curious, I'll have to test the quality, but we might potentially use
>>> hangouts for the backup stream instead - it'd certainly be a lot easier
>>> if
>>> the quality was good!
>>>
>>> Cheers
>>>
>>> Cal
>>>
>>>
>>> On Mon, Jul 2, 2012 at 5:35 AM, Alec Taylor
>>> wrote:
>>>
 Sounds good, but have you considered using Google+ Hangouts?

 On Mon, Jul 2, 2012 at 1:09 AM, Cal Leeming [Simplicity Media Ltd]
  wrote:
 > Wow - glad to see there's people interested in this!
 >
 > Here is the schedule, could everyone please select which days/times
 they are
 > available (enter more than one if possible)
 >
 > http://www.doodle.com/8ptehyqr6uezhtsy
 >
 > I'll leave the schedule open until 14th July, whichever slot gets the
 most
 > votes wins.
 >
 > Given our awful experiences with conferencing software, we'll
 > probably
 be
 > using livestream, and a backup stream from one of our own servers -
 both
 > have a maximum capacity of 50 users at 720p.
 >
 > Cal
 >
 > On Sat, Jun 30, 2012 at 4:10 PM, Cal Leeming [Simplicity Media Ltd]
 >  wrote:
 >>
 >> Hi all,
 >>
 >> As some of you know, I did a live webcast last year (July 2011) on
 our LLG
 >> project, which explained how we overcome some of the problems
 associated
 >> with large data processing.
 >>
 >> After reviewing the video, I found that the sound quality was very
 poor,
 >> the slides weren't very well structured, and some of the information
 is now
 >> out of date (at the time it was 40mil rows, now we're dealing with
 700+mil
 >> rows).
 >>
 >> Therefore, I'm considering doing another live webcast (except this
 time
 >> it'll be recorded+posted the next day, the stream will be available
 >> in
 >> 1080p, it'll be far better structured, and will only last 50
 >> minutes).
 >>
 >> The topics I'd like to cover are:
 >>
 >> * Bulk data processing where bulk_insert() is still not viable (we
 went
 >> from 30 rows/sec to 8000 rows/sec on bulk data processing, whilst
 still
 >> using the ORM - no raw sql here!!)
 >> * Applying faux child/parent relationship when standard ORM is too
 >> expensive (allows for ORM approach without the cost)
 >> * Applying faux ORM read-only structure to legacy applications
 (allows ORM
 >> usage on schemas that weren't properly designed, and cannot be
 changed - for
 >> example, vendor software with no source code).
 >> * New Relic is beautiful, but expensive. Hear more about our plans
 >> to
 make
 >> an open source version.
 >> * Appropriate use cases for IAAS vs colo with SSDs.
 >> * Percona is amazing, some of the tips/tricks we've learned over.
 >>
 >> If you'd like to see this happen, please leave a reply in the thread
 - if
 >> enough people want this, then we'll do public vote for the scheduled
 date.
 >>
 >> Cheers
 >>
 >> Cal
 >
 >
 > --
 > 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-u

Re: submit parameters to py script

2012-07-07 Thread Babatunde Akinyanmi
Hi,
Just like Rohan said, why not do that in your view when processing your form?

Here's from the documentation:
https://docs.djangoproject.com/en/1.4/topics/forms/?from=olddocs



On 7/7/12, Smaran Harihar  wrote:
> Thanks for the reply Rohan. I am trying to create a Django App in which,
> user will be adding some info in the text box and on clicking submit, I
> wish to send the contents of the textbox to the py script. The output of
> the py script, I wish to display it in a table on my HTML template.
>
> I hope I was able to explain myself. Also where should I place my py sript,
> which will be triggered on submitting the data.
>
> Thanks,
> Smaran
>
> On Fri, Jul 6, 2012 at 6:14 PM, Rohan  wrote:
>
>>  For a cgi script or a wsgi script, all you need to do is add a script
>> alias in your apache conf (if you're using apache). The parameters should
>> be available as a a dictionary in both the cases (cgi.FieldStorage() and
>> envrion).
>>
>> Although it would help to know why you want to do this. If you already
>> have django up and running, you could just implement the functionality of
>> your script as a view function
>>
>>
>> On 7/6/2012 6:20 PM, Smaran Harihar wrote:
>>
>> Hey Djangoers,
>>
>>  I am trying to execute a python script on submit button on a html file.
>>
>>  So i have created a view which renders a html template file and on
>> 'submit', I wish to send few parameters to the py script.
>>
>>  I wanted to know,
>>
>>  1. where should I keep my py script?
>> 2. I have not modified my html into Django template, but what
>> modifications will it need if I want to send parameters to py script on
>> submit?
>>
>>  --
>> Thanks & Regards
>> Smaran Harihar
>>
>>  --
>> 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.
>>
>
>
>
> --
> Thanks & Regards
> Smaran Harihar
>
> --
> 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

-- 
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: submit parameters to py script

2012-07-07 Thread Babatunde Akinyanmi
Errr, have you read this:
https://docs.djangoproject.com/en/1.4/howto/outputting-csv/

Your view can know if a form was submitted, submitted but with invalid
data and submitted with valid data. A view is just a python function
so if you have determined that the user submitted valid data, just go
ahead and extract the CSV to be output.
Perhaps you should go through the examples in the django forms
documentation again:
https://docs.djangoproject.com/en/1.4/topics/forms/?from=olddocs

However, I don't think its possible to send both an html page and a
CSV so I guess you'll have to choose one or send them one at a time
(html page then csv). I'm sure Mevlyn will know if its possible
though.

On 7/7/12, Smaran Harihar  wrote:
> Thanks for the reply Melvyn and Babatunde. So my script is, using the
> parameters, to search in a database and then spitting out the output back
> as CSV.
> I wish to return the CSV and also display the output in the table on my
> html template.
> Ok, so adding it to view makes more sense, but how do i connect or execute
> that view, on the click of the submit button??
> On Jul 7, 2012 1:42 AM, "Melvyn Sopacua"  wrote:
>
>> On 7-7-2012 0:20, Smaran Harihar wrote:
>>
>> > I am trying to execute a python script on submit button on a html file.
>> >
>> > So i have created a view which renders a html template file and on
>> > 'submit', I wish to send few parameters to the py script.
>> >
>> > I wanted to know,
>> >
>> > 1. where should I keep my py script?
>>
>> Anywhere you want. It's probably best you describe what your script
>> does. We don't really understand why you want to execute a script and
>> not just put that code in a view function.
>> Other than that, a python script you want to execute is no different
>> than a sh script or binary command, so you'll need to use python's
>> subprocess or os module functions, pass arguments in proper shell syntax
>> and read output.
>> --
>> Melvyn Sopacua
>>
>>
>> --
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Handling millions of rows + large bulk processing (now 700+ mil rows)

2012-07-22 Thread Babatunde Akinyanmi
Google failed me too

On 7/22/12, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Could you clarify what you mean by "twich" and "auto VOD writing"..? Google
> failed me :/
>
> On Sat, Jul 21, 2012 at 7:02 AM, b1-  wrote:
>
>> +1
>>>
>>>
>> And use some services like twich with auto VOD writing.
>> I think it will be intresting not only for us
>>
>> --
>> 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/-/2Dkdxaxw3JoJ.
>>
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Checking if a dynamicallygenerated dropdown has a selected item

2012-07-23 Thread Babatunde Akinyanmi
Maybe I don't really understand the question but I think if you want
to check if the user has answered 3 questions, check from the keys in
request.GET or request.POST as the case may be.

On 7/23/12, Sithembewena Lloyd Dube  wrote:
> Hi all,
>
> I have a dynamically generated dropdown in this fashion (when viewing
> source):
>
> 
> selected="selected">
> value="question_3_answer_7">a) Spend the majority of time indoors
> value="question_3_answer_8">b) Value superior darkness and consider in-car
> activation
> value="question_3_answer_9">c) Value indoor clarity over outdoor
> darkness
> 
>
> 
> selected="selected">
> value="question_3_answer_7">a) Spend the majority of time indoors
> value="question_3_answer_8">b) Value superior darkness and consider in-car
> activation
> value="question_3_answer_9">c) Value indoor clarity over outdoor
> darkness
> 
>
> How would one check, in a view, whether or not any of the dropdowns have a
> selected item? I basically need to ensure that users answer at least 3 out
> of 5 questions?
>
> Thanks ...
> --
> 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.
>
>

-- 
Sent from my mobile device

-- 
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: 'QuerySet' object has no attribute '_meta' ... but I'm not using a QuerySet!

2012-07-25 Thread Babatunde Akinyanmi
Looks good to me. Are you sure have shown us all the relevant parts of
your code?

On 7/25/12, Deathweasel  wrote:
> Hello, guys.
> This is Django 1.4.
>
> I have this code from my view:
>
> my_art = ArtworkModel.objects.get(id=pk)
> comments = CommentModel.objects.filter(artwork=pk)
> artForm = ArtworkForm(instance=my_art)
> ...
>
> These models:
>
> class ArtworkModel(models.Model):
> """
> This class contains the information necessary to describe a piece
> of
> artwork uploaded to my website. Technically, the artist field is
> unnecessary, but I'm throwing it in because I'd like to be able
> to upload collaborations.
> """
> MEDIUMS = (('ink', 'ink'),
>('graphite', 'graphite'),
>('watercolor', 'watercolor'),
>('oil', 'oil'),
>('acrylic', 'acrylic'),
>('digital', 'digital'),
>('sculpture', 'sculpture'),
>('other','other'))
>
> title = models.CharField(max_length=200)
> medium = models.CharField(max_length=200, choices=MEDIUMS,
> default='graphite')
> upload_date = models.DateTimeField(auto_now_add=True)
> artist = models.CharField(max_length=200)
> image = models.ImageField(upload_to=getFilePath)
> desc = models.TextField(verbose_name="Description", max_length=500)
>
> class Meta:
> ordering = ['title']
>
> def __unicode__(self):
> return '-'.join((self.title, self.artist, self.medium))
>
> class CommentModel(models.Model):
> """
> This class contains the information necessary to describe a comment
> that someone's left about a piece of artwork.
> """
> commenteer = models.CharField(max_length=200, blank=False)
> comment_body = models.TextField(blank=False)
> artwork = models.ForeignKey(ArtworkModel)
> date = models.DateTimeField(auto_now_add=True)
>
> class Meta:
> ordering = ['date']
>
>
> And this traceback:
> Traceback:
> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
> in get_response
>   111. response = callback(request, *callback_args,
>
> **callback_kwargs)
> File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in
>
> _wrapped_view
>   91. response = view_func(request, *args, **kwargs)
> File "/home/deathweasel/shiny-website/deathweasel/artwork/views.py" in
> modify_artwork
>   94. artForm = ArtworkForm(instance=my_art)
> File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py" in
> __init__
>   238. object_data = model_to_dict(instance, opts.fields,
> opts.exclude)
> File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py" in
> model_to_dict
>   111. opts = instance._meta
>
> Exception Type: AttributeError at /artwork/8/modify/
> Exception Value: 'QuerySet' object has no attribute '_meta'
>
> The internet says I should be using a regular Model instance rather than a
> QuerySet to populate my form. The thing is that I think I AM using a
> regular model. I'm not even using
> those CommentModels yet. I don't understand why this is failing? Please
> help?
>
> --
> 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/-/_eRwn1qmzr0J.
> 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

-- 
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: 'QuerySet' object has no attribute '_meta' ... but I'm not using a QuerySet!

2012-07-25 Thread Babatunde Akinyanmi
Like the code for ArtworkForm

On 7/26/12, Babatunde Akinyanmi  wrote:
> Looks good to me. Are you sure have shown us all the relevant parts of
> your code?
>
> On 7/25/12, Deathweasel  wrote:
>> Hello, guys.
>> This is Django 1.4.
>>
>> I have this code from my view:
>>
>> my_art = ArtworkModel.objects.get(id=pk)
>> comments = CommentModel.objects.filter(artwork=pk)
>> artForm = ArtworkForm(instance=my_art)
>> ...
>>
>> These models:
>>
>> class ArtworkModel(models.Model):
>> """
>> This class contains the information necessary to describe a piece
>> of
>> artwork uploaded to my website. Technically, the artist field is
>> unnecessary, but I'm throwing it in because I'd like to be able
>> to upload collaborations.
>> """
>> MEDIUMS = (('ink', 'ink'),
>>('graphite', 'graphite'),
>>('watercolor', 'watercolor'),
>>('oil', 'oil'),
>>('acrylic', 'acrylic'),
>>('digital', 'digital'),
>>('sculpture', 'sculpture'),
>>('other','other'))
>>
>> title = models.CharField(max_length=200)
>> medium = models.CharField(max_length=200, choices=MEDIUMS,
>> default='graphite')
>> upload_date = models.DateTimeField(auto_now_add=True)
>> artist = models.CharField(max_length=200)
>> image = models.ImageField(upload_to=getFilePath)
>> desc = models.TextField(verbose_name="Description", max_length=500)
>>
>> class Meta:
>> ordering = ['title']
>>
>> def __unicode__(self):
>> return '-'.join((self.title, self.artist, self.medium))
>>
>> class CommentModel(models.Model):
>> """
>> This class contains the information necessary to describe a
>> comment
>> that someone's left about a piece of artwork.
>> """
>> commenteer = models.CharField(max_length=200, blank=False)
>> comment_body = models.TextField(blank=False)
>> artwork = models.ForeignKey(ArtworkModel)
>> date = models.DateTimeField(auto_now_add=True)
>>
>> class Meta:
>> ordering = ['date']
>>
>>
>> And this traceback:
>> Traceback:
>> File
>> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
>> in get_response
>>   111. response = callback(request,
>> *callback_args,
>>
>> **callback_kwargs)
>> File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py"
>> in
>>
>> _wrapped_view
>>   91. response = view_func(request, *args, **kwargs)
>> File "/home/deathweasel/shiny-website/deathweasel/artwork/views.py" in
>> modify_artwork
>>   94. artForm = ArtworkForm(instance=my_art)
>> File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py" in
>> __init__
>>   238. object_data = model_to_dict(instance, opts.fields,
>> opts.exclude)
>> File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py" in
>> model_to_dict
>>   111. opts = instance._meta
>>
>> Exception Type: AttributeError at /artwork/8/modify/
>> Exception Value: 'QuerySet' object has no attribute '_meta'
>>
>> The internet says I should be using a regular Model instance rather than
>> a
>> QuerySet to populate my form. The thing is that I think I AM using a
>> regular model. I'm not even using
>> those CommentModels yet. I don't understand why this is failing? Please
>> help?
>>
>> --
>> 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/-/_eRwn1qmzr0J.
>> 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
>

-- 
Sent from my mobile device

-- 
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 Beginning Tutorial for Django 1.4

2012-07-27 Thread Babatunde Akinyanmi
Read the documentation, recreate the project in the documentation
tutorial then work on a project of your own. You can't learn to swim
by reading books, same for programming.

My 50 kobo

On 7/27/12, ACK-Django  wrote:
> hello, guys i m new to django as well as python.
> i know its important to learn python before django
> so just an hour ago i finished the book =>
> http://www.swaroopch.org/notes/Python ( A Byte of Python 2.xx version )
> now i wanted to learn django very deeply and along the way i will also look
>
> at python.
>
> So People give me all links / tutorials / videos / blogs / documentation
> etc for Django 1.4
>
> only thing i find updated is documentation.
>
> so guys any newbie books / word of caution / general advice from your
> experience to newbie
>
> please share it here.
>
> --
> 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/-/4MPatJ7grhcJ.
> 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

-- 
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 FastCGI configuration for Share Host.

2012-07-29 Thread Babatunde Akinyanmi
Hi,
If you are using a shared host, I don't think you can choose if you
use FCGI or WSGI. Your host will let you know and also give
instructions on how to set up and launch your app. Why not check their
documentation or just raise a ticket with your host's support team

On 7/29/12, Александър Ботев  wrote:
> On Jul 29, 3:42 pm, "Michael P. Soulier" 
> wrote:
>> On 29/07/12 07:48 AM, Александър Ботев wrote:
>>
>> > Hi,
>> > So I followed all the instructions from the django web source about how
>> > to
>> > configure it, but all it seems
>> > it gives me a problem - I always get an error 500.
>> > My main concern and I think problem is that when I run my fcgi script
>> > it
>> > gives me this:
>>
>> Why are you using fastcgi instead of wsgi?
>>
>> Mike
> Well when I was looking at ways to deploy django on shared host... the
> only thing I found was the article
> which speaks about fastcgi. Now I must admit I know almost nothing
> about apache different modes etc...
> this is my first encounter with them and even though I might learn
> them at the moment I need to deploy this
> django app first asap. If you can point we out to any article,guide or
> explain me how to set it up with
> wsgi I would be very the glad. The main restriction of shared host is
> just no root access.
>
> 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.
>
>

-- 
Sent from my mobile device

-- 
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 in Brand New Django 1.4.1 released Yesterday

2012-08-01 Thread Babatunde Akinyanmi
Just now I also did

pip install --upgrade django

>>> import django
>>> django.get_version()
'1.4.1'
>>>

On 8/1/12, Mike Dewhirst  wrote:
> Yesterday I did ...
>
> pip install --upgrade django
>
> ... and it happily upgraded mine to 1.4.1
>
> Mike
>
> On 1/08/2012 9:46am, Dennis Lee Bieber wrote:
>> On Tue, 31 Jul 2012 16:06:20 -0700 (PDT), JJ Zolper
>>  declaimed the following in
>> gmane.comp.python.django.user:
>>
>>> Nope. Not Python 1.4. Django 1.4.
>>>
>>> http://pypi.python.org/pypi/Django/1.4#downloads
>>>
>>  Intriguing... When I did my search python.org routed me to the
>> Django server itself...
>>
>
> --
> 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

-- 
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 let user change the language

2012-08-13 Thread Babatunde Akinyanmi
Hi Gelonida,

I haven't ever worked with internalization but off the top of my head
after reading the documentation, if I was faced with implementing
this, I would first add a field to the user profile say
'preferred_lang'. Next, I would write code that would first check if a
preferred language has already been set in the user's session or
browser cookie. If yes, let internalisation work as usual else, check
the 'preferred_language' from the user's profile and store it in the
session or browser cookie and let internalization work as usual.

I hope that gives you some ideas and if you like the idea and run into
problems, you would be able to get a lot of helpful answers from the
group

On 8/12/12, Gelonida N  wrote:
> On 08/12/2012 08:46 PM, Marcin Tustin wrote:
>> This is linked from the Django front page:
>> https://docs.djangoproject.com/en/1.4/topics/i18n/
>>
>> Come back with specific questions when you get stuck.
>
>
> Thanks for your answer.
>
> I created already all the l18n messages and I can switch the language
> site wise  by changing the language in settings.py
>
> However Now I'd like to change them via user preferences. (not cookies)
> (So if one user changes the language on one m,achine it should be
> changed on any other machine if he logs in.
>
> I'd prefer not to set the language as suggested by the browser, but let
> the user the choice even if his useragent suggests another prefered
> language.
>
>
> There seems to be a url based approach and a cookies based approach I
> wonder what would be best for my scenario.
> (I am in full control of the web server and can add redirects / rewrite
> rules, etc. if this helps)
>
>
> This might be explained somewhere in more details in the Django docss
> however I did not find the related page.
>
> The doc mentions:
> "It uses these hooks to localize Web apps for particular users according
> to their preferences."
>
> but I did not find the how
>
>
>>
>> On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > > wrote:
>>
>>
>> I'd like to have a web site, where the can switch the language
>> The first time the user connects the language would be the prefered
>> language as sugegsted by the news agent,
>> then the user could select the prefered lanngauge in some user
>> preference settings.
>>
>>
>>
>> What would be the standard way to do this in Django?
>>
>> Thanks in advance for comments,  examples, snippets, links,
>>
>> --
>> 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
>> .
>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>> --
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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 let user change the language

2012-08-13 Thread Babatunde Akinyanmi
The link given was the overview page. it has links that lead you to
deeper parts of the internalization framework.

On 8/13/12, Gelonida N  wrote:
>
> On 08/13/2012 12:54 AM, Marcin Tustin wrote:
>> So, what part, exactly is a problem? What have you tried?
>
> Changing settings.LANGUAGE_CODE to another language, but this is
> obiously nto what I am looking for, as this does not allow to change the
> language on a user by use base.
>
> If anybody showed my how to select the language on a requests basis,
> then the problem should basically be solved and I should be able to solv
> ethe rest by myself.
>
>
> It may be, that there is an obvious mentioning in the documentation.
> However I fail to see it. Thus my question.
>
>
> What I'd like to achieve is to be able to have the language settings on
> a user by user basis.
>
> I assume, that this can be achieved via some middleware and some state
> variable, that I had to link to a user.
> I did not find the related documention and wanted to know if anybody can
> point me to the right doc (or section of the doc)
>
> The link you refer to is exactly one page and somehow I miss to see any
> outgoing links to more specialized topics.
> I know, that I rad already more docs about I18n for django, but don't
> remember the chapter / link name.
>
> In fact the link doesn't even mention, that changing
> settings.LANGUAGE_CODE allows to change the language site wise.
> So there must be some other doc explaining more.
>
>
>>
>> On Sun, Aug 12, 2012 at 6:52 PM, Gelonida N > > wrote:
>>
>> On 08/12/2012 08:46 PM, Marcin Tustin wrote:
>>
>> This is linked from the Django front page:
>> https://docs.djangoproject.__com/en/1.4/topics/i18n/
>> 
>>
>> Come back with specific questions when you get stuck.
>>
>>
>>
>> Thanks for your answer.
>>
>> I created already all the l18n messages and I can switch the
>> language site wise  by changing the language in settings.py
>>
>> However Now I'd like to change them via user preferences. (not
>> cookies)
>> (So if one user changes the language on one m,achine it should be
>> changed on any other machine if he logs in.
>>
>> I'd prefer not to set the language as suggested by the browser, but
>> let the user the choice even if his useragent suggests another
>> prefered language.
>>
>>
>> There seems to be a url based approach and a cookies based approach
>> I wonder what would be best for my scenario.
>> (I am in full control of the web server and can add redirects /
>> rewrite rules, etc. if this helps)
>>
>>
>> This might be explained somewhere in more details in the Django
>> docss however I did not find the related page.
>>
>> The doc mentions:
>> "It uses these hooks to localize Web apps for particular users
>> according to their preferences."
>>
>> but I did not find the how
>>
>>
>>
>> On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > 
>> >> wrote:
>>
>>
>>  I'd like to have a web site, where the can switch the
>> language
>>  The first time the user connects the language would be the
>> prefered
>>  language as sugegsted by the news agent,
>>  then the user could select the prefered lanngauge in some
>> user
>>  preference settings.
>>
>>
>>
>>  What would be the standard way to do this in Django?
>>
>>  Thanks in advance for comments,  examples, snippets, links,
>>
>>  --
>>  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@__goo__glegroups.com
>> 
>>  > __>.
>>
>>  For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en
>> 
>>  > >.
>>
>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105 
>>
>> --
>> You received this message because you are subscribed to the
>> Google
>> Groups "Django users" group.
>> To post to this group, send email to
>> djang

Re: Django Admin doesn't show all fields from model when registered.

2012-08-16 Thread Babatunde Akinyanmi
Ok I fixed it and in case someone else falls into such a trap, here's
how I fixed it.

My Answer model had a field with name 'is_correct' and had a method
with name 'is_correct'. This confused django such that:

>>> ans = Answer.objects.get(id=1)
>>> ans.is_correct
>

So I changed the name of the 'is_correct' method and running the above
in the code threw an error: .DatabaseError: column
examprep_answer.is_correct does not exist.

Drop my database and syncdb-ing got things back to normal.

I think django should be able to detect such things and raise an error
or there should be a note in the documentation warning people not to
name their model methods with model field names.

On 8/16/12, Tundebabzy  wrote:
> Hi guys, here's bit of my code http://dpaste.com/hold/787292/
>
> The problem is that my Answer model in admin is missing the 'is_correct',
> 'date_added' and 'modified' fields.
>
>
> 
>
> I tried adding:
> fieldsets = [
>
> (None,   {'fields':
> ['text','is_correct','explanation']}),
>
> ]
> to my AnswerInLine definition but that throws an ImproperlyConfigured error
> saying:
> 'AnswerInline.fieldsets[0][1]['fields']' refers to field 'is_correct' that
> is missing from the form.
>
> Can anyone help out?
>
>
> --
> 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/-/qK1kFc-11lQJ.
> 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

-- 
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 Admin doesn't show all fields from model when registered.

2012-08-18 Thread Babatunde Akinyanmi
Thomas' reply actually did help me narrow down my search efforts to
'namespaces' which is a term I'm actually new to (as a noob) and I was able
to get links to articles that did make me understand a little bit more of
what goes on beneath the hood of my program especially this:
http://docs.python.org/tutorial/classes.html#python-scopes-and-namespaces .
My previous google-fu had been failing me and now I do agree that it has
nothing to do with django or python and my earlier request can just be
ignored.

On Sat, Aug 18, 2012 at 10:03 AM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

>
>
> Le jeudi 16 août 2012 21:00:56 UTC+2, Tundebabzy a écrit :
>
>> Ok I fixed it and in case someone else falls into such a trap, here's
>> how I fixed it.
>>
>> My Answer model had a field with name 'is_correct' and had a method
>> with name 'is_correct'.
>>
>
>
> Everything in Python is an object, including functions, classes, modules
> etc. In a class statement's body, if you first bind name "is_correct" to
> something (here a field but it could have been anything) then to something
> else (here a function but it could have been anything too), then the second
> binding will replace the first one.
>
>
>
> I think django should be able to detect such things and raise an error
>>
>
> "Django" (that is, in this case, django models metaclass) doesn't even
> know about this - all it gets is the namespace (ie: a dict) obtained by
> evaluating the class statement's body. This is how Python work, and
> expecting something else just means that you assume it works like some
> other language you already know (bad luck: no two languages work the same).
>
>
>> or there should be a note in the documentation warning people not to
>> name their model methods with model field names.
>>
>>
> Why should Django documents Python features ? Python is already (and quite
> extensively) documented on it's own : http://docs.python.org/
>
>
>
>
>
> --
> 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/-/fspuOAnnWwIJ.
>
> 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 Admin doesn't show all fields from model when registered.

2012-08-18 Thread Babatunde Akinyanmi
oops..clicked send too soon

and thanks Thomas and Bruno

On Sat, Aug 18, 2012 at 11:15 AM, Babatunde Akinyanmi
wrote:

> Thomas' reply actually did help me narrow down my search efforts to
> 'namespaces' which is a term I'm actually new to (as a noob) and I was able
> to get links to articles that did make me understand a little bit more of
> what goes on beneath the hood of my program especially this:
> http://docs.python.org/tutorial/classes.html#python-scopes-and-namespaces. My 
> previous google-fu had been failing me and now I do agree that it has
> nothing to do with django or python and my earlier request can just be
> ignored.
>
>
> On Sat, Aug 18, 2012 at 10:03 AM, bruno desthuilliers <
> bruno.desthuilli...@gmail.com> wrote:
>
>>
>>
>> Le jeudi 16 août 2012 21:00:56 UTC+2, Tundebabzy a écrit :
>>
>>> Ok I fixed it and in case someone else falls into such a trap, here's
>>> how I fixed it.
>>>
>>> My Answer model had a field with name 'is_correct' and had a method
>>> with name 'is_correct'.
>>>
>>
>>
>> Everything in Python is an object, including functions, classes, modules
>> etc. In a class statement's body, if you first bind name "is_correct" to
>> something (here a field but it could have been anything) then to something
>> else (here a function but it could have been anything too), then the second
>> binding will replace the first one.
>>
>>
>>
>> I think django should be able to detect such things and raise an error
>>>
>>
>> "Django" (that is, in this case, django models metaclass) doesn't even
>> know about this - all it gets is the namespace (ie: a dict) obtained by
>> evaluating the class statement's body. This is how Python work, and
>> expecting something else just means that you assume it works like some
>> other language you already know (bad luck: no two languages work the same).
>>
>>
>>> or there should be a note in the documentation warning people not to
>>> name their model methods with model field names.
>>>
>>>
>> Why should Django documents Python features ? Python is already (and
>> quite extensively) documented on it's own : http://docs.python.org/
>>
>>
>>
>>
>>
>> --
>> 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/-/fspuOAnnWwIJ.
>>
>> 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: Any Django people in Windor/West London looking for a client?

2012-08-18 Thread Babatunde Akinyanmi
Hi Andy,
I think you need to add more details like what the simple site is and then
where the client is located. That way, more local doesn't sound cryptic

On Fri, Aug 17, 2012 at 12:06 PM, Andy Baker  wrote:

> We built a fairly simple Django site and the client would like someone
> more local to take over maintenance. If anyone is interested then drop me a
> line. I'm happy to help with the handover.
>
> --
> 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/-/BBRBr4uwPcUJ.
> 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 LOVE THIS COMMUNITY!

2012-08-21 Thread Babatunde Akinyanmi
Amen to that

On 8/21/12, Mario Gudelj  wrote:
> I just want to tell you guys that you're awesome! I've never seen a
> community which helps noobs so much and with so few dickheads in it. Good
> on you!
>
> Mario
>
> --
> 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

-- 
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 by Example: error with to do app; global name 'escape' is not defined

2012-08-24 Thread Babatunde Akinyanmi
I think you want to add this import statement:
from django.utils.html import escape

On 8/24/12, koiwai  wrote:
> plus code
>
> def response_add(self, request, obj, post_url_continue='../%s/'):
> """
> Determines the HttpResponse for the add_view stage.
> """
> opts = obj._meta
> pk_value = obj._get_pk_val()
>
> msg = "Item(s) were added successfully."
> # Here, we distinguish between different save types by checking for
> # the presence of keys in request.POST.
> if "_continue" in request.POST:
> self.message_user(request, msg + ' ' + _("You may edit it again
>
> below."))
> if "_popup" in request.POST:
> post_url_continue += "?_popup=1"
> return HttpResponseRedirect(post_url_continue % pk_value)
>
> if "_popup" in request.POST:
> return HttpResponse(
> ''
> ' type="text/javascript">opener.dismissAddAnotherPopup(window, "%s",
> "%s");' % \
> # escape() calls force_text.
> (escape(pk_value), escapejs(obj)))
> elif "_addanother" in request.POST:
> self.message_user(request, msg + ' ' + (_("You may add another
> %s below.") % force_text(opts.verbose_name)))
> return HttpResponseRedirect(request.path)
> else:
> self.message_user(request, msg)
> return
> HttpResponseRedirect(reverse("admin:todo_item_changelist"))
>
> thanks
>
> On Friday, August 24, 2012 4:54:16 PM UTC+1, koiwai wrote:
>>
>> Hi,
>>
>> I'm currently working through Django by
>> Examplesand I am getting an error when
>> attempting to have the user automatically go
>> back to the listing of 'todo items'  after entering new 'to do items'
>> through creating a new date. The
>> siteasks
>> us to copy a function from a template provided by django, and alter a
>> couple of things. The code example and the template are a bit different
>> post altering though (I guess this is because I am using 1.4;s default
>> packages and presumably the author was using 1.2), but I don't think these
>>
>> are relevant to my problem (I use in rather than has.key etc)
>>
>> Name Error at /admin/todo/datetime/add/
>> global name 'escape' is not defined
>>
>
> --
> 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/-/zw4c7aTNGRYJ.
> 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

-- 
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: Site Architecture

2012-09-07 Thread Babatunde Akinyanmi
I'm hardly a pro but I think the answer to your question will depend
on why you want to add django to the stack


On 9/7/12, Jeff Regan  wrote:
> I'm not much of an architect and am pretty new to Django, so I was hoping I
>
> could get some advice. Currently our site is html/jQuery and all the data
> is accessed through Javascript calls to rest services.
> Data -> Rest Services -> HTML/jQuery
>
> I was planning on putting a Django layer between the client and the rest
> services.
> Data -> Rest Services -> Django -> HTML/jQuery
>
> I'd use jQuery to send post requests to Django urls(routed to views).  The
> views would then call the rest layer to retrieve the data, and pass the
> response to the front end.
>
> Does anyone see a problem with this approach?  Is there anything I should
> be aware of?  Are there other sites that took a similar approach?
>
> I appreciate any help.
>
> Thanks,
> 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/-/Cpw8-j0ZqlEJ.
> 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

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

2012-09-09 Thread Babatunde Akinyanmi
Have you uncommented the url pattern that activates the admin site?

On 9/9/12, TJ Max  wrote:
> Please tell us what your urls.py is
>
> On Sat, Sep 8, 2012 at 6:02 PM, David Perez
> wrote:
>
>> Hi,
>>
>> I am new to Django, I am actually starting its tutorial. On part 2 it
>> enables the admin site, but I can't log in to it. The following error
>> comes
>> up (see at the bottom):
>>
>> If I remember correctly I did not get prompt to create a superuser when I
>> wrote *python manage.py syncdb*, so I am not sure if I do not have a
>> superuser. I tried to create it with *python manage.py createsuperuser
>> --username=david* but it is not working.
>>
>> I am most certain it is something simple...and I tried to follow the
>> steps
>> as exact as I could. I appreciate your help
>> David
>>
>>
>> DoesNotExist at /admin/
>>
>> Site matching query does not exist.
>>
>> Request Method:GET Request URL:http://127.0.0.1:8000/admin/ Django
>> Version:1.4.1Exception Type: DoesNotExistException Value:
>>
>>
>> Site matching query does not exist.
>>
>> Exception
>> Location:/Library/Python/2.7/site-packages/django/db/models/query.py in
>> get, line 366Python
>> Executable: /usr/bin/pythonPython Version: 2.7.1Python Path:
>>
>>
>> ['/Users/Dperezc/Desktop/Estudios independientes/Django/Proyecto1_Poll',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
>>
>> '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
>>  '/Library/Python/2.7/site-packages']
>>
>> Server time: Sat, 8 Sep 2012 18:45:28 -0600
>>
>>
>>
>>
>>  --
>> 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/-/YzfZzN7HgtoJ.
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Installing a django project, database issue ?

2012-09-23 Thread Babatunde Akinyanmi
Hi,
Are you sure brisket was installed properly? Try importing it from
your python console. Also, can you show your settings.py
INSTALLED_APPS setting?

On 9/22/12, new_user  wrote:
> I am installing the sunlight fondation's brisket and I am really new to
> python, and even more to django. So I downloaded on github the project :
> https://github.com/sunlightlabs/brisket.
>
> So, when I run the ./manage.py run server command, I get an error message.
> But I know nothing from python and django.
>
> Here's my database config :
>
> DATABASE_ENGINE = 'django.db.backends.mysql'
> DATABASE_NAME = 'brisker'
> DATABASE_USER = 'root'
> DATABASE_PASSWORD = 'euler;.'
> DATABASE_HOST = '127.0.0.1'
> DATABASE_PORT = ''
>
> So now here's the error message, am I supposed to install a package ?
>
>
>
> Unhandled exception in thread started by  Command.inner_run of  object at 0x976b84c>>
> Traceback (most recent call last):
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
>
> line 88, in inner_run
> self.validate(display_num_errors=True)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 249, in validate
> num_errors = get_validation_errors(s, app)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
>
> line 36, in get_validation_errors
> for (app_name, error) in get_app_errors().items():
>   File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
> 146, in get_app_errors
> self._populate()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
> 61, in _populate
> self.load_app(app_name, True)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line
> 76, in load_app
> app_module = import_module(app_name)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
> 35, in import_module
> __import__(name)
> ImportError: No module named brisket.influence
>
>   Could some one help ?
>
> Best,
> M.
>
> --
> 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/-/fJRgT-Cka1wJ.
> 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

-- 
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 on Bluehost

2012-09-24 Thread Babatunde Akinyanmi
If cloud, I like dotcloud

On 9/24/12, Alec Taylor  wrote:
> You will probably crap-out with Bitbucket. Go to a cloud provider instead.
>
> For example, Red Hat OpenShift offers their IaaS platform for free (ATM
> anyway).
>
> On Mon, Sep 24, 2012 at 2:21 PM, Zach  wrote:
>
>> Hey everyone,
>> I have recently been setting up a Django 1.4.1 project with python 2.7.2
>> and MySQL. I am using fcgi to deploy my project in this environment
>> because
>> mod_wsgi is not available through bluehost. After much frustration I have
>> gotten my site up to display the "it works" page. Now for some strange
>> reason I can not get it away from this page. I have set up the urls.py
>> file
>> for the main project along with adding my app into the Installed_Apps
>> section of the settings.py file.
>> My .htaccess file is the following
>> *AddHandler fcgid-script .fcgi*
>> *Options +SymLinksIfOwnerMatch*
>> *RewriteEngine On*
>> *RewriteBase /*
>> *RewriteRule ^(media/.*)$ - [L]*
>> *RewriteRule ^(adminmedia/.*)$ - [L]*
>> *RewriteCond %{REQUEST_URI} !(mysite.fcgi)*
>> *RewriteRule ^(.*)$ mysite.fcgi/$1 [L]*
>>
>> My mysite.fcgi is the following
>> *#!/home1/propesn4/python27/bin/python*
>> *import sys, os*
>> *sys.path.insert(0, "/home1/propesn4/python27")*
>> *os.environ['DJANGO_SETTINGS_MODULE'] = "project.settings"
>> *
>> *sys.path.append("/home1/propesn4/project/")*
>> *from django.core.servers.fastcgi import runfastcgi*
>> *runfastcgi(method="threaded", daemonize="false")*
>> *
>> *
>> When I make changes to my django project I preform a *touch mysite.fcgi*
>> so
>> that the fcgi agent knows there has been changes.
>> If anyone could lead me in the right direction I would really appreciate
>> it!
>>
>>  --
>> 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/-/Aqyku-yyimsJ.
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Virtualenvs and editing contrib stuff manually

2012-09-27 Thread Babatunde Akinyanmi
No you won't be smitten.

As for isolating your edited django, you can do that but then you
would have to be responsible for improving the code base by yourself.
Also, your edit might inadvertently break django or introduce bugs
that you might find difficult to trace and solve or that might change
some of the logic required to make django work.

On 9/27/12, Chris Pagnutti  wrote:
> Hi.  First-time poster here.  Feel free to point out any rules I'm not
> following.
>
> I've been looking around for how to make the django.contrib.auth User
> classe's "email" field to be unique and required.  There are bunches of
> ways to do it, but it's just s darn easy to go into the source and
> change how the field is defined.
> e.g. email = models.EmailField(_('email address'),unique=True)
>
> But in my searches, I've read warnings that you should not do this.  The
> reason, if it is given, is that you'll break your app if you update the
> contrib packages.  But what if I work in virtualenvs and just leave the
> django version and packages intact for that particular app in that
> particular environment?  What are the other practical and philosophical
> reasons for NOT editing the contrib source?  Will I be smitten from the
> django community if I do so?
>
> Thanks to all.
>
> --
> 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/-/YX9X8u9mdbwJ.
> 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

-- 
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: conditional model validation

2012-09-27 Thread Babatunde Akinyanmi
Let me try to assist. A forms is_valid method causes 3 types of
cleaning methods to be run. Based on that, I'm sure you really don't
need to override it.

I really don't understand what you mean by "I want the description
field to be not blank/not the empty string" so maybe I could have been
of more help but I'm sure a solution to your problem would be to
override either the form's clean_fieldname or clean methods.

Check: https://docs.djangoproject.com/en/dev/ref/forms/validation/
which is a link to the documentation on form validation

On 9/28/12, Lachlan Musicman  wrote:
> Hola,
>
> I'm searching without much luck and can't see the answer in the docs.
>
> Am wanting to override the is_valid() method on a model (I think
> that's what I want).
>
> Basically, I have a choices field, and if one of those choices is
> selected, then I want a description field to be not blank/not the
> empty string. If it's the other two choices, I want the description
> field to be blank/empty string.
>
> First, I override is_valid() as a model method?
>
> Second, how do I return a false from is_valid()?
>
> ie, this is a rough up of what I'm looking for - what goes in place of
> return FALSE/TRUE?
>
> def is_valid(self):
>
> if enrolment.mark == 'W': #student has withdrawn from course
> -if enrolment.withdrawal_reason == '': #must have reason
> --return FALSE
> elif enrolment.withdrawal.reason != "": #ie, since enrolment.mark
> isn't 'W', confirm that the enrolment.reason is ""
> -return FALSE
> else:
> -return TRUE
>
> Cheers
> L.
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world
> was in the grip of authentic-seeming future narratives. He said, “We
> look at the present through a rear-view mirror. We march backwards
> into the future.”
>
> http://www.warrenellis.com/?p=14314
>
> --
> 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

-- 
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: Tools - Slow in python django fw

2012-10-01 Thread Babatunde Akinyanmi
There are reasons why your app is slow but nobody would be able to
tell you without viewing your sources. You can profile the app and
pinpoint where exactly is slow and ask for advise from the list.

You can install django-debug-toolbar to profile your database queries.

On 10/1/12, siva <85s...@gmail.com> wrote:
> Hi ,
>
> We have converted our tools from php to django framework but tool
> performance is very slow compare to php .
>
> Please let us what are things we have to do ...
>
> Thanks,
> Siva
>
> --
> 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/-/7s9SZXW-TYUJ.
> 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

-- 
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: The view didn't return an HttpResponse object.

2012-10-01 Thread Babatunde Akinyanmi
Its possible that when you refresh the form and the POST request gets
submitted, the form doesn't pass the form.is_valid() if conditional.
In your code, you didn't make any provision for when the form fails
the is_valid() test and from your code, execution stops once
is_valid() returns False so I **guess** that's where the problem lies.

Try re-rendering the submitted form if is_valid is False or doing a redirect.

On 10/1/12, Satinderpal Singh  wrote:
> I made a model form and a view which accepts input as a form and
> display it in the html format. As when i refresh the html page or try
> to fill another entry in the form, it gives the following error:
>
> The view Automation.report.views.chemical_analysis didn't return an
> HttpResponse object.
>
> Here is the views that creates this problem:
> def chemical_analysis(request):
>   if request.method=='POST':
>   form = chem_analysisForm(request.POST)
>   if form.is_valid():
>   cd = form.cleaned_data
>   form.save()
>   chem = chem_analysis.objects.all()
>   #return HttpResponseRedirect(chem)
>   return 
> render_to_response('report/chemical_analysis.html',
> {'chem': chem,},context_instance=RequestContext(request))
>   
>   else:
>   form = chem_analysisForm()
>   return render_to_response('report/report.html', 
> {"form":form},
> context_instance=RequestContext(request))
>   
> Any help regarding this will be highly appreciated.
>
> --
> Satinderpal Singh
> http://satindergoraya.blogspot.in/
> http://satindergoraya91.blogspot.in/
>
> --
> 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

-- 
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: The view didn't return an HttpResponse object.

2012-10-01 Thread Babatunde Akinyanmi
Oooops. I see the question has already been answered. My phone didn't
get the update on time.

On 10/1/12, Babatunde Akinyanmi  wrote:
> Its possible that when you refresh the form and the POST request gets
> submitted, the form doesn't pass the form.is_valid() if conditional.
> In your code, you didn't make any provision for when the form fails
> the is_valid() test and from your code, execution stops once
> is_valid() returns False so I **guess** that's where the problem lies.
>
> Try re-rendering the submitted form if is_valid is False or doing a
> redirect.
>
> On 10/1/12, Satinderpal Singh  wrote:
>> I made a model form and a view which accepts input as a form and
>> display it in the html format. As when i refresh the html page or try
>> to fill another entry in the form, it gives the following error:
>>
>> The view Automation.report.views.chemical_analysis didn't return an
>> HttpResponse object.
>>
>> Here is the views that creates this problem:
>> def chemical_analysis(request):
>>  if request.method=='POST':
>>  form = chem_analysisForm(request.POST)
>>  if form.is_valid():
>>  cd = form.cleaned_data
>>  form.save()
>>  chem = chem_analysis.objects.all()
>>  #return HttpResponseRedirect(chem)
>>  return 
>> render_to_response('report/chemical_analysis.html',
>> {'chem': chem,},context_instance=RequestContext(request))
>>  
>>  else:
>>  form = chem_analysisForm()
>>  return render_to_response('report/report.html', 
>> {"form":form},
>> context_instance=RequestContext(request))
>>  
>> Any help regarding this will be highly appreciated.
>>
>> --
>> Satinderpal Singh
>> http://satindergoraya.blogspot.in/
>> http://satindergoraya91.blogspot.in/
>>
>> --
>> 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
>

-- 
Sent from my mobile device

-- 
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 Admin asks password every operation

2012-10-06 Thread Babatunde Akinyanmi
I suspect Bill's answer is what you are looking for as regards the
url. However, it won't solve the password problem

On 10/6/12, Stefano T  wrote:
> What i want is to match the root of my website with a url.
>
> On Saturday, October 6, 2012 12:53:08 AM UTC+2, ke1g wrote:
>>
>> All urls match this.  The regular expression says "any URL that starts
>> from the beginning, no matter what follows.  I suspect that you want
>> 'r^$'
>>
>> Bill
>>
>> On Fri, Oct 5, 2012 at 2:15 PM, Stefano T
>> > wrote:
>> > wait i may have spotted out the problem:
>> > if i've an app, is this the correct url pattern for the homepage?
>> >
>> > url(r'^', 'earth.views.Home'),
>> >
>> > or does it take ll the urls?
>> >
>> >
>> > On Friday, October 5, 2012 8:10:09 PM UTC+2, Stefano T wrote:
>> >>
>> >> i didn't est SESSION_COOKIE_AGE anywhere, so i suppose it's set to its
>> >>
>> >> default value.
>> >> Cookies are enabled.
>> >> i'm facing the problem in chrome (i deleted all the browser data,
>> nothing
>> >> changed)
>> >> with FF it works.
>> >> Before it was working with chrome, suddently it stopped.
>> >>
>> >> On Friday, October 5, 2012 7:32:16 PM UTC+2, Larry@gmail.comwrote:
>> >>
>> >>>
>> >>> On Fri, Oct 5, 2012 at 10:57 AM, Stefano T
>> >>>  wrote:
>> >>> > Hi all.
>> >>> > i'm new to django and i'm facing a problem i can't solve so far.
>> >>> > Basically, when i log in in the admin part, every operation i do it
>> >>> >
>> >>> > ask me for the login. doesn't matter which browser i user, it's
>> always
>> >>> > the same.
>> >>> > at the beginning it was acting normally: once logged in i stay
>> logged
>> >>> > in until the logout.
>> >>> > idea?
>> >>>
>> >>> What is SESSION_COOKIE_AGE set to in your settings file? Or are
>> >>> cookies disabled for your browser?
>> >
>> > --
>> > 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/-/jJ7LrE2_TC0J.
>> >
>> > To post to this group, send email to
>> > django...@googlegroups.com.
>>
>> > To unsubscribe from this group, send email to
>> > django-users...@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/-/Qj_oADXTnvIJ.
> 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

-- 
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: Should we have a database independent SQL like query language in Django?

2012-10-06 Thread Babatunde Akinyanmi
IMO, 'fake sql' would be another layer of abstraction *like the the
ORM* over different databases that don't work the same way. The result
would be the same. Since the ORM works fine, the ORM could be improved
to cater for some of these more complex cases. It leaves using django
a matter of learning python and not python and another sql language.
My 50 kobo

On 10/6/12, Yugal Jindle  wrote:
> *Note :*
>
>  - I know we have `Django ORM` already that keeps things database
> independent and converts to the database specific `SQL` queries.
>  - Once things starts getting complicated it is preferred to write `raw
> SQL` queries for better efficiency.
>  - When you write `raw sql` queries your code gets trapped with the
> database you are using.
>  - I also understand its important to use the full power of your database
> that can-not be achieved with the `django orm` alone.
>
> *My Question :*
>
>  - Until I use any database specific feature, why should one be trapped
> with the database.
>  - For instance :
>
> We have a query with multiple joins and we decided to write a raw sql
>> query. Now, that makes my website `postgres` specific. Even when I
>> have not used any postgres specific feature.
>
>
> I feel there should be some `fake sql` language which can translate to any
> database's sql query. Even Django's ORM can be built over it. So, that if
> you go out of ORM but not database specific - you can still remain database
>
> independent.
>
> I asked the same question to `Jacob Kaplan Moss` (In person) :
>
>  - He advised me to stay with the database that I like and endure its whole
>
> power, to which I agree. But my point was not that we should be `database
> independent`.
>  - My point is we should be database independent until we use a database
> specific feature.
>
> *
> *
> *Please explain, why should be there a `fake sql` layer over the actual sql
>
> ?*
>
> --
> 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/-/cQW4Vpc9ueYJ.
> 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

-- 
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 do I upgrade to 1.4.2?

2012-10-18 Thread Babatunde Akinyanmi
Add --upgrade option

On 10/18/12, scottc  wrote:
> I'm new to django, with a (vanilla) 1.4.0 install, and am knee deep in a
> project.
>
> Can I simply *pip install django* and have everything update properly or
> will that fubar my existing project?
>
> (Win7, Python 2.7.2, django installed in a virtualenv using pip)
>
>
> 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/-/A14BHWhiuC4J.
> 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

-- 
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: saving several models with one save() call

2011-08-24 Thread Babatunde Akinyanmi
You will need to save the A object first. What you can do is override
the save method for B model. In the function, check for which argument
in *args is an A object. When found, call the super method for A's
default save method then call the super method for B's default save
method. That should work just fine.
I haven't tried it but I believe it would work. I'm an accountant and
there's a lot of work on my table right now but I could find time
during break to try algorithm and tell you if it works


On 8/23/11, ernando  wrote:
> Hi all,
>
> maybe it's newbie question but I wasn't able to find clear answer/
> solution on it.
>
> For example, we have the following models:
>
> class A(models.Model):
> id = models.AutoField(primary_key=True)
> title = models.CharField(max_length=30)
>
> class B(models.Model):
> id = models.AutoField(primary_key=True)
> title = models.CharField(max_length=30)
> aItems = models.OneToOneField(A)
>
> And try to save them in the following way:
>
> a = A(title="123")
> b = B(title="333", aItems = a)
> b.save()
>
> This code runs with the error: (1364, "Field 'aItems_id' doesn't have
> a default value")
> if I firstly save a object - everything goes smoothly. So, the
> question is - should we always save all related objects manually?
> According to django docs we have to create object at first. But that's
> now always convenient - e.g. I receive full model from the 3rd part
> service and want to save it into DB with one call and not do it for
> each item.
>
> Regards,
> Dmitry
>
> --
> 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

-- 
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 at activating the admin site (Django tutorial part 2)

2011-08-25 Thread Babatunde Akinyanmi
Please say exactly what you did. It will be easier to help that way

On 8/25/11, raj  wrote:
> In ur urls.py,
> Did u import admin, make it discoverable, and also uncomment the /
> admin/ url?
> Also, make sure that you syncdb by running python manage.py syncdb.
> Lemme know if that helps :)
> On Aug 25, 9:29 am, pasztilla  wrote:
>> Hi there,
>> I'm just trying to accomodate myself with Django - and so I tried to
>> go through the Django Tutorial from the Django official site. There
>> went everything ok with part 1,  but at the very beginning of the part
>> 2 I've met a problem(https://docs.djangoproject.com/en/1.3/intro/
>> tutorial02). In spite of that I've perform all settings/changes
>> described in the 'Activate the admin site' section going to the next
>> section 'Start the development server' (ie. 127.0.0.1:8000/admin/) led
>> merely to an error message:
>>
>> "DoesNotExist at /admin/
>> Site matching query does not exist.
>> Request Method:
>> GET
>> Request URL:http://127.0.0.1:8000/admin/
>> Django Version:
>> 1.3
>>
>> Exception Type:
>> DoesNotExist
>>
>> Exception Value:
>> Site matching query does not exist.
>>
>> Exception Location:
>>
>> D:\Python27\lib\site-packages\django\db\models\query.py in get, line
>> 349
>>
>> Python Executable:
>> D:\Python27\python.exe
>>
>> Python Version:
>> 2.7.1"
>>
>> [...]
>> and something more:
>>
>> "Settings
>> Using settings module mysite.settings
>>
>> Setting
>> Value
>>
>> USE_L10N
>> True
>>
>> USE_THOUSAND_SEPARATOR
>> False
>>
>> LANGUAGE_CODE
>> 'en-us'
>>
>> ROOT_URLCONF
>> 'mysite.urls'
>>
>> MANAGERS
>> ()
>>
>> DEFAULT_CHARSET
>> 'utf-8'
>>
>> STATIC_ROOT
>> ''
>>
>> TEST_DATABASE_CHARSET
>> None
>>
>> MESSAGE_STORAGE
>> 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'
>>
>> DATABASE_HOST
>> ''
>>
>> IGNORABLE_404_STARTS
>> ('/cgi-bin/', '/_vti_bin', '/_vti_inf')
>>
>> SEND_BROKEN_LINK_EMAILS
>> False
>>
>> URL_VALIDATOR_USER_AGENT
>> 'Django/1.3 (http://www.djangoproject.com)'
>>
>> STATICFILES_FINDERS
>> ('django.contrib.staticfiles.finders.FileSystemFinder',
>>  'django.contrib.staticfiles.finders.AppDirectoriesFinder')
>>
>> SESSION_COOKIE_DOMAIN
>> None
>>
>> SESSION_COOKIE_NAME
>> 'sessionid'
>>
>> COMMENTS_MODERATORS_GROUP
>> None
>>
>> TIME_INPUT_FORMATS
>> ('%H:%M:%S', '%H:%M')
>>
>> DATABASES
>> {'default': {'ENGINE': 'django.db.backends.sqlite3',
>>              'HOST': '',
>>              'NAME': 'D:/.../mysite/sqlite3.db',
>>              'OPTIONS': {},
>>              'PASSWORD': '',
>>              'PORT': '',
>>              'TEST_CHARSET': None,
>>              'TEST_COLLATION': None,
>>              'TEST_MIRROR': None,
>>              'TEST_NAME': None,
>>              'TIME_ZONE': 'Europe/Budapest',
>>              'USER': ''}}
>>
>> TEST_DATABASE_NAME
>> None
>>
>> FILE_UPLOAD_PERMISSIONS
>> None
>>
>> FILE_UPLOAD_HANDLERS
>> ('django.core.files.uploadhandler.MemoryFileUploadHandler',
>>  'django.core.files.uploadhandler.TemporaryFileUploadHandler')
>>
>> DEFAULT_CONTENT_TYPE
>> 'text/html'
>>
>> APPEND_SLASH
>> True
>>
>> FIRST_DAY_OF_WEEK
>> 0
>>
>> DATABASE_ROUTERS
>> []
>>
>> YEAR_MONTH_FORMAT
>> 'F Y'
>>
>> STATICFILES_STORAGE
>> 'django.contrib.staticfiles.storage.StaticFilesStorage'
>>
>> CACHES
>> {'default': {'BACKEND':
>> 'django.core.cache.backends.locmem.LocMemCache',
>>              'LOCATION': ''}}
>>
>> SERVER_EMAIL
>> 'root@localhost'
>>
>> SESSION_COOKIE_PATH
>> '/'
>>
>> IGNORABLE_404_ENDS
>> ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico',
>> '.php')
>>
>> MIDDLEWARE_CLASSES
>> ('django.middleware.common.CommonMiddleware',
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware')
>>
>> USE_I18N
>> True
>>
>> THOUSAND_SEPARATOR
>> ','
>>
>> SECRET_KEY
>> ''
>>
>> LANGUAGE_COOKIE_NAME
>> 'django_language'
>>
>> FILE_UPLOAD_TEMP_DIR
>> None
>>
>> TRANSACTIONS_MANAGED
>> False
>>
>> LOGGING_CONFIG
>> 'django.utils.log.dictConfig'
>>
>> TEMPLATE_LOADERS
>> ('django.template.loaders.filesystem.Loader',
>>  'django.template.loaders.app_directories.Loader')
>>
>> TEMPLATE_DEBUG
>> True
>>
>> AUTHENTICATION_BACKENDS
>> ('django.contrib.auth.backends.ModelBackend',)
>>
>> TEST_DATABASE_COLLATION
>> None
>>
>> FORCE_SCRIPT_NAME
>> None
>>
>> CACHE_BACKEND
>> 'locmem://'
>>
>> SESSION_COOKIE_SECURE
>> False
>>
>> CSRF_COOKIE_DOMAIN
>> None
>>
>> FILE_CHARSET
>> 'utf-8'
>>
>> DEBUG
>> True
>>
>> SESSION_FILE_PATH
>> None
>>
>> DEFAULT_FILE_STORAGE
>> 'django.core.files.storage.FileSystemStorage'
>>
>> INSTALLED_APPS
>>
>> ['django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.sites',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'polls',
>>  'django.contrib.admin']
>>
>> LANGUAGES
>> (('

Re: Problem at activating the admin site (Django tutorial part 2)

2011-08-25 Thread Babatunde Akinyanmi
The error you stated normally happens when there are problems with the
django_site table created when you start a project.

On 8/25/11, Babatunde Akinyanmi  wrote:
> Please say exactly what you did. It will be easier to help that way
>
> On 8/25/11, raj  wrote:
>> In ur urls.py,
>> Did u import admin, make it discoverable, and also uncomment the /
>> admin/ url?
>> Also, make sure that you syncdb by running python manage.py syncdb.
>> Lemme know if that helps :)
>> On Aug 25, 9:29 am, pasztilla  wrote:
>>> Hi there,
>>> I'm just trying to accomodate myself with Django - and so I tried to
>>> go through the Django Tutorial from the Django official site. There
>>> went everything ok with part 1,  but at the very beginning of the part
>>> 2 I've met a problem(https://docs.djangoproject.com/en/1.3/intro/
>>> tutorial02). In spite of that I've perform all settings/changes
>>> described in the 'Activate the admin site' section going to the next
>>> section 'Start the development server' (ie. 127.0.0.1:8000/admin/) led
>>> merely to an error message:
>>>
>>> "DoesNotExist at /admin/
>>> Site matching query does not exist.
>>> Request Method:
>>> GET
>>> Request URL:http://127.0.0.1:8000/admin/
>>> Django Version:
>>> 1.3
>>>
>>> Exception Type:
>>> DoesNotExist
>>>
>>> Exception Value:
>>> Site matching query does not exist.
>>>
>>> Exception Location:
>>>
>>> D:\Python27\lib\site-packages\django\db\models\query.py in get, line
>>> 349
>>>
>>> Python Executable:
>>> D:\Python27\python.exe
>>>
>>> Python Version:
>>> 2.7.1"
>>>
>>> [...]
>>> and something more:
>>>
>>> "Settings
>>> Using settings module mysite.settings
>>>
>>> Setting
>>> Value
>>>
>>> USE_L10N
>>> True
>>>
>>> USE_THOUSAND_SEPARATOR
>>> False
>>>
>>> LANGUAGE_CODE
>>> 'en-us'
>>>
>>> ROOT_URLCONF
>>> 'mysite.urls'
>>>
>>> MANAGERS
>>> ()
>>>
>>> DEFAULT_CHARSET
>>> 'utf-8'
>>>
>>> STATIC_ROOT
>>> ''
>>>
>>> TEST_DATABASE_CHARSET
>>> None
>>>
>>> MESSAGE_STORAGE
>>> 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'
>>>
>>> DATABASE_HOST
>>> ''
>>>
>>> IGNORABLE_404_STARTS
>>> ('/cgi-bin/', '/_vti_bin', '/_vti_inf')
>>>
>>> SEND_BROKEN_LINK_EMAILS
>>> False
>>>
>>> URL_VALIDATOR_USER_AGENT
>>> 'Django/1.3 (http://www.djangoproject.com)'
>>>
>>> STATICFILES_FINDERS
>>> ('django.contrib.staticfiles.finders.FileSystemFinder',
>>>  'django.contrib.staticfiles.finders.AppDirectoriesFinder')
>>>
>>> SESSION_COOKIE_DOMAIN
>>> None
>>>
>>> SESSION_COOKIE_NAME
>>> 'sessionid'
>>>
>>> COMMENTS_MODERATORS_GROUP
>>> None
>>>
>>> TIME_INPUT_FORMATS
>>> ('%H:%M:%S', '%H:%M')
>>>
>>> DATABASES
>>> {'default': {'ENGINE': 'django.db.backends.sqlite3',
>>>              'HOST': '',
>>>              'NAME': 'D:/.../mysite/sqlite3.db',
>>>              'OPTIONS': {},
>>>              'PASSWORD': '',
>>>              'PORT': '',
>>>              'TEST_CHARSET': None,
>>>              'TEST_COLLATION': None,
>>>              'TEST_MIRROR': None,
>>>              'TEST_NAME': None,
>>>              'TIME_ZONE': 'Europe/Budapest',
>>>              'USER': ''}}
>>>
>>> TEST_DATABASE_NAME
>>> None
>>>
>>> FILE_UPLOAD_PERMISSIONS
>>> None
>>>
>>> FILE_UPLOAD_HANDLERS
>>> ('django.core.files.uploadhandler.MemoryFileUploadHandler',
>>>  'django.core.files.uploadhandler.TemporaryFileUploadHandler')
>>>
>>> DEFAULT_CONTENT_TYPE
>>> 'text/html'
>>>
>>>

Re: Problem at activating the admin site (Django tutorial part 2)

2011-08-25 Thread Babatunde Akinyanmi
Hi paszkan,
First I want you to go to your settings file and tell me what value is
specified for SITE_ID. You will need that value for the next step.

In your terminal where you would have typed "python manage.py
runserver" type "python manage.py shell"

Doing that would load django's inbuilt shell.

Next type:
"from django.contrib.sites.models import Site"
If there's no error type this is where you would need the SITE_ID
setting value. Assuming SITE_ID value is 1 then type:
"Site.objects.get(id=1)"

Do this and give feed back


On 8/25/11, Pászkán Attila  wrote:
> Can you give more details?
>
>
>
> 2011/8/25 Babatunde Akinyanmi 
>
>> The error you stated normally happens when there are problems with the
>> django_site table created when you start a project.
>>
>> On 8/25/11, Babatunde Akinyanmi  wrote:
>> > Please say exactly what you did. It will be easier to help that way
>> >
>> > On 8/25/11, raj  wrote:
>> >> In ur urls.py,
>> >> Did u import admin, make it discoverable, and also uncomment the /
>> >> admin/ url?
>> >> Also, make sure that you syncdb by running python manage.py syncdb.
>> >> Lemme know if that helps :)
>> >> On Aug 25, 9:29 am, pasztilla  wrote:
>> >>> Hi there,
>> >>> I'm just trying to accomodate myself with Django - and so I tried to
>> >>> go through the Django Tutorial from the Django official site. There
>> >>> went everything ok with part 1,  but at the very beginning of the part
>> >>> 2 I've met a problem(https://docs.djangoproject.com/en/1.3/intro/
>> >>> tutorial02). In spite of that I've perform all settings/changes
>> >>> described in the 'Activate the admin site' section going to the next
>> >>> section 'Start the development server' (ie. 127.0.0.1:8000/admin/) led
>> >>> merely to an error message:
>> >>>
>> >>> "DoesNotExist at /admin/
>> >>> Site matching query does not exist.
>> >>> Request Method:
>> >>> GET
>> >>> Request URL:http://127.0.0.1:8000/admin/
>> >>> Django Version:
>> >>> 1.3
>> >>>
>> >>> Exception Type:
>> >>> DoesNotExist
>> >>>
>> >>> Exception Value:
>> >>> Site matching query does not exist.
>> >>>
>> >>> Exception Location:
>> >>>
>> >>> D:\Python27\lib\site-packages\django\db\models\query.py in get, line
>> >>> 349
>> >>>
>> >>> Python Executable:
>> >>> D:\Python27\python.exe
>> >>>
>> >>> Python Version:
>> >>> 2.7.1"
>> >>>
>> >>> [...]
>> >>> and something more:
>> >>>
>> >>> "Settings
>> >>> Using settings module mysite.settings
>> >>>
>> >>> Setting
>> >>> Value
>> >>>
>> >>> USE_L10N
>> >>> True
>> >>>
>> >>> USE_THOUSAND_SEPARATOR
>> >>> False
>> >>>
>> >>> LANGUAGE_CODE
>> >>> 'en-us'
>> >>>
>> >>> ROOT_URLCONF
>> >>> 'mysite.urls'
>> >>>
>> >>> MANAGERS
>> >>> ()
>> >>>
>> >>> DEFAULT_CHARSET
>> >>> 'utf-8'
>> >>>
>> >>> STATIC_ROOT
>> >>> ''
>> >>>
>> >>> TEST_DATABASE_CHARSET
>> >>> None
>> >>>
>> >>> MESSAGE_STORAGE
>> >>> 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'
>> >>>
>> >>> DATABASE_HOST
>> >>> ''
>> >>>
>> >>> IGNORABLE_404_STARTS
>> >>> ('/cgi-bin/', '/_vti_bin', '/_vti_inf')
>> >>>
>> >>> SEND_BROKEN_LINK_EMAILS
>> >>> False
>> >>>
>> >>> URL_VALIDATOR_USER_AGENT
>> >>> 'Django/1.3 (http://www.djangoproject.com)'
>> >>>
>> >>> STATICFILES_FINDERS
>> >>> ('django.contrib.staticfiles.finders.FileSystemFinder',
>> >>>  'django.contrib.staticfiles.finders.AppDirectoriesFinder')

Re: Problem at activating the admin site (Django tutorial part 2)

2011-08-25 Thread Babatunde Akinyanmi
Cool. I'm really interested in finding out what went wrong. If you are
also, try to recreate the problem by using you former username and see
if the problem persists. If it does, its a bug that the community
could consider fixing. That error was thrown by the Site app so I'm
still wondering how a change in user name was able to solve it

On 8/25/11, pasztilla  wrote:
> Hi Babatunde,
>
> Hi Babatunde,
>
>
>
> SITE_ID == 1
>
>
>
> then I did what you've suggested:(see the result)
>
>
>
> Microsoft Windows [verziószám: 6.1.7601]
>
> Copyright (c) 2009 Microsoft Corporation.
> Minden jog fenntartva.
>
>
>
> C:\Users\Pászkán Attila>
>
>
> D:\>cd Atilla\Programoz\Django\Gyakorlaas\mysite
>
>
> D:\Atilla\Programoz\Django\Gyakorlaas\mysite>python manage.py shell
>
>
> Python 2.7.1 (r271:86832, Feb  7 2011, 11:30:38)[MSC v.1500 32 bit
> (Intel)] on win32
>
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
>
>
>>>> from django.contrib.sites.models import Site
>
>>>> Site.objects.get(id=1)
>
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
>   File "D:\Python27\lib\site-packages\django\db\models\manager.py",
> line 132, in get
>
> return self.get_query_set().get(*args, **kwargs)
>
>   File "D:\Python27\lib\site-packages\django\db\models\query.py", line
> 349, in get
>
> % self.model._meta.object_name)
>
> DoesNotExist: Site matching query does not exist.
>
>
>>>>
>
>
>
>
>
>  + 
>
> Meanwhile came an idea that this error could have slyly,
> somehow undercover, something to do with my User Name (under Windows)
> which contains some unusual characters (two á-s, see above) ...
> I've set up a new user (without unusual characters)
> and repeated the whole procedure (building up an application
> according to the tutorial) and it worked fine!!! :-)
>
>
> So, seemingly the problem has been resolved! :-)
> (It would be interesting to find out why and how
> has influenced that unusual user name the functioning
> of my admin-site...but it is maybee to much effort to investigate)
>
> Anyway,  thanks for your efforts and support!
>
> PA
>
>
> On aug. 25, 19:28, Babatunde Akinyanmi  wrote:
>> Hi paszkan,
>> First I want you to go to your settings file and tell me what value is
>> specified for SITE_ID. You will need that value for the next step.
>>
>> In your terminal where you would have typed "python manage.py
>> runserver" type "python manage.py shell"
>>
>> Doing that would load django's inbuilt shell.
>>
>> Next type:
>> "from django.contrib.sites.models import Site"
>> If there's no error type this is where you would need the SITE_ID
>> setting value. Assuming SITE_ID value is 1 then type:
>> "Site.objects.get(id=1)"
>>
>> Do this and give feed back
>>
>> On 8/25/11, Pászkán Attila  wrote:
>>
>>
>>
>> > Can you give more details?
>>
>> > 2011/8/25 Babatunde Akinyanmi 
>>
>> >> The error you stated normally happens when there are problems with the
>> >> django_site table created when you start a project.
>>
>> >> On 8/25/11, Babatunde Akinyanmi  wrote:
>> >> > Please say exactly what you did. It will be easier to help that way
>>
>> >> > On 8/25/11, raj  wrote:
>> >> >> In ur urls.py,
>> >> >> Did u import admin, make it discoverable, and also uncomment the /
>> >> >> admin/ url?
>> >> >> Also, make sure that you syncdb by running python manage.py syncdb.
>> >> >> Lemme know if that helps :)
>> >> >> On Aug 25, 9:29 am, pasztilla  wrote:
>> >> >>> Hi there,
>> >> >>> I'm just trying to accomodate myself with Django - and so I tried
>> >> >>> to
>> >> >>> go through the Django Tutorial from the Django official site. There
>> >> >>> went everything ok with part 1,  but at the very beginning of the
>> >> >>> part
>> >> >>> 2 I've met a problem(https://docs.djangoproject.com/en/1.3/intro/
>> >> >>> tutorial02). In spite of that I've perform all settings/changes
>> >> >>> described in the 'Activate the admin site' section going to the
>> >> >>> next

Re: Installation

2011-08-26 Thread Babatunde Akinyanmi
Hi Prem,
You said your django is located in a folder named Django-1.0.4. That
is where your PYTHONPATH should be set to not Django-1.3. Since you
had multiple python installations, make sure that windows associates
.py files with Python 2.7 and not Python 3.
If it still doesn't work, you can try this though its not a very
elegant solution. Copy the django-admin.py file from wherever your
django installation is into the directory you call the django-admin
command from


On 8/26/11, PremAnand Lakshmanan  wrote:
> Guys,
>
> I have corrected the following,
>
> *1. Uninstalled Python 3.x & Installed Python 2.7.1*
>
> Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
> on win32
> Type "copyright", "credits" or "license()" for more information.
>
> *2. Created a PYTHONPATH variable
> *
> PYTHONPATH and value set to c:\Django-1.3
>
>
> *Still, I get the same error, *
>
> Traceback (most recent call last):
>   File "", line 1, in 
> django
> NameError: name 'django' is not defined
>
> I have not installed anything other than downloading and setting the path..
>
> What else should I do to correct this problem? If anyone can give me step to
> step process that would be helpful.
>
> Thanks,
> Prem
> On Fri, Aug 26, 2011 at 9:29 AM, donaldww
> wrote:
>
>> Django is not compatible with version 3.x of Python. The django
>> library was most likely installed into your 2.x lib.
>>
>> DW
>>
>> On Aug 25, 11:47 pm, prem  wrote:
>> > Hi,
>> >
>> > Im trying to install Django but Im not succcessfull.
>> >
>> > The python has been installed properly.
>> >
>> > This is my python shell,
>> >
>> > Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit
>> > (Intel)] on win32
>> > Type "copyright", "credits" or "license()" for more information.
>> >
>> > When I try import django command, I get the following error,
>> >
>> > Traceback (most recent call last):
>> >   File "", line 1, in 
>> > import django
>> > ImportError: No module named django
>> >
>> > Python is located & installed in C:/python32 folder
>> > Django is located in C:/Django-1.0.4 folder
>> >
>> > This is how my path variable looks like, If you notice you can see
>> > Python & Django folder at the last.
>> >
>> > C:\Hyperion\AnalyticServices\bin;C:\Hyperion\AnalyticServices\bin;C:
>> > \Hyperion\AnalyticServices\bin;C:\app\PremVidya\product
>> > \11.2.0\dbhome_1\bin;C:\Hyperion\AnalyticServices\bin;C:\Hyperion
>> > \AnalyticServices\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%
>> > \System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:
>> > \Program Files\Dell\Dell Wireless WLAN Card;C:\Program Files\Common
>> > Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\Microsoft SQL
>> > Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS
>> > \Binn\;%HYPERION_HOME%\common\ODBC\Merant\5.2\Drivers;C:\Hyperion/
>> > common/EssbaseRTC/9.3.1/bin;C:\Hyperion\BIPlus\bin;C:\Hyperion\BIPlus
>> > \lib;C:\Hyperion\common\SAP\bin;C:\Hyperion\common\CLS\9.3.1\bin
>> > \windows;C:\Program Files\QuickTime\QTSystem\;C:\Python32;c:
>> > \Django-1.0.4
>> >
>> > Please help me out,
>> >
>> > Thanks,
>> > Prem
>>
>> --
>> 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.
>>
>>
>
>
> --
> Prem
> 408-393-2545
>
> --
> 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

-- 
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: Select all users that have undone jobs (select, groupby, count)

2011-08-29 Thread Babatunde Akinyanmi
I think the best way is to create a custom manager for the job (check
the documentation for details-managers). In the manager, do a query
that gets all the users with undone jobs by using the filter option
(also see the documentation - making queries). From the resulting
querydict you could count the occurrence of each unique user in the
querydict to form your dictionary.  This could be potentially
inefficient so make sure you save the first query in a variable and
work with that variable.

Meanwhile someone else might know a less verbose way to do it.

On 8/29/11, muzhig  wrote:
> Hello!
> I have model Job, that is linked to User.
> Job has flag `done` that indicates progress of this job.
>
> How to select list of all users, that have undone jobs, annotated by count
> of this undone jobs?
>
> I need this dict: { user1: 4, user2:12  }
>
> --
> 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/-/948LTdoWGq4J.
> 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

-- 
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: newbie question on activating the automatic admin

2011-09-09 Thread Babatunde Akinyanmi
Hi nara,
This error is normally thrown when the sites app is being used in a
django project. I think it can also occur if the sites tables in the
database is not properly created during django-admin startproject.
Someone else reported that he was able to solve the problem by using a
user name without special characters.

This might be difficult to debug since you are using a development
version however:
1. Go to the inbuilt django shell and enter these commands:
from django.contrib.sites.models import Site
>From django.conf import settings
x = settings.SITE_ID
Site.objects.get(pk=x)

You should get the same "site matching query does not exist" error.
Now print x and then check the django_site_table in your database. x
should be the same as the primary key of what you have in the table.
If it isn't, drop the table and syncdb again.

On 9/10/11, nara  wrote:
> yes, admin is in INSTALLED_APPS. BTW, the basic site works fine if I
> turn
> off all admin. admin is not strictly necessary, it is just a nicety.
>
> One strange thing though: I have had to set PYTHONPATH and
> explicitly set it to ~/mblog:~/mblog/apps:~/mblog/apps/myblog,
> even though __init__.py files exist at all levels! Could
> something as basic as Python module search be broken?
> I am using latest Python 2.7 on Ubuntu 11.04
>
> Thanks
> Nara
>
> On Sep 9, 5:35 pm, Casey Greene  wrote:
>> Is admin in INSTALLED_APPS?
>>
>> https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-INSTA...
>>
>> Casey
>>
>> On 09/09/2011 07:04 PM, nara wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Hi,
>>
>> > I am a newbie, and I am trying a very basic blog site to get familiar
>> > with the latest development release. I followed the directions in the
>> > tutorial (part 2) to try and get the automatic admin going. However,
>> > here is what I get on the url localhost:8000/admin/
>>
>> > DoesNotExist at /admin/
>>
>> > Site matching query does not exist.
>>
>> > Request Method:    GET
>> > Request URL:      http://localhost:8000/admin/
>> > Django Version:    1.4 pre-alpha SVN-16741
>> > Exception Type:    DoesNotExist
>> > Exception Value:
>>
>> > Site matching query does not exist.
>>
>> > Further, syncdb, even on a brand new database, does not create tables
>> > for the admin, just for django and my blog model.
>>
>> > Ideas, suggestions?
>>
>> > Thanks
>> > Nara
>
> --
> 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

-- 
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 at this -- need some guidance

2011-09-09 Thread Babatunde Akinyanmi
The problem is very clear. Add a related_name argument to those fields
in your model. If you are not sure how to do this, search the
documentation for "related_name"

On 9/10/11, Danny Gale  wrote:
> Hi, I'm learning Django (albeit slowly) and I'm trying to set up a really
> simple database. I want to have Artists, Albums, and Tracks. I want to be
> able to navigate both ways in the db. So you should be able to go from
> artist -> album or from album -> artist. Same thing with album and track. I
> really can't figure it out. Here's the simplest test case I can come up
> with:
>
> class Song(models.Model):
> album   = models.ForeignKey('Album')
>
> class Album(models.Model):
> tracks  = models.ManyToManyField(Song)
>
> when i run syncdb, it comes up with the following error:
> music.album: Reverse query name for m2m field 'tracks' clashes with field
> 'Song.album'. Add a related_name argument to the definition for 'tracks'.
>
> So I go back and add the related_name argument:
> class Song(models.Model):
> album   = models.ForeignKey('Album')
>
> class Album(models.Model):
> tracks  = models.ManyToManyField(Song, related_name='album')
>
> and run syncdb again:
> music.album: Accessor for m2m field 'tracks' clashes with field
> 'Song.album'. Add a related_name argument to the definition for 'tracks'.
> music.album: Reverse query name for m2m field 'tracks' clashes with field
> 'Song.album'. Add a related_name argument to the definition for 'tracks'.
>
> uh oh. Now there's *TWO* errors!!! What am I doing wrong?
>
> --
> 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/-/1i5-cwJxoqAJ.
> 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

-- 
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: newbie question on activating the automatic admin

2011-09-10 Thread Babatunde Akinyanmi
Hi nara,
Please post the debug output you get when you try to view the admin
page from your browser.

Meanwhile, while switching versions of django, you have to make sure
you remove completely every file from the old version. Failure to do
that will break django.

On 9/10/11, nara  wrote:
> ok, I switched to the 1.3.1 released version of Django, and
> also tried Python2.6 instead of Python2.7 on the dev version
> of Django. Things are still majorly broken, see the following
> in the django shell on a fresh startproject, I could not
> import even the top level django module. Then,
> I set PYTHONPATH to /home/nara/Django1.3/django,
> and after that, in the shell, I am still unable to
> directly import the admin module, I have to do this:
>
>>>> import django
>>>> import django.contrib
>>>> import django.contrib.admin
>
> So, the problem is not just in the admin module, it
> is likely all over the place (entire django module hierarchy).
>
> Oh well, looks like I have to cool this off for a while.
>
> Thanks for everyone's help.
> Nara
>
>
>
>
> On Sep 10, 2:17 pm, nara  wrote:
>> I'll get through this yet :)
>>
>> I tried the commands you have under the django shell, and I got
>> 'example.com'
>> on the django.Site query, and not an error. Also, interestingly,
>> within the shell, I don't see
>> django on the sys.path at all (shown below), but I do see my project
>> mblog. This could
>> be the cause of not seeing the admin. I could switch to python 2.6
>> instead
>> of python 2.7, but I doubt that that is going fix this issue. Dropping
>> my project
>> table and doing a new syncdb did not help either.
>>
>> Here is the path, prettified:
>>
>> ['/home/nara/dj/mblog'
>>  '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg'
>>  '/usr/local/lib/python2.7/dist-packages/grin-1.2.1-py2.7.egg'
>>  '/usr/local/lib/python2.7/dist-packages/pip-1.0.2-py2.7.egg'
>>  '/usr/lib/python2.7'
>>  '/usr/lib/python2.7/plat-linux2'
>>  '/usr/lib/python2.7/lib-tk'
>>  '/usr/lib/python2.7/lib-old'
>>  '/usr/lib/python2.7/lib-dynload'
>>  '/usr/local/lib/python2.7/dist-packages'
>>  '/usr/lib/python2.7/dist-packages'
>>  '/usr/lib/python2.7/dist-packages/PIL'
>>  '/usr/lib/pymodules/python2.7/gtk-2.0'
>>  '/usr/lib/python2.7/dist-packages/gst-0.10'
>>  '/usr/lib/python2.7/dist-packages/gtk-2.0'
>>  '/usr/lib/pymodules/python2.7'
>>  '/usr/lib/pymodules/python2.7/ubuntuone-control-panel'
>>  '/usr/lib/pymodules/python2.7/libubuntuone'
>>  '/usr/lib/pymodules/python2.7/ubuntuone-storage-protocol'
>>  '/usr/lib/pymodules/python2.7/ubuntuone-client']
>>
>> Thanks
>> Nara
>>
>> On Sep 9, 9:56 pm, Babatunde Akinyanmi  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Hi nara,
>> > This error is normally thrown when the sites app is being used in a
>> > django project. I think it can also occur if the sites tables in the
>> > database is not properly created during django-admin startproject.
>> > Someone else reported that he was able to solve the problem by using a
>> > user name without special characters.
>>
>> > This might be difficult to debug since you are using a development
>> > version however:
>> > 1. Go to the inbuilt django shell and enter these commands:
>> > from django.contrib.sites.models import Site
>> > From django.conf import settings
>> > x = settings.SITE_ID
>> > Site.objects.get(pk=x)
>>
>> > You should get the same "site matching query does not exist" error.
>> > Now print x and then check the django_site_table in your database. x
>> > should be the same as the primary key of what you have in the table.
>> > If it isn't, drop the table and syncdb again.
>>
>> > On 9/10/11, nara  wrote:
>>
>> > > yes, admin is in INSTALLED_APPS. BTW, the basic site works fine if I
>> > > turn
>> > > off all admin. admin is not strictly necessary, it is just a nicety.
>>
>> > > One strange thing though: I have had to set PYTHONPATH and
>> > > explicitly set it to ~/mblog:~/mblog/apps:~/mblog/apps/myblog,
>> > > even though __init__.py files exist at all levels! Could
>> > > something as basic as Python module search be broken?
>> > &

Re: two views in one url

2011-09-11 Thread Babatunde Akinyanmi
Hi cha,
Programming in django is just programming in python. Views are just
normal python functions that are called from urls.py which contains
pattern which is also a function.
If you want both views in one file, do exactly that. You could cut and
paste the view in the second app and paste it in the first apps view
then adjust the pattern in your urls.py file.
Or better still you could create a new file and cut and paste the
functions in the first and second view into that new file and make the
adjustment in your urls.py file.
If you still don't understand the explanation you could copy and paste
the your urls file here or someone might be able to provide a link to
some resource on the web.
You need to be comfortable with programming with python for you to get
the hang of django.

On 9/11/11, cha  wrote:
> Hello all I have two views in two app and I want to get them in main
> url file how I Can do that ?
>
> first view in project/app_news/views.py
>
> def article_index(request):
> return render_to_response('news/index.html', {
> 'news_slide':  Article.objects.filter(status=1,
> statusslide=1)[:6],
> 'section_list' : Section.objects.all(),
> 'last_lib' : Library.objects.all()[:3],
> },
> context_instance=RequestContext(request)
> )
>
> secend view in project/app_poll/views.py
>
> def questionlast(request):
> try:
> question = Question.objects.order_by('id').reverse()[0]
> except ObjectDoesNotExist, e:
> raise Http404
> if request.method == 'POST':
> try:
> last_choice_id = request.session[question.id]
> last_choice = Choice.objects.get(id = last_choice_id)
> last_choice.total_votes -= 1
> last_choice.save()
> except KeyError, e:
> pass
> choice_id = int(request.POST['choices'])
> choice = Choice.objects.get(id = choice_id)
> choice.total_votes += 1
> choice.save()
> request.session[question.id] = choice.id
> return HttpResponseRedirect(question.get_results_url())
> if request.method == 'GET':
> try:
> last_choice_id = request.session[question.id]
> last_choice = Choice.objects.get(id = last_choice_id)
> except KeyError, e:
> last_choice = 0
> choices = Choice.objects.filter(question = question)
> payload = {'question':question, 'choices':choices,
> 'last_choice':last_choice}
>
> return render('news/index.html', payload, request)
>
> I want get both views in one template In news/index.html IWant get
> poll in index page
>
> --
> 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

-- 
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 at activating the admin site (Django tutorial part 2)

2011-09-11 Thread Babatunde Akinyanmi
It isn't clear to me also. Initially I was surprised because the site
app doesn't have any dependency on django's user system. Even if it
does, django uses unicode which caters for those characters in your
name.
Well.at least we are sure the problem wsnt from the user name. But
something definetely went wrong. Don't worry about it though

On 9/11/11, pasztilla  wrote:
> Hi Babatunde,
>
> 1. sorry for the delayed answer - but  I was in the last three weeks
> far from any possibility to use the Internet (and Django as well)...
> 2. I have tried to reproduce the phenomenon and with the 'Pászkán
> Attila' as user it worked !  Why? - still it isn't clear.
>
> PA
>
> On Aug 26, 12:20 am, Babatunde Akinyanmi  wrote:
>> Cool. I'm really interested in finding out what went wrong. If you are
>> also, try to recreate the problem by using you former username and see
>> if the problem persists. If it does, its a bug that the community
>> could consider fixing. That error was thrown by the Site app so I'm
>> still wondering how a change in user name was able to solve it
>>
>> On 8/25/11, pasztilla  wrote:
>>
>>
>>
>> > Hi Babatunde,
>>
>> > Hi Babatunde,
>>
>> > SITE_ID == 1
>>
>> > then I did what you've suggested:(see the result)
>>
>> > Microsoft Windows [verziószám: 6.1.7601]
>>
>> > Copyright (c) 2009 Microsoft Corporation.
>> > Minden jog fenntartva.
>>
>> > C:\Users\Pászkán Attila>
>>
>> > D:\>cd Atilla\Programoz\Django\Gyakorlaas\mysite
>>
>> > D:\Atilla\Programoz\Django\Gyakorlaas\mysite>python manage.py shell
>>
>> > Python 2.7.1 (r271:86832, Feb  7 2011, 11:30:38)[MSC v.1500 32 bit
>> > (Intel)] on win32
>>
>> > Type "help", "copyright", "credits" or "license" for more information.
>> > (InteractiveConsole)
>>
>> >>>> from django.contrib.sites.models import Site
>>
>> >>>> Site.objects.get(id=1)
>>
>> > Traceback (most recent call last):
>>
>> >   File "", line 1, in 
>>
>> >   File "D:\Python27\lib\site-packages\django\db\models\manager.py",
>> > line 132, in get
>>
>> >     return self.get_query_set().get(*args, **kwargs)
>>
>> >   File "D:\Python27\lib\site-packages\django\db\models\query.py", line
>> > 349, in get
>>
>> >     % self.model._meta.object_name)
>>
>> > DoesNotExist: Site matching query does not exist.
>>
>> >  + 
>>
>> > Meanwhile came an idea that this error could have slyly,
>> > somehow undercover, something to do with my User Name (under Windows)
>> > which contains some unusual characters (two á-s, see above) ...
>> > I've set up a new user (without unusual characters)
>> > and repeated the whole procedure (building up an application
>> > according to the tutorial) and it worked fine!!! :-)
>>
>> > So, seemingly the problem has been resolved! :-)
>> > (It would be interesting to find out why and how
>> > has influenced that unusual user name the functioning
>> > of my admin-site...but it is maybee to much effort to investigate)
>>
>> > Anyway,  thanks for your efforts and support!
>>
>> > PA
>>
>> > On aug. 25, 19:28, Babatunde Akinyanmi  wrote:
>> >> Hi paszkan,
>> >> First I want you to go to your settings file and tell me what value is
>> >> specified for SITE_ID. You will need that value for the next step.
>>
>> >> In your terminal where you would have typed "python manage.py
>> >> runserver" type "python manage.py shell"
>>
>> >> Doing that would load django's inbuilt shell.
>>
>> >> Next type:
>> >> "from django.contrib.sites.models import Site"
>> >> If there's no error type this is where you would need the SITE_ID
>> >> setting value. Assuming SITE_ID value is 1 then type:
>> >> "Site.objects.get(id=1)"
>>
>> >> Do this and give feed back
>>
>> >> On 8/25/11, Pászkán Attila  wrote:
>>
>> >> > Can you give more details?
>>
>> >> > 2011/8/25 Babatunde Akinyanmi 
>>
>> >> >> The error you stated normally happens when there are problems with
>> >> >> the
>> >> >> django_site table created when you start a

Re: two views in one url

2011-09-11 Thread Babatunde Akinyanmi
This is way off topic for this group but..

To be comfortable with python, the online python documentation is a
very good resource. It seems like you're  a programming noob so also
get books like pragmatic programmer and Python The Hard Way. Of course
there are many more good books on python programming but nobody learns
how to swim by reading books. In other words, the singular act that
will make you a better programmer is doing more programming. You can
also check github and the likes so you can read other people's code
and maybe improve them.

On 9/11/11, cha  wrote:
> thank you very much
> Babatunde Akinyanmi & petey
> Im merge the code and its work
>
> Mr Babatunde Akinyanmi
> acutely I need be comfortable with programming with python
> But I dont Know How to do that
> can you help me and give me the best way to be comfortable and
> professional programmer
>
> --
> 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

-- 
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: newbie question on activating the automatic admin

2011-09-11 Thread Babatunde Akinyanmi
And reply here if you don't see problems :)

On 9/12/11, nara  wrote:
> ok, i am planning to remove all traces of all django installations
> from my
> system, and re-install the dev version (and if that still does not
> work 3.1)
> under virtualenv.
>
> Will repost here if I still see problems.
>
> Nara
>
> On Sep 10, 7:16 pm, Babatunde Akinyanmi  wrote:
>> Hi nara,
>> Please post the debug output you get when you try to view the admin
>> page from your browser.
>>
>> Meanwhile, while switching versions of django, you have to make sure
>> you remove completely every file from the old version. Failure to do
>> that will break django.
>>
>> On 9/10/11, nara  wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > ok, I switched to the 1.3.1 released version of Django, and
>> > also tried Python2.6 instead of Python2.7 on the dev version
>> > of Django. Things are still majorly broken, see the following
>> > in the django shell on a fresh startproject, I could not
>> > import even the top level django module. Then,
>> > I set PYTHONPATH to /home/nara/Django1.3/django,
>> > and after that, in the shell, I am still unable to
>> > directly import the admin module, I have to do this:
>>
>> >>>> import django
>> >>>> import django.contrib
>> >>>> import django.contrib.admin
>>
>> > So, the problem is not just in the admin module, it
>> > is likely all over the place (entire django module hierarchy).
>>
>> > Oh well, looks like I have to cool this off for a while.
>>
>> > Thanks for everyone's help.
>> > Nara
>>
>> > On Sep 10, 2:17 pm, nara  wrote:
>> >> I'll get through this yet :)
>>
>> >> I tried the commands you have under the django shell, and I got
>> >> 'example.com'
>> >> on the django.Site query, and not an error. Also, interestingly,
>> >> within the shell, I don't see
>> >> django on the sys.path at all (shown below), but I do see my project
>> >> mblog. This could
>> >> be the cause of not seeing the admin. I could switch to python 2.6
>> >> instead
>> >> of python 2.7, but I doubt that that is going fix this issue. Dropping
>> >> my project
>> >> table and doing a new syncdb did not help either.
>>
>> >> Here is the path, prettified:
>>
>> >> ['/home/nara/dj/mblog'
>> >>  '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg'
>> >>  '/usr/local/lib/python2.7/dist-packages/grin-1.2.1-py2.7.egg'
>> >>  '/usr/local/lib/python2.7/dist-packages/pip-1.0.2-py2.7.egg'
>> >>  '/usr/lib/python2.7'
>> >>  '/usr/lib/python2.7/plat-linux2'
>> >>  '/usr/lib/python2.7/lib-tk'
>> >>  '/usr/lib/python2.7/lib-old'
>> >>  '/usr/lib/python2.7/lib-dynload'
>> >>  '/usr/local/lib/python2.7/dist-packages'
>> >>  '/usr/lib/python2.7/dist-packages'
>> >>  '/usr/lib/python2.7/dist-packages/PIL'
>> >>  '/usr/lib/pymodules/python2.7/gtk-2.0'
>> >>  '/usr/lib/python2.7/dist-packages/gst-0.10'
>> >>  '/usr/lib/python2.7/dist-packages/gtk-2.0'
>> >>  '/usr/lib/pymodules/python2.7'
>> >>  '/usr/lib/pymodules/python2.7/ubuntuone-control-panel'
>> >>  '/usr/lib/pymodules/python2.7/libubuntuone'
>> >>  '/usr/lib/pymodules/python2.7/ubuntuone-storage-protocol'
>> >>  '/usr/lib/pymodules/python2.7/ubuntuone-client']
>>
>> >> Thanks
>> >> Nara
>>
>> >> On Sep 9, 9:56 pm, Babatunde Akinyanmi  wrote:
>>
>> >> > Hi nara,
>> >> > This error is normally thrown when the sites app is being used in a
>> >> > django project. I think it can also occur if the sites tables in the
>> >> > database is not properly created during django-admin startproject.
>> >> > Someone else reported that he was able to solve the problem by using
>> >> > a
>> >> > user name without special characters.
>>
>> >> > This might be difficult to debug since you are using a development
>> >> > version however:
>> >> > 1. Go to the inbuilt django shell and enter these commands:
>>

Re: Using gedit for django development

2011-09-13 Thread Babatunde Akinyanmi
Oops!
*i'll submit :D

On 9/13/11, Tundebabzy  wrote:
> I'm submit this on Hacker News
>
> On Sep 13, 1:35 am, Mario Gudelj  wrote:
>> This is awesome dude. I was looking for something like this since I moved
>> to
>> Ubuntu.
>>
>> On 13 September 2011 10:12, Micah Carrick  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > I've written a blog post on using gedit, the default text editor in
>> > GNOME,
>> > as a Django IDE. If you're a Linux user and you've never considered
>> > using
>> > gedit for development then this may be an interesting read for you.
>>
>> >http://www.micahcarrick.com/gedit-as-a-django-ide-for-linux.html
>>
>> >  --
>> > 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.
>
>

-- 
Sent from my mobile device

-- 
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: installing django

2011-09-13 Thread Babatunde Akinyanmi
You could at least try to be more specific

On 9/13/11, re64  wrote:
> I am having trouble installing django.  I cant seem to do it any
> suggestions
>
> --
> 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

-- 
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: newbie question on activating the automatic admin

2011-09-15 Thread Babatunde Akinyanmi
Cool

On 9/14/11, nara  wrote:
> Finally! The admin interface worked, when I used the dev version
> in a virtualenv. I cleaned every trace of Django in my system,
> and I had to compile (requires python-dev package in
> Ubuntu) and install MySQLdb into the virtualenv.
>
> Not sure what exactly was wrong before, but Babatunde's suggestion
> that I had mixed up code installed (some in system files, and also
> mixed Django1.3 and the dev release) seems like the best guess.
>
> Thanks for everyone's help ;)
> Nara
>
> On Sep 11, 10:44 pm, Babatunde Akinyanmi  wrote:
>> And reply here if you don't see problems :)
>>
>> On 9/12/11, nara  wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > ok, i am planning to remove all traces of all django installations
>> > from my
>> > system, and re-install the dev version (and if that still does not
>> > work 3.1)
>> > under virtualenv.
>>
>> > Will repost here if I still see problems.
>>
>> > Nara
>>
>> > On Sep 10, 7:16 pm, Babatunde Akinyanmi  wrote:
>> >> Hi nara,
>> >> Please post the debug output you get when you try to view the admin
>> >> page from your browser.
>>
>> >> Meanwhile, while switching versions of django, you have to make sure
>> >> you remove completely every file from the old version. Failure to do
>> >> that will break django.
>>
>> >> On 9/10/11, nara  wrote:
>>
>> >> > ok, I switched to the 1.3.1 released version of Django, and
>> >> > also tried Python2.6 instead of Python2.7 on the dev version
>> >> > of Django. Things are still majorly broken, see the following
>> >> > in the django shell on a fresh startproject, I could not
>> >> > import even the top level django module. Then,
>> >> > I set PYTHONPATH to /home/nara/Django1.3/django,
>> >> > and after that, in the shell, I am still unable to
>> >> > directly import the admin module, I have to do this:
>>
>> >> >>>> import django
>> >> >>>> import django.contrib
>> >> >>>> import django.contrib.admin
>>
>> >> > So, the problem is not just in the admin module, it
>> >> > is likely all over the place (entire django module hierarchy).
>>
>> >> > Oh well, looks like I have to cool this off for a while.
>>
>> >> > Thanks for everyone's help.
>> >> > Nara
>>
>> >> > On Sep 10, 2:17 pm, nara  wrote:
>> >> >> I'll get through this yet :)
>>
>> >> >> I tried the commands you have under the django shell, and I got
>> >> >> 'example.com'
>> >> >> on the django.Site query, and not an error. Also, interestingly,
>> >> >> within the shell, I don't see
>> >> >> django on the sys.path at all (shown below), but I do see my project
>> >> >> mblog. This could
>> >> >> be the cause of not seeing the admin. I could switch to python 2.6
>> >> >> instead
>> >> >> of python 2.7, but I doubt that that is going fix this issue.
>> >> >> Dropping
>> >> >> my project
>> >> >> table and doing a new syncdb did not help either.
>>
>> >> >> Here is the path, prettified:
>>
>> >> >> ['/home/nara/dj/mblog'
>> >> >>  '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg'
>> >> >>  '/usr/local/lib/python2.7/dist-packages/grin-1.2.1-py2.7.egg'
>> >> >>  '/usr/local/lib/python2.7/dist-packages/pip-1.0.2-py2.7.egg'
>> >> >>  '/usr/lib/python2.7'
>> >> >>  '/usr/lib/python2.7/plat-linux2'
>> >> >>  '/usr/lib/python2.7/lib-tk'
>> >> >>  '/usr/lib/python2.7/lib-old'
>> >> >>  '/usr/lib/python2.7/lib-dynload'
>> >> >>  '/usr/local/lib/python2.7/dist-packages'
>> >> >>  '/usr/lib/python2.7/dist-packages'
>> >> >>  '/usr/lib/python2.7/dist-packages/PIL'
>> >> >>  '/usr/lib/pymodules/python2.7/gtk-2.0'
>> >> >>  '/usr/lib/python2.7/dist-packages/gst-0.10'
>> >> >>  '/usr/lib/python2.7/dist-packages/gtk-2.0'

Re: request.method not working as expected

2011-09-20 Thread Babatunde Akinyanmi
Correct me if I'm wrong but it seems your "method" function is
supposed to return the request method type(POST or GET) sent to the
view. If I'm correct then your syntax will always return GET. That's
because I think all the django middleware workings adjust the initial
arguments and the response such that it always ends up as a GET.
Try storing request.method in a variable first and then return that
variable with your HttpResponse like

def method(request):
method_type = request.method
Return HttpResponse(method_type)

Haven't tried it but I'm sure this will give the desired result

On 9/20/11, Fabio Natali  wrote:
> Hi everybody!
>
> I have a very simple view which is supposed to print out GET or POST,
> depending which has been used to send data. The problem is I always get
> "GET" even when sending data via POST.
>
> ### views.py:
> def method(request):
>  return HttpResponse(request.method)
>
> ### urls.py:
> (r'^method/$', method)
>
> ### php script to send data to the Django page:
> http://192.168.0.2:8000/method/";>
>
>
> 
>
> I am running Django version 1.2.5, development server.
>
> Am I missing something? Any hint?
>
> Thanks, Fabio.
>
> --
> Fabio Natali FNstudio
>
> --
> 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

-- 
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: request.method not working as expected

2011-09-21 Thread Babatunde Akinyanmi
Your post showed the trailing url...anyway I agree with your
diagnosis. With my noob knowledge of django, django tries to add a
trailing slash to your url when you don't. I believe she does that by
adding the trailing slash to the url and then asking the server to
redirect to the url which is the reason why the development server
logs show 301 status. However, when a 301 is gotten in response to a
request and the request method wasn't GET or HEAD, the client is
expected to ask the user before redirecting. If there is no automatic
addition of the trailing slash, the server will return a 500 instead
because django would be able to find the url in your given pattern and
raise an error.
My guess is that maybe django explicitly does the redirection by
sending a GET. I guess this is one of the times we need to check the
guts of django to understand her more.
However, if you believe you simply won't be able to cope with the
trailing slash, you could change your url pattern to exclude the
trailing slash though I don't know if that has side effects.that's
if you must absolutely hard code the url

On 9/21/11, Fabio Natali  wrote:
> On 09/20/2011 07:15 PM, dm03514 wrote:
>> Fabio in your dev server output is it saying the type of request is
>> get?
>> ARe you accessing "/method/" through your form or are you just
>> directing your webserver to http://192.168.0.2:8000/method/???
>
> Hi dm03514 and thanks for your help!
>
> Thanks to your suggestion I managed to resolve my issue. I looked at my
> development server logs and noticed 2 lines:
>
> [20/Sep/2011 12:17:27] "POST /method HTTP/1.1" 301 0
> [20/Sep/2011 12:17:27] "GET /method/ HTTP/1.1" 200 3
>
> I guess the lack of a trailing slash in my url was causing some sort of
> internal redirection. That redirection eventually caused the loss of
> POST stuff.
>
> I was using this:
> http://192.168.0.2:8000/method";>
> I changed that to:
> http://192.168.0.2:8000/method/";>
> and everything was fixed.
>
> Don't you think this is too fragile and error prone? I guess I may
> forget the trailing slash again in the future and that will mean the
> break of everything... Is there any best practice for this?
>
> Thanks! Greetings, Fabio.
>
> --
> Fabio Natali FNstudio
>
> --
> 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

-- 
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: request.method not working as expected

2011-09-21 Thread Babatunde Akinyanmi
What's in your add_to_cart view function?

On 9/21/11, Fabio Natali  wrote:
> On 09/21/2011 07:57 AM, Andres Reyes wrote:
>> I believe that the best practice is to always use the {% url %} template
>> tag and not hardcoding your URL's
>
> That makes perfect sense. Thanks for your precious tip!
>
> So I added {% url add_to_cart %} to my template. However, it silenty
> fails and I am redirected to my main page with no error whatsoever.
>
> ### urls.py
> (r'^add_to_cart/$', add_to_cart)
>
> Any tips?
>
> Thanks and greetings, Fabio.
>
> --
> Fabio Natali FNstudio
>
> --
> 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

-- 
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: can't get STATICFILES to work (Django dev version)

2011-09-26 Thread Babatunde Akinyanmi
When you want to access say screen.css, how do you put it in your template??

On 9/26/11, nara  wrote:
> I am having trouble getting STATICFILES to work. I have read the docs,
> and followed the instructions, but I never get my css files to load.
> My current workaround is to put all the css inline in my template
> file, but that should not be a permanent solution.
>
> I am running the django dev version, and I am using the built-in
> server. Here are my changes:
>
> 1. I placed my media (css) files under /home/nara/media
> 2. I added '/home/nara/media' under STATICFILES_DIRS
> (django.contrib.staticfiles is already in INSTALLED_APPS)
> 3. I added {{STATIC_URL}} (no spaces) in front of the reference to
> static files in my template file.
> 4. I restarted the server.
>
> No further changes. I don't have additional copies of the static files
> anywhere else, such
> us under my project, or app.
>
> Looking at the result in firebug within firefox, I get an HTTP
> response of 200 on my css files
> (happen to be css/blueprint/screen.css and print.css), but the files
> are null. Clearing
> the cache, restarting Firefox etc. do not help.
>
> I have been fighting this issue for several days now, and have tried
> many things,
> but the above description is for my current state.
>
> Thanks
> Nara
>
>
> --
> 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

-- 
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 make Django pick new urls immediately

2011-10-06 Thread Babatunde Akinyanmi
With django, when a url is sent to the server, the work flow is that
urls.py is first run to check if an expression that matches the url
submitted is available in the pattern function. If available, it runs
the view function specified in the pattern. This just means that you
don't have to restart your server when you add a new url expression so
I suppose the "something" you did was to correct typosor you
could be more specific

On 10/6/11, Kayode Odeyemi  wrote:
> Hello,
>
> I don't know if I'm the only one experiencing this. I have multiple urls.py
> in different packages based on
> the similarities of the modules. Everytime I add a new url to urls.py, it
> doesn't take effect immediately. Always returning 404 until
> I have to do something... Can't remember what I did.
>
> Is anyone experiencing the same?
>
> --
> Odeyemi 'Kayode O.
> http://www.sinati.com. t: @charyorde
>
> --
> 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

-- 
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: Ajax replacement in django

2011-10-14 Thread Babatunde Akinyanmi
>From what Iankesh said initially, I think he is having problems using
ajax to load part of a page not ajax as a whole.
Iankesh, it is possible to load only a portion of a page with ajax.

On 10/13/11, Sells, Fred  wrote:
>> On Wed, Oct 12, 2011 at 9:17 AM, lankesh87  wrote:
>> >  I am developing a web application where i need ajax like features.
>> > But I don't want to use ajax, so my question is- "is there any way to
>> > perform ajax like functions in django?"
>>
> Use Flex, it's easier.
>
> --
> 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

-- 
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: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Hi Piotr,
Models contain code for the ORM and what will be used to create tables
for your database. View is where you can process logic and data from
your models or database  before output to the client. Models are not
directly linked to templates and templates get their context from the
view. Context is just a variable which can contain stuff from strings
to querysets. In your case, it seems like you skipped the view
altogether or you forgot to put the data you need from your models
into a context. Check and holla back.

On 10/15/11, Carlos Daniel Ruvalcaba Valenzuela  wrote:
> Perhaps the problem lies on the view code, are you passing the query data to
> the template? Is que query returning any data? Try posting the relevant code
> from your views.
>
> Regards,
> Carlos Ruvalcaba
> El 15/10/2011 14:12, "Piotr Hosowicz"  escribió:
>
>> Hello,
>>
>> I still do not understand how things are connected in Django. In
>> models.py I have:
>>
>> class CampaignManager(models.Manager):
>>pass
>>
>> class CampPeople(models.Model):
>>person = models.ForeignKey(Person)
>>camp = models.ForeignKey(Campaign)
>>docall = models.BooleanField(True)
>>called = models.BooleanField(False)
>>objects = CampaignManager()
>>
>> class Phone(models.Model):
>># person = models.ForeignKey(Person)
>>phone = models.CharField(u"Telefon", max_length=255)
>>def __unicode__(self):
>>return "%s" % (unicode(self.phone) or "")
>>
>> class PersonPhonesManager(models.Manager):
>>pass
>>
>> class PersonPhones(models.Model):
>>person = models.ForeignKey(Person)
>>phone = models.ForeignKey(Phone)
>>objects = PersonPhonesManager()
>>def __unicode__(self):
>>return "%s" % (unicode(self.phone) or "")
>>
>> In the template I have:
>>
>> 
>>
>> {% for piplok in camppeople %}
>> {% if piplok.docall %}
>>  
>>  {{ piplok.person.label }}
>>  
>>  
>>  {{ personphones.phone }}
>>  
>>  
>> {% else %}
>>  NOT
>> {% endif %}
>> {% endfor %}
>>
>> 
>>
>> And I do not see any  row output.
>>
>> Please help,
>>
>> Regards,
>>
>> Piotr Hosowicz
>>
>> --
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Hi Piotr,
The problem is with your custom managers. You defined PersonPhones
manager (and all your other managers) to do nothing and hooked it to
objects effectively confusing everything.
Ideaally you should have:
objects = models.Manager()

But in your case its:
objects = PersonPhonesManager()

By doing that, when you call .objects.all() python runs
PersonPhonesManager() as you specified in your code instead of the
default models.Manager()

If you want the behavior of the default objects.all() then change the
line where you have objects = PersonPhonesManager to models.Manager()
or else you will have to specify what exactly you want
PersonPhonesManager to do instead of the pass statement you put in
your code. You can check the documentation on custom managers for more
information and let me know if you still need assistance

On 10/15/11, Piotr Hosowicz  wrote:
> Hello,
>
> I still do not understand how things are connected in Django. In
> models.py I have:
>
> class CampaignManager(models.Manager):
> pass
>
> class CampPeople(models.Model):
> person = models.ForeignKey(Person)
> camp = models.ForeignKey(Campaign)
> docall = models.BooleanField(True)
> called = models.BooleanField(False)
> objects = CampaignManager()
>
> class Phone(models.Model):
> # person = models.ForeignKey(Person)
> phone = models.CharField(u"Telefon", max_length=255)
> def __unicode__(self):
> return "%s" % (unicode(self.phone) or "")
>
> class PersonPhonesManager(models.Manager):
> pass
>
> class PersonPhones(models.Model):
> person = models.ForeignKey(Person)
> phone = models.ForeignKey(Phone)
> objects = PersonPhonesManager()
> def __unicode__(self):
> return "%s" % (unicode(self.phone) or "")
>
> In the template I have:
>
> 
>
> {% for piplok in camppeople %}
> {% if piplok.docall %}
>   
>   {{ piplok.person.label }}
>   
>   
>   {{ personphones.phone }}
>   
>   
> {% else %}
>   NOT
> {% endif %}
> {% endfor %}
>
> 
>
> And I do not see any  row output.
>
> Please help,
>
> Regards,
>
> Piotr Hosowicz
>
> --
> 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

-- 
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: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Yes your context is correct but the problem is with what the context
does contain.

Managers return querysets but yours does not do anything or return
anything. It will be very clear to you if you go to the django in
built shell and do PersonPhones.objects.all(). You'll find out that it
contains nothing so your context will also contain nothing which
explains why your template is empty.

On 10/15/11, Piotr Hosowicz  wrote:
> On 15 Paź, 16:53, Carlos Daniel Ruvalcaba Valenzuela
>  wrote:
>> Perhaps the problem lies on the view code, are you passing the query data
>> to
>> the template? Is que query returning any data? Try posting the relevant
>> code
>> from your views.
>
> Here is the relevant part of views.py:
>
> def campaign(request, campaign_id):
> ctx = {'phones': PersonPhones.objects.all(), "camppeople":
> CampPeople.objects.all() }
> return render_to_response("campaign.html", ctx,
> context_instance=RequestContext(request))
>
> Please help me.
>
> Regards,
>
> Piotr Hosowicz
>
> --
> 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

-- 
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: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Piotr,
You need to remove the custom manager from your code since you are not
making use of it.

You also need to read the custom manager documentation so you can
understand managers and how they work

On 10/15/11, Thomas Orozco  wrote:
> Just don't assign anything to objects and leave that line out of your code ;
> use the default manager.
> Le 15 oct. 2011 17:54, "Piotr Hosowicz"  a écrit :
>
>> On 15 Paź, 17:40, Piotr Hosowicz  wrote:
>> > Carlos, of course I have data in the DB. Babatunde, the managers is
>> > the thing that my friend, local Django guru, didn't answer me. I
>> > believe you are right, I just copied the manager with empty body from
>> > previous pieces of code that worked. I'll try it, thanks a lot.
>>
>> Babatunde, now I have objects = models.Manager()  but it did not
>> help. :-(
>>
>> Regards,
>>
>> Piotr Hosowicz
>>
>> --
>> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
I guess I should apologize myself. To alter how managers return
objects the get_query_set method  should be overloaded.



On 10/15/11, Daniel Roseman  wrote:
> On Saturday, 15 October 2011 15:12:17 UTC+1, Piotr Hosowicz wrote:
>>
>> Hello,
>>
>> I still do not understand how things are connected in Django. In
>> models.py I have:
>>
>> class CampaignManager(models.Manager):
>> pass
>>
>> class CampPeople(models.Model):
>> person = models.ForeignKey(Person)
>> camp = models.ForeignKey(Campaign)
>> docall = models.BooleanField(True)
>> called = models.BooleanField(False)
>> objects = CampaignManager()
>>
>> class Phone(models.Model):
>> # person = models.ForeignKey(Person)
>> phone = models.CharField(u"Telefon", max_length=255)
>> def __unicode__(self):
>> return "%s" % (unicode(self.phone) or "")
>>
>> class PersonPhonesManager(models.Manager):
>> pass
>>
>> class PersonPhones(models.Model):
>> person = models.ForeignKey(Person)
>> phone = models.ForeignKey(Phone)
>> objects = PersonPhonesManager()
>> def __unicode__(self):
>> return "%s" % (unicode(self.phone) or "")
>>
>> In the template I have:
>>
>> 
>>
>> {% for piplok in camppeople %}
>> {% if piplok.docall %}
>>   
>>   {{ piplok.person.label }}
>>   
>>   
>>   {{ personphones.phone }}
>>   
>>   
>> {% else %}
>>   NOT
>> {% endif %}
>> {% endfor %}
>>
>> 
>>
>> And I do not see any  row output.
>>
>> Please help,
>>
>> Regards,
>>
>> Piotr Hosowicz
>
>
>
> Piotr,
>
> Unfortunately, you have received a lot of very bad advice in this thread,
> for which I can only apologise on behalf of Django-users ...
>
> The references to your custom Managers are misleading. Although it's true
> that you don't need them, because they're not changing anything, you aren't
> in fact breaking anything by having them - just defining them with a "pass"
> doesn't, as some people apparently think, mean that they now have no content
> - of course it doesn't, because you inherit from models.Manager, soo you'll
> have all the default code of that class. Still, as I say, because you don't
> change anything, you don't need them.
>
> The main weird thing in the code you have posted is these two lines in the
> CampPeople model:
>
> docall = models.BooleanField(True)
> called = models.BooleanField(False)
>
> Now, the first parameter to a model field (apart from ForeignKeys) is the
> verbose name - ie what appears as the prompt when you create a form based on
> that model. So it seems you have True and False as the verbose names, which
> I'm sure isn't what you want - but I'm not certain what it is you *do*
> intend here. Are you hoping that these will be the default values? If so,
> you need to use the `default` argument:
>
> docall = models.BooleanField(default=True)
> called = models.BooleanField(default=False)
>
> Does that help at all?
>
> You might also try putting some debugging into your template to see if
> you're getting the results you think you are:
>
> {% for piplok in camppeople %}
> {{ piplok }}
> ...
>
> --
> DR.
>
> --
> 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/-/-mZF3n-I1xsJ.
> 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

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