Re: How to order "links" in the Admin?

2011-08-11 Thread Andre Lopes
Thanks for the reply. What I need is a snipped like this one:
http://djangosnippets.org/snippets/1053/

Thanks a lot for your help.

Best Regards,

On Wed, Aug 10, 2011 at 9:01 AM, Eric Hutchinson
 wrote:
> This is a meta option.
>
> 
> from django.db import models
> import datetime
> class Directory(models.Model):
>  website_name = models.CharField(max_length=200)
>  website_url = models.CharField(max_length=200)
>  website_position = models.IntegerField()
>  pub_date = models.DateTimeField('date published')
>
>    class Meta:
>        ordering=['website_position']
> 
>
> see: https://docs.djangoproject.com/en/1.3/ref/models/options/#ordering
>
> On Aug 10, 4:25 am, Andre Lopes  wrote:
>> Hi,
>>
>> Thanks for the reply.
>>
>> I use the field "website_position" to control the position of the url,
>> this is an Integer field.
>>
>> The model I use is this:
>> 
>> from django.db import models
>> import datetime
>>
>> class Directory(models.Model):
>>   website_name = models.CharField(max_length=200)
>>   website_url = models.CharField(max_length=200)
>>   website_position = models.IntegerField()
>>   pub_date = models.DateTimeField('date published')
>> 
>>
>> Now I will populate the database with data:
>>
>> 
>> website_name | website_url                    | website_position | pub_date
>> Google           |http://www.google.com   | 1                      |
>> 10-08-2011
>> Yahoo            |http://www.yahoo.com    | 2                      |
>> 10-08-2011
>> Altavista         |http://www.altavista.com | 3
>> | 10-08-2011
>> 
>>
>> The output of this will be: Google, Yahoo, Altavista
>>
>> Another example: (Here I will reorder the links positions)
>>
>> 
>> website_name | website_url                    | website_position | pub_date
>> Google           |http://www.google.com   | 3                      |
>> 10-08-2011
>> Yahoo            |http://www.yahoo.com    | 2                      |
>> 10-08-2011
>> Altavista         |http://www.altavista.com | 1
>> | 10-08-2011
>> 
>>
>> Ant the output will be: Altavista, Yahoo, Google
>>
>> The thing here is that I control the positions of the links in Django
>> Admin with integers in the field "website_position". I'd like to know
>> if Django Admin have a better way to deal with this. There is possible
>> to control this with arrows to change the position of links, I click
>> in the up arrow and the link go up... I click in a down arrow and the
>> link goes down... This is possible in the Django Admin?
>>
>> Best Regards,
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Aug 9, 2011 at 6:43 PM, Jian Chang  wrote:
>> > you should figure out what it is based on to order these urls.
>>
>> > i use time stamp to order them.
>>
>> > 2011/8/10 Andre Lopes 
>>
>> >> Hi,
>>
>> >> I'm testing Django for my first project using it.
>>
>> >> I have a model like this:
>> >> 
>> >> from django.db import models
>> >> import datetime
>>
>> >> class Directory(models.Model):
>> >>   website_name = models.CharField(max_length=200)
>> >>   website_url = models.CharField(max_length=200)
>> >>   website_position = models.IntegerField()
>> >>   pub_date = models.DateTimeField('date published')
>> >> 
>>
>> >> Basicaly this model is for storing URL's, but I need to order them,
>> >> and for that I use "website_position" to control if the link will be
>> >> at the top or at the end or in the middles...
>>
>> >> My question is, there is a better way to control the positions of the
>> >> links? Django Admin have any feature that could help to deal with this
>> >> specific case?
>>
>> >> Please let me know.
>>
>> >> Best Regards,
>>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups
>> >> "Django users" group.
>> >> To post to this group, send email to django-users@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >>http://groups.google.com/group/django-users?hl=en.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> >http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.

get Django url content with urllib2

2011-08-11 Thread Igor Nemilentsev
Hello everyone.

I try:

content = urllib2.urlopen('http://localhost:8080/').read()

from inside some Django view(function)
and http://localhost:8080/ is same Django server.

This command do not give me any answer but hang on.
But if url is foreign it is working.
Is there some cycle problem? Is it possible to 
get some page from inside Django using foreign
tools(curl, urllib)?

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



Adding new js to admin

2011-08-11 Thread Isaac

Hi there folks,

I'm trying to add raw tinyMCE support for my project. I don't want to 
use the django-tinymce app, as it introduces some features that I don't 
want to load in my project.


I followed instructions from
https://code.djangoproject.com/wiki/AddWYSIWYGEditor
and can't get it working. I've tried to insert that js tuple from model 
and from modeladmin, but neither works. I'm using django 1.3, and all I 
need is to introduce the right js scripts in admin templates, but don't 
know how to do it.


Any clue?

Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: get Django url content with urllib2

2011-08-11 Thread Daniel Roseman
On Thursday, 11 August 2011 09:20:41 UTC+1, Igor Nemilentsev wrote:
>
> Hello everyone.
>
> I try:
>
> content = urllib2.urlopen('http://localhost:8080/').read()
>
> from inside some Django view(function)
> and http://localhost:8080/ is same Django server.
>
> This command do not give me any answer but hang on.
> But if url is foreign it is working.
> Is there some cycle problem? Is it possible to 
> get some page from inside Django using foreign
> tools(curl, urllib)?
>

The development server is single-threaded, so it can't fulfill a second 
request while still working on the first one.

It would work with a production server, but I can't think why you would want 
to do it - inside your code, you have access to the views that generate all 
the pages, so why would you want to go via the web instead of calling the 
code directly?
--
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/-/NbeV4OI5MJcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RedirectView with query_string = True and urlencoded unicode string

2011-08-11 Thread Slafs
Hi there! 

I'm having difficulties with the new class based RedirectView with 
query_string = True and some unicode string in QUERY_STRING. 
I made a sample of the error on bitbucket 

https://bitbucket.org/slafs/redirectviewtest/src 

could You please explain what I'm doing wrong? or maybe it is a bug in a 
redirect view ? 
I've read the docs about the "%" sign in urls but I think this behaviour 
should not apply to args (query_string)

Regards

Sławek

-- 
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/-/0zE21qbsE0QJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Adding new js to admin

2011-08-11 Thread Daniel Roseman
On Thursday, 11 August 2011 09:26:17 UTC+1, Vyrphan wrote:
>
> Hi there folks,
>
> I'm trying to add raw tinyMCE support for my project. I don't want to 
> use the django-tinymce app, as it introduces some features that I don't 
> want to load in my project.
>
> I followed instructions from
> https://code.djangoproject.com/wiki/AddWYSIWYGEditor
> and can't get it working. I've tried to insert that js tuple from model 
> and from modeladmin, but neither works. I'm using django 1.3, and all I 
> need is to introduce the right js scripts in admin templates, but don't 
> know how to do it.
>
> Any clue?
>
> Thanks in advance
>

Do you have anything set up to serve non-admin static assets?
https://docs.djangoproject.com/en/1.3/howto/static-files/
--
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/-/wKGUPTdszC8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: RedirectView with query_string = True and urlencoded unicode string

2011-08-11 Thread Daniel Roseman
On Thursday, 11 August 2011 09:35:43 UTC+1, Slafs wrote:
>
> Hi there! 
>
> I'm having difficulties with the new class based RedirectView with 
> query_string = True and some unicode string in QUERY_STRING. 
> I made a sample of the error on bitbucket 
>
> https://bitbucket.org/slafs/redirectviewtest/src 
>
> could You please explain what I'm doing wrong? or maybe it is a bug in a 
> redirect view ? 
> I've read the docs about the "%" sign in urls but I think this behaviour 
> should not apply to args (query_string)
>
> Regards
>
> Sławek
>
>
You neglected to tell us what the error was, or show the traceback.
--
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/-/940fZrOK0sAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Installation Problem cant extract tar.gz file

2011-08-11 Thread damola oyeniyi
I also recently started using djangoon ubuntu and ran into no problems.

Try and get django from the repositories:

1. apt-cache search python-django
   you will see python-django files and other related files you might like

2. sudo apt-get install python-django 


Regards
Damola


From: danielvanvane 
To: Django users 
Sent: Wednesday, August 10, 2011 5:08:56 PM
Subject: Installation Problem cant extract tar.gz file

Hello,

I want to start with Django, but i got serval problem during the
installation:
First I installed Python 2.7 and MySQL
then i downloaded django1.3 (and django 1.25)
Now i clicked on the django1.3 .tar.gz and i got this problem(also on
other versions):

Archivmanager says:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors


so I cant install it otherwise extract


I use Ubuntu 11.4 on a virtual machine under windows7 via virtual box
"oracle VM"
Note: I'am a truely win7 user, but i need to learn django on ubuntu (:

I hope that u can help me

-sorry for bad english (:

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

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



Re: How to pass url parameters to template url tag

2011-08-11 Thread Tom Evans
On Wed, Aug 10, 2011 at 7:06 PM, bruno desthuilliers
 wrote:
> On 10 août, 16:35, Reinout van Rees  wrote:
>>
>> Best solution: calculate that url in your python view code and just pass
>> it along in the context.
>
> Definitly not the best solution if this has to work for more than
> exactly ONE view.
>

So instead of typing this in multiple views:

context['some_var'] = request.GET.get('name')

is somehow more effort than typing this in multiple templates:

{% url foo request.POST|mycustomattrgetter:"name" %}

The template code could be inherited, but then placing the variable in
a context could also be done by a template context processor. Where
you have many views that require the same context variables, this is
easier imo.

Remember that you can pass a custom list of template context
processors to a render_to_foo() call, in addition to
settings.TEMPLATE_CONTEXT_PROCESSORS.

Cheers

Tom

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



Re: Installation Problem cant extract tar.gz file

2011-08-11 Thread kenneth gonsalves
On Thu, 2011-08-11 at 01:51 -0700, damola oyeniyi wrote:
> I also recently started using djangoon ubuntu and ran into no
> problems. 
> 
> Try and get django from the repositories: 

do not do this - install from source, that is, download the tar.gz file
from djangoproject.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.



Odp: Re: RedirectView with query_string = True and urlencoded unicode string

2011-08-11 Thread Slafs
Oh sorry. Here it is

http://dpaste.com/591903/

File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in 
get_redirect_url  146. return url % kwargsException Type: 
ValueError at /test/Exception Value: unsupported format character 'C' (0x43) at 
index 15


-- 
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/-/qU07EZe8UPcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Installation Problem cant extract tar.gz file

2011-08-11 Thread damola oyeniyi
Hi Ken,

Any particular reason why not?

Regards
Damola




From: kenneth gonsalves 
To: django-users@googlegroups.com
Sent: Thursday, August 11, 2011 9:56:59 AM
Subject: Re: Installation Problem cant extract tar.gz file

On Thu, 2011-08-11 at 01:51 -0700, damola oyeniyi wrote:
> I also recently started using djangoon ubuntu and ran into no
> problems. 
> 
> Try and get django from the repositories: 

do not do this - install from source, that is, download the tar.gz file
from djangoproject.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.



Re: Installation Problem cant extract tar.gz file

2011-08-11 Thread kenneth gonsalves
On Thu, 2011-08-11 at 02:02 -0700, damola oyeniyi wrote:
> Any particular reason why not?

generally distros cannot cannot keep up with the pace of django'
development. And more important, the preferred modes of deployment like
virtualenv or zc.buildout need the 'original' django. 

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



Re: dull look after install on ubuntu

2011-08-11 Thread Gelonida N
Hi Peter,

On 08/11/2011 06:40 AM, Peter Kovgan wrote:
> Why , for example, collectstatic copied not static content?
> 
> 
> example, /home/peter/work/django/projects/src/mysite/polls/ - it's all
> new project file, there were no statics yet
> 
> 
> See there:
> 
> 
> Copying
> '/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/gis/move_vertex_off.png'
> Copying
> '/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/gis/move_vertex_on.png'
n/media/js/prepopulate.min.js'
> Copying '/home/peter/work/django/projects/src/mysite/urls.py.bak'
> Copying '/home/peter/work/django/projects/src/mysite/settings.py'
> Copying '/home/peter/work/django/projects/src/mysite/urls.py'
> Copying '/home/peter/work/django/projects/src/mysite/__init__.pyc'
> Copying '/home/peter/work/django/projects/src/mysite/settings.py.bak'


I agree the files from /home/peter/work/django/projects/src/mysite
should not be copied.(except if you specifically added this directory to
STATICFILES_DIRS)

This looks like a config issue or your django install is really broken.

Normally

STATICFILES_DIRS should contain for example
'/home/peter/work/django/projects/src/mysit/my_static'
(In this directory you can add static contents specific to your site)

and STATIC_ROOT should for example be set to
/home/peter/work/django/projects/src/mysit/my_collected_static

This is where collectstatic should copy all standard and your custom
files, such, that if you use django behind a web server uou can easily
configure your server to fetch any static file from this directory.
initially this directory will be empty it will only be populated by
'collectstatic' and everything in this directory might be deleted.


Perhaps you could post once more your config file?
I never had issues between django on windows and djongo on linux
In my case both behave perfectly well and identically.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 pass url parameters to template url tag

2011-08-11 Thread Kayode Odeyemi
On Wed, Aug 10, 2011 at 10:37 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On 10 août, 21:52, Kayode Odeyemi  wrote:
>
> You don't pass anything from "one view to another". You eventually
> pass data from a request to another, using either request params
> (querystring, post...), cookies, or sessions (and of course the parts
> of your urls that become view args).
>
> > For instance, I have a request model dynamic data
>
> Sorry, but I don't know what a "request model dynamic data" is
> supposed to be. Care to explain more clearly ?
>
> I meant a paginated model rendered in a view. Something like:

def func(request, **kwargs):
obj = Model.objects.all()
SHOW_CONTENT_LIMIT = 2
paginate_list = Paginator(dataqs, SHOW_CONTENT_LIMIT)
page_no = int(request.GET.get(u'page', 1))
contents = paginate_list.page(page_no)
...
...
#make a dict of the page number and it's content
x = {contents.number:contents.object_list}

#store it in a session
request.session['contents'] = x
return render_to_response('template.html', {'contents', contents},
context_instance=RequestContext(request));

def func2(request, **kwargs):
page = int(request.GET.get('page'))
# retrieve a slice of the session data by page
request.session['contents'][page]

#write to csv
...

return HTTPResponse


So I'm thinking, wouldn't it be pretty to create a template tag that can
make
the current session object available to the view - a concept similar to JSTL
tag.
Is this something template tags can be useful - making standard Python
objects
available to templates right?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Installation Problem cant extract tar.gz file

2011-08-11 Thread damola oyeniyi
Thank you, Ken




From: kenneth gonsalves 
To: django-users@googlegroups.com
Sent: Thursday, August 11, 2011 10:12:50 AM
Subject: Re: Installation Problem cant extract tar.gz file

On Thu, 2011-08-11 at 02:02 -0700, damola oyeniyi wrote:
> Any particular reason why not?

generally distros cannot cannot keep up with the pace of django'
development. And more important, the preferred modes of deployment like
virtualenv or zc.buildout need the 'original' django. 

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

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



Re: How to pass url parameters to template url tag

2011-08-11 Thread Kayode Odeyemi
On Thu, Aug 11, 2011 at 9:52 AM, Tom Evans  wrote:

> On Wed, Aug 10, 2011 at 7:06 PM, bruno desthuilliers
>  wrote:
> > On 10 août, 16:35, Reinout van Rees  wrote:
> >>
> >> Best solution: calculate that url in your python view code and just pass
> >> it along in the context.
> >
> > Definitly not the best solution if this has to work for more than
> > exactly ONE view.
> >
>
> So instead of typing this in multiple views:
>
> context['some_var'] = request.GET.get('name')
>
> is somehow more effort than typing this in multiple templates:
>
> {% url foo request.POST|mycustomattrgetter:"name" %}
>
> The template code could be inherited, but then placing the variable in
> a context could also be done by a template context processor. Where
> you have many views that require the same context variables, this is
> easier imo.
>
> Yes I agree. Could you please explain the role of the filter here?

Thanks


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



Re: Inspecting objects

2011-08-11 Thread Cal Leeming [Simplicity Media Ltd]
Temporarily added to this to
https://code.djangoproject.com/wiki/UsingTheMailingList

Can be split into its own page another day

On Wed, Jul 13, 2011 at 12:58 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> You know, I think that this subject deserves it own page on the wiki. I'll
> get something started later :)
>
> On Wed, Jul 13, 2011 at 7:33 AM, Jonas Geiregat  wrote:
>>
>> Op 13-jul-2011, om 08:25 heeft Jirka Vejrazka het volgende geschreven:
>>
>> >> Thank you all for your help!!!
>> >
>> > I know I'm a bit late to the party (blame timezones :), but thought
>> > I'd put my 2 cents worth in :)
>> >
>> > For inspecting models from command lines (usually when working with
>> > models from legacy databases) I often use model_to_dict which is
>> > "hidden" in django.forms.models.
>>
>>
>>
>> This is new for me. I've noticed before that django's API docs doesn't all
>> function available. There's probably a good reason for it.
>>
>> What's the advantage of using model_to_dict against dict(some_queryset) ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, 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: dull look after install on ubuntu

2011-08-11 Thread Peter Kovgan
Gelonida N, thanks.

I believe you , I'm just unlucky programmer :)

I should reinstall my linux django from scratch.

Thank you for the explanation! It was very helpful.

Peter.






On 11 August 2011 12:21, Gelonida N  wrote:

> Hi Peter,
>
> On 08/11/2011 06:40 AM, Peter Kovgan wrote:
> > Why , for example, collectstatic copied not static content?
> >
> >
> > example, /home/peter/work/django/projects/src/mysite/polls/ - it's all
> > new project file, there were no statics yet
> >
> >
> > See there:
> >
> >
> > Copying
> >
> '/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/gis/move_vertex_off.png'
> > Copying
> >
> '/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/gis/move_vertex_on.png'
> n/media/js/prepopulate.min.js'
> > Copying '/home/peter/work/django/projects/src/mysite/urls.py.bak'
> > Copying '/home/peter/work/django/projects/src/mysite/settings.py'
> > Copying '/home/peter/work/django/projects/src/mysite/urls.py'
> > Copying '/home/peter/work/django/projects/src/mysite/__init__.pyc'
> > Copying '/home/peter/work/django/projects/src/mysite/settings.py.bak'
>
>
> I agree the files from /home/peter/work/django/projects/src/mysite
> should not be copied.(except if you specifically added this directory to
> STATICFILES_DIRS)
>
> This looks like a config issue or your django install is really broken.
>
> Normally
>
> STATICFILES_DIRS should contain for example
> '/home/peter/work/django/projects/src/mysit/my_static'
> (In this directory you can add static contents specific to your site)
>
> and STATIC_ROOT should for example be set to
> /home/peter/work/django/projects/src/mysit/my_collected_static
>
> This is where collectstatic should copy all standard and your custom
> files, such, that if you use django behind a web server uou can easily
> configure your server to fetch any static file from this directory.
> initially this directory will be empty it will only be populated by
> 'collectstatic' and everything in this directory might be deleted.
>
>
> Perhaps you could post once more your config file?
> I never had issues between django on windows and djongo on linux
> In my case both behave perfectly well and identically.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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: Redisplay form with different field value?

2011-08-11 Thread Jonas H.

On 08/09/2011 12:45 AM, Jonas H. wrote:

Hello list!

Is there any way to use a different value for a field when re-displaying
a form? I.e. if a user enters '42' into an IntegerField but made the
other fields not validate, how could that IntegerField be re-displayed
with '43'?

Jonas



anyone?

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: WORKSHOP ON DJANGO AND OTHER WEBDESIGNING STUFF

2011-08-11 Thread pankaj sharma
please visit this link http://www.facebook.com/ednect

On Aug 10, 10:05 pm, pankaj sharma  wrote:
> hello friends there is a workshop to be conducted in india (kolkata)
> by ednect services, it will also include information about django
> if we want that everybody use django so everybody will try to conduct same
> kind of workshop in their cities.
> and also like this link
>
>    http://www.facebook.com/pages/Ednect-Services/252079971482683

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



Why doesn't Django use same filebase backend for Cache and Session?

2011-08-11 Thread Dreampuf
The Cache backend of file:
django/core/cache/backend/filebased.py

The Session backend of file:
django/contrib/sessions/backends/file.py

I want use the Session that information store in file, but I see the
code of Session backend of file, it's terrible, they save all session
file in same directory.
I think it isn't efficient, that on many Session file be created at a
same time.

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



PYTHONPATH and Django

2011-08-11 Thread Bastian Ballmann
Hi Django lovers,

I am developing Django under Arch Linux with virtualenv and Python 2.7
and I've got a strange problem with PYTHONPATH.

First I construct virtualenv with 

virtualenv2 --no-site-packages test

than I switch to it using

source test/bin/activate

and install latest Django version using

pip install django

Now I start a new project and app, configure Django and last but not
least I have to set the PYTHONPATH variable to my Django project dir in
order to let Django find my apps. 

After setting PYTHONPATH django-admin.py looses commands like
startproject and collectstatic and cannot find some Python modules I
installed. When doing an unset PYTHONPATH the missing django-admin.py
commands reappear. 

Asking the shell where django-admin.py lives with and without
PYTHONPATH set always reveals the path in my virtualenv. 

Any hint what could be wrong here? Or can anyone share his or her
virtualenv / Django config with me?

TIA && have a nice day

Basti
-- 
 Bastian Ballmann / Web Developer
Notch Interactive GmbH / Badenerstrasse 571 / 8048 Zürich
Phone +41 43 818 20 91 / www.notch-interactive.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.



decorator and context manager for nested transaction source code

2011-08-11 Thread aledema
Hello,

I'm using Django since a couple of years and the more I use it the
more I wish a support for django-managed nested transactions.
In complex programs happens often to need them.

So I would post here my own code of such tool, based of Django 1.3
commit_on_success().
Please help understand if it's correct or not ;)

BEWARE: currently I used it only in simple tests !! Do not use in
production !

Hints, suggestions, critiques are most welcome !

Many thanks

Ale




from django.db.transaction import is_managed,managed,
enter_transaction_management, is_dirty, rollback, commit,
leave_transaction_management,_transaction_func
import threading

_tl = threading.local()

def nested_commit_on_success(using=None):

def entering(using):
  lev = getattr(_tl,"level",0)
  lev += 1
  setattr(_tl,"level",lev)
  if lev >= 2: #is_managed():
print "IN-NESTED"
  else:
print "IN-NORMAL"
enter_transaction_management(using=using)
managed(True, using=using)

def exiting(exc_value, using):
  lev = getattr(_tl,"level")
  oldlev = lev
  lev -= 1
  setattr(_tl,"level",lev)
  if oldlev >= 2:
print "OUT-NESTED"
return
  print "OUT-NORMAL"
  try:
  if exc_value is not None:
  if is_dirty(using=using):
  rollback(using=using)
  else:
  if is_dirty(using=using):
  try:
  commit(using=using)
  except:
  rollback(using=using)
  raise
  finally:
  leave_transaction_management(using=using)

return _transaction_func(entering, exiting, using)

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



Django cache separate database

2011-08-11 Thread vsnu
In my django app, I am using a separate database (not default).  And I
am selecting it manually by using (using= "database_name")

Now I need to use the django backend cache on that database. For that
straight forward approach works only for default database. For a
separate database, do we need to write router ?
If so, I wrote a router like this in models.py in my app.

class CacheRouter(object):
"""A router to control all database cache operations"""

def db_for_read(self, model, **hints):
"All cache read operations go to the slave"
if model._meta.app_label in ('app',):
return 'db_name'
return None

def db_for_write(self, model, **hints):
"All cache write operations go to master"
if model._meta.app_label in ('app',):
return 'db_name'
return None

def allow_syncdb(self, db, model):
"Only synchronize the cache model on master"
if model._meta.app_label in ('app',):
return db == 'db_name'
return None

Is this correct ?

If so, how will I know it is working ?
I did not reference this in anywhere in settings.py ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 cache separate database

2011-08-11 Thread Henrik Genssen
why are you willing to use the db-cache-backend instead of memcache?


>reply to message:
>date: 11.08.2011 05:02:10
>from: "vsnu" 
>to: "Django users" 
>subject: [] Django cache separate database
>
>In my django app, I am using a separate database (not default).  And I
>am selecting it manually by using (using= "database_name")
>
>Now I need to use the django backend cache on that database. For that
>straight forward approach works only for default database. For a
>separate database, do we need to write router ?
>If so, I wrote a router like this in models.py in my app.
>
>class CacheRouter(object):
>"""A router to control all database cache operations"""
>
>def db_for_read(self, model, **hints):
>"All cache read operations go to the slave"
>if model._meta.app_label in ('app',):
>return 'db_name'
>return None
>
>def db_for_write(self, model, **hints):
>"All cache write operations go to master"
>if model._meta.app_label in ('app',):
>return 'db_name'
>return None
>
>def allow_syncdb(self, db, model):
>"Only synchronize the cache model on master"
>if model._meta.app_label in ('app',):
>return db == 'db_name'
>return None
>
>Is this correct ?
>
>If so, how will I know it is working ?
>I did not reference this in anywhere in settings.py ?
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"Django users" group.
>To post to this group, send email to django-users@googlegroups.com.
>To unsubscribe from this group, 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: same form model with separate admins and data

2011-08-11 Thread brian
Hi Landy,

You understand the problem correctly.  I'm not sure how to implement
your suggestion.  I'm seeing a  when I do
similar to the following:
-
class myModel(models.Model):
first_name   = models.CharField( max_length=100,
verbose_name='first')

class abstractForm( ModelForm ):
class Meta:
model = myModel

class myForm(abstractForm):
class Meta(myForm.Meta):
model.table_name = 'test_model'
-

Also, would db sync work with this approach or would I have to
manually add the table?

Thank you for your help

Brian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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' when access admin site

2011-08-11 Thread Reinout van Rees

On 10-08-11 21:26, raj wrote:

And yea, admin docs is in my installed list. Much appreciated.
Still can't get it to work.
This was my traceback:
'str' object has no attribute 'resolve'


It sounds like one of those url patterns isn't a tuple, but a string or 
something like that.


In the last part of the traceback that you get, could you click open 
that "local vars" triangle button? It might show you what 'pattern' or 
'self.url_patterns' is. Perhaps that helps you spot what's wrong?


Alternatively, post your entire urls.py. I'm out of ideas otherwise :-)


Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: making history

2011-08-11 Thread Andre Terra
I have played around with django-audit-log for a while, and so far it
works great. However, I do need to work on saving the records to a
separate db, as Shawn suggested.

Fwiw, there's a page on the wiki about audit trail/logs, which, albeit
outdated, should prove helpful.


Cheers,
AT

On 8/10/11, Mike Dewhirst  wrote:
> On 11/08/2011 9:51am, Shawn Milochik wrote:
>> Mike,
>>
>> I'm doing something similar in another project. I created a sublass of
>> models.Model and am using that throughout the project, which makes it
>> much easier.
>
> I'm sub-classing models.Model to include created, updated and updated_by
> fields which is pretty ordinary but nice. I'm also borrowing Marty
> Alchin's (Pro Django pp257 - 260) CurrentUserField to automatically
> insert the current user into updated_by.
>
> I used the same technique to subclass models.ForeignKey('Document',
> to_field='ancestor' ..) so I can just add AncestorKey() to any model
> which needs to link to the "line" of documents rather than a single
> document. The project isn't anywhere near finished - I'm still writing
> the models - so I don't know how well all this will work - but my thanks
> to Marty anyway!
>
> Also - I just googled and found -
> https://bitbucket.org/q/django-simple-history/overview which builds on
> Marty Alchin's approach to history. I haven't fully understood his
> approach yet so the content of that link is probably a bit beyond me at
> the moment.
>
>>
>> On the post-save of any subclass of my custom model, I serialize the
>> model's fields as a JSON object and store it in a text field of my
>> application's database in a special audit model. That audit object
>> stores the timestamp, instance's primary key, and optionally the User
>> instance that changed it.
>>
>> There's also a 'description' field in my audit model. For every entry
>> in the audit table for the same primary key you can grab the JSON and
>> compare them and write plain text to the description field like 'last
>> name changed from Smith to Smithe by someguy at 2011-08-10 13:42.'
>>
>> The beauty of the 'description' field is that if I ever want to change
>> the format of that, I can change my code and then re-generate the
>> description from the JSON, so there won't be a cutoff between
>> "old-style audit history" and "new-style audit history."
>
> Beauty indeed :)
>
> I'm definitely going to rethink my design. You are making me think a
> generic solution is worthwhile.
>
>>
>> Incidentally, my custom model (and therefore all subclasses of it) are
>> using a UUID as a primary key to avoid the horror that is generic
>> foreign keys. Just in case you were wondering how my audit scheme
>> works across various models.
>
> That's something I haven't investigated. I haven't experienced too many
> horrors yet.
>
> Thanks again
>
> Mike
>
>>
>> Shawn
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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 results in Template in a Table ? What is the proper way ?Any app?

2011-08-11 Thread Andre Terra
I'm personally considering serializing my objects and using ExtJS for
powerful data grids. Their subtotal grouping mode looks just like what
I want.

Check out their example page and read through the .js file to see and
example of the serialized data.


Cheers,
AT

On 8/10/11, Adam Zedan  wrote:
> Hi i wanted to know what do most people here do when they need to show
> results in a template which just needs to be displayed in Table.
> For example displaying data from a db etc in a template. I did try an app
> called django_tables2 but it just seems really simple with respect to
> presentation.
> I tried loading the CSS version 'paleblue' of that app but it doesnt work ?
> if someone has already tried that please do let me know ?? What do people do
> in case they need to display data,allow rearrangement of data etc.Are there
> any other apps...looking forward to hearing from you folks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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 and extjs: works well together?

2011-08-11 Thread Reinout van Rees

On 10-08-11 17:32, william ratcliff wrote:

We've used it--it's really domain specific, but you can look at
tripleaxis.smallangles.net  (please
don't crash us :>).   We do the front end with extjs and the back-end
with django.   We have a number of ajax calls made by extjs and then
handled by django.


Thanks for the link!

What I wonder: which part is "in control"? Does it feel more like a 
django site with an extjs front-end or as an extjs set with a django 
back-end?


I'm asking as I'm a bit afraid that with such a website, the most 
important parts of the site are not in well-testable python code, but in 
relatively harder to test javascript code.


(On the other hand, a colleague told me that with extjs you have write 
relatively few lines of javascript: extjs does a lot out ouf the box 
apparently).



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

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



Messages without session?

2011-08-11 Thread fiëé visuëlle
Hello,
In my custom model manager I need to send a message to the current
user.
I know her ID, but have no session.
The old user.message_set fits my needs, but that's deprecated.
I know there are other messaging solutions, but everything I found was
replacements for the deprecated one.

Do you have any suggestions?

Greetlings, Hraban

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 and extjs: works well together?

2011-08-11 Thread Michel van Leeuwen

ha Reinout,

zie ook dit artikel:
http://coderseye.com/2007/why-im-moving-from-jquery-to-extjs.html

en groeten van je oud-collega
:)

Op 11-08-11 15:11, Reinout van Rees schreef:

On 10-08-11 17:32, william ratcliff wrote:

We've used it--it's really domain specific, but you can look at
tripleaxis.smallangles.net  (please
don't crash us :>).   We do the front end with extjs and the back-end
with django.   We have a number of ajax calls made by extjs and then
handled by django.


Thanks for the link!

What I wonder: which part is "in control"? Does it feel more like a 
django site with an extjs front-end or as an extjs set with a django 
back-end?


I'm asking as I'm a bit afraid that with such a website, the most 
important parts of the site are not in well-testable python code, but 
in relatively harder to test javascript code.


(On the other hand, a colleague told me that with extjs you have write 
relatively few lines of javascript: extjs does a lot out ouf the box 
apparently).



Reinout



--
Met vriendelijke groet,


Michèl van Leeuwen

IAmIT (producent van IAmFlora)  KvK Haaglanden 27281395
Jacob Catsstraat 17, 2613 HA Delft  BTW Nr: NL183534712B01
Tel: +31 (0)6 387 58 163Rek. Nr: 51 50 70 998
mic...@iamflora.nl  
Logo IAmFlora
I Am waar de IT groen wordt

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: PYTHONPATH and Django

2011-08-11 Thread Reinout van Rees

On 11-08-11 09:37, Bastian Ballmann wrote:

Now I start a new project and app, configure Django and last but not
least I have to set the PYTHONPATH variable to my Django project dir in
order to let Django find my apps.

After setting PYTHONPATH django-admin.py looses commands like
startproject and collectstatic and cannot find some Python modules I
installed. When doing an unset PYTHONPATH the missing django-admin.py
commands reappear.


Setting PYTHONPATH probably puts those directories first in the search 
path when python searches for modules. So some .py file of yours might 
shadow one that django needs. That's what I guess is the problem. Is 
there one filename in your project that strikes you as a potential problem?


For proper debugging, try to import one of those missing management 
commands in your python prompt with and without the PYTHONPATH.




Best solution, btw: turn your code into a python package. Which means 
"add a setup.py". Then install that package with pip, too, and you don't 
have to do anything with your python path manually.



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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' when access admin site

2011-08-11 Thread raj
Fixed the issue, i looked through my urls file for like the 40th time,
and I found that one of my multiline comments had some indenting
issue. GRR. I found it by expanding that local vars part. Thanks
for the help!!!

On Aug 11, 8:35 am, Reinout van Rees  wrote:
> On 10-08-11 21:26, raj wrote:
>
> > And yea, admin docs is in my installed list. Much appreciated.
> > Still can't get it to work.
> > This was my traceback:
> > 'str' object has no attribute 'resolve'
>
> It sounds like one of those url patterns isn't a tuple, but a string or
> something like that.
>
> In the last part of the traceback that you get, could you click open
> that "local vars" triangle button? It might show you what 'pattern' or
> 'self.url_patterns' is. Perhaps that helps you spot what's wrong?
>
> Alternatively, post your entire urls.py. I'm out of ideas otherwise :-)
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 use "{% url *** %}" in django template file?

2011-08-11 Thread Kelly Nicholes
You need to set the name parameter.  name="card_create_card".  Once
you do that, reference it in the {% url  %}.


On Aug 7, 6:34 pm, muhdazwa  wrote:
> You can add name to the url in the urlpatterns:
>
> urlpatterns = patterns('',
>    url(r'card/create$', 'card.views.create_card',
> name='card_create_card'),
> )
>
> and call it in the template:
>
> {% url card_create_card %}
>
> On Aug 7, 1:05 pm, Jimmy  wrote:> Hi,
>
> > I got the error "Caught ImportError while rendering: No module named
> > urls" when using:
>
> > {% url 'card.views.create_card' %} in the template file
>
> > in the urls.py the route to the url is:
>
> > urlpatterns = patterns('',
> >    url(r'card/create$', 'card.views.create_card'),
> > )
>
> > The Django version I use is 1.3
>
> > May I know what did I miss in setting?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: PYTHONPATH and Django

2011-08-11 Thread Bastian Ballmann
Hi,

no seems that i got it wrong the problem was not my PYTHONPATH setting
but my DJANGO_SETTINGS_MODULE setting. I imported another package that
was absent and therefore django lost only some commands... 
Still strange at least for me, but the problem seems to be solved.

Thx && Greets

Basti


Am Thu, 11 Aug 2011 15:20:16 +0200
schrieb Reinout van Rees :

> On 11-08-11 09:37, Bastian Ballmann wrote:
> > Now I start a new project and app, configure Django and last but not
> > least I have to set the PYTHONPATH variable to my Django project
> > dir in order to let Django find my apps.
> >
> > After setting PYTHONPATH django-admin.py looses commands like
> > startproject and collectstatic and cannot find some Python modules I
> > installed. When doing an unset PYTHONPATH the missing
> > django-admin.py commands reappear.
> 
> Setting PYTHONPATH probably puts those directories first in the
> search path when python searches for modules. So some .py file of
> yours might shadow one that django needs. That's what I guess is the
> problem. Is there one filename in your project that strikes you as a
> potential problem?
> 
> For proper debugging, try to import one of those missing management 
> commands in your python prompt with and without the PYTHONPATH.
> 
> 
> 
> Best solution, btw: turn your code into a python package. Which means 
> "add a setup.py". Then install that package with pip, too, and you
> don't have to do anything with your python path manually.
> 
> 
> Reinout
> 



-- 
 Bastian Ballmann / Web Developer
Notch Interactive GmbH / Badenerstrasse 571 / 8048 Zürich
Phone +41 43 818 20 91 / www.notch-interactive.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.



MySQL data export to Excel sheet

2011-08-11 Thread Dipo Elegbede
Hello All,

I have a little problem, I,d like to share with you for possible solution.

I have a models like this:

class MyBuddyt(models.Model):

location = models.CharField(blank=True, max_length=200)
name = models.CharField(blank=True, max_length=200)
email = models.CharField(blank=True, max_length=200)
comment = models.CharField(blank=True, max_length=200)
phone = models.DateCharField(blank=True, max_length=200)

I have created over 90 buddies and these data lies in my database.

I want to export these data from the database straight to an Excel file i.e
*.xls.

I know this is doable using python csv module but that's not what I want.

I have tried using the xlrd and xlwt package and I am sure they can get it
done, I just haven't been able to get my way around.

If I do this:
buddies = MyBuddy.objects.all()
for buddy in buddies:
 print buddy.name, buddy.location, buddy.email, buddy.phone, buddy.comment

I get 90 line of information as ordered by the print function, with each
line having 5 values.

Now I want this to go into an Excel file so that each line represents a row
and each of the 5 values per role stays in different columns on that row e.g
buddy.name in cell(1,a) , buddy.location in cell(2,a),
buddy.email in cell(3,a), buddy.phone in cell(4,a),
buddy.comment in cell(5,a)

How do I get this done to happen for the 90 entries.

I have tried this:

for buddy in buddies:
  for row in range(r+1):
   for col in range(4):
sh.write(row,col,'%s' % (buddy))

I got the error:

Exception: Attempt to overwrite cell: sheetname=u'names' rowx=0 colx=0

 Did this:

for buddy in buddies:
colm = 0
row = 1
for item in buddyt:
 sh.write(row, colm, item)
 bk.save('C:\Users\owner\Desktop\DEL\tester.xls')

Got this error:

TypeErrorMyBuddy object not iterable

and also this:

for contact in contacts:
 row=0
 col=0
 r=90
 while row < r:
  sh.write(row,col,buddy.name)
  col += 1
  sh.write(row,col,buddy.location)
  col += 1
  sh.write(row,col,buddy.email)
  col += 1
  sh.write(row,col,buddy.phone)
  col +=1
sh.write(row,col,buddy.comment)
  row +=1
 bk.save('C:\Users\owner\Desktop\DEL\tester.xls')

then got this error:

Exception: Attempt to overwrite cell: sheetname=u'names' rowx=0 colx=0

Kindly help with a hint please.

Regards

-- 
Elegbede Muhammed Dipo
TimbaObjects Co.,
+2348033299270
+2348077682428

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



Odp: Re: RedirectView with query_string = True and urlencoded unicode string

2011-08-11 Thread Slafs
Should i report a ticket?

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



"Great circle" using the django ORM?

2011-08-11 Thread Thomas Weholt
I got a model with longitude and latitude and want to be able to find
other objects nearby a selected object. Can this be done using the
django orm? What is the best approach to do this in a django project?

I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
it in SQL is ok and probably the best solution performance wise, but
if it has to be done in python I'll do that too.

Ref question on stackoverflow:
http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

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



Re: "Great circle" using the django ORM?

2011-08-11 Thread Javier Guerra Giraldez
 "great circle" doesn't mean what you think...

http://en.wikipedia.org/wiki/Great_circle


-- 
Javier

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



RE: [] "Great circle" using the django ORM?

2011-08-11 Thread Henrik Genssen
I do (using MySQL):
where = '( 6378.137 * acos( cos( radians(%s) ) * cos( radians( 
`events_locations`.`latitude` ) ) * cos( radians( 
`events_locations`.`longitude` ) - radians(%s) ) + sin( radians(%s) ) * sin( 
radians( `events_locations`.`latitude` ) ) ) ) < %s' % (lat, lng, lat, dist)
basic = basic.exclude(location__latitude=0).extra(where=[where])

The exclude was needed for some select_related stuff I do. You may can leave it 
out...

>reply to message:
>date: 11.08.2011 17:09:09
>from: "Thomas Weholt" 
>to: django-users@googlegroups.com
>subject: [] "Great circle" using the django ORM?
>
>I got a model with longitude and latitude and want to be able to find
>other objects nearby a selected object. Can this be done using the
>django orm? What is the best approach to do this in a django project?
>
>I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
>it in SQL is ok and probably the best solution performance wise, but
>if it has to be done in python I'll do that too.
>
>Ref question on stackoverflow:
>http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle
>
>-- 
>Mvh/Best regards,
>Thomas Weholt
>http://www.weholt.org
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"Django users" group.
>To post to this group, send email to django-users@googlegroups.com.
>To unsubscribe from this group, send email to 
>django-users+unsubscr...@googlegroups.com.
>For more options, visit this group at 
>http://groups.google.com/group/django-users?hl=en.
>

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



Django-sms

2011-08-11 Thread damola oyeniyi
Hi all,

Please can someone tell me where the django-sms app is? I cannot find it on the 
google code repository.

Regards

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



South

2011-08-11 Thread CrabbyPete
I've used South and I love it, but when I ran it for my latest
database I got this


C:\> manage.py migrate base

Running migrations for base:
 - Migrating forwards to 0001_initial.
 > base:0001_initial
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   = DROP TABLE `base_profile`
CASCADE; []
...

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS.
 ! NOTE: The error which caused the migration to fail is further up.

Do I have to redesign my schema or is there a way around this. Should
I try
nashvegas

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 form model with separate admins and data

2011-08-11 Thread Landy Chapman
Brian, have a look at:

https://docs.djangoproject.com/en/1.3/topics/db/models/#abstract-base-classes

> If I understand you correctly, your situation is:
>
> FORM 1  --> [table 1]
> FORM 2  --> [table 2]
>
> where FORM1 and FORM2 are *identical*,
> and TABLE1 and TABLE2 are *identical*  (same structure)
>
> *identical* meaning definition is the same but names are different for
> obvious reasons...


>> You understand the problem correctly.  I'm not sure how to implement
>> your suggestion.

Cool!  Let's implememt your models first:
#
class MyBaseModel(models.Model):
first_name   = models.CharField( max_length=100,
verbose_name='first')

class Meta:
abstract = True


class myModel1(MyBaseModel):

class Meta(MyBaseModel.Meta):
db_table = 'table1'


class myModel2(MyBaseModel):

class Meta(MyBaseModel.Meta):
db_table = 'table2'


Now let's tackle your forms.

> class abstractForm( ModelForm ):
>     class Meta:
>        model= myModel
>
> class myForm(abstractForm):
>     class Meta(myForm.Meta):
>        model.table_name = 'test_model'

please review:
https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#modelform

I believe you're trying to avoid duplicate code (DRY==good!) but
I think you'll be better served writing simpler form code.

#

class Form1(ModelForm):
class Meta:
model = MyModel1

class Form2(ModelForm):
class Meta:
model = MyModel2

Hope that helps!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: South

2011-08-11 Thread Shawn Milochik
You should try asking about this on the south-users Google group if you 
don't get an answer here.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 form model with separate admins and data

2011-08-11 Thread Landy Chapman

> Also, would db sync work with this approach or would I have to
> manually add the table?


I'd recommend backing up your data (just in case you have a typo).  db
sync *should* create the new tables for you.  I prefer to manually
manipulate my database (I never used South.)


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: "Great circle" using the django ORM?

2011-08-11 Thread Thomas Orozco
The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )
Le 11 août 2011 17:09, "Thomas Weholt"  a écrit :
> I got a model with longitude and latitude and want to be able to find
> other objects nearby a selected object. Can this be done using the
> django orm? What is the best approach to do this in a django project?
>
> I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
> it in SQL is ok and probably the best solution performance wise, but
> if it has to be done in python I'll do that too.
>
> Ref question on stackoverflow:
>
http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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-sms

2011-08-11 Thread Andre Terra
http://djangopackages.com/grids/g/sms/

On Thu, Aug 11, 2011 at 12:01 PM, damola oyeniyi  wrote:

> Hi all,
>
> Please can someone tell me where the django-sms app is? I cannot find it on
> the google code repository.
>
> Regards
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-08-11 Thread Cal Leeming [Simplicity Media Ltd]
Last call on this guys:

https://spreadsheets.google.com/a/foxwhisper.co.uk/spreadsheet/viewform?hl=en_US&formkey=dENPX3BMUUFMbi1CbElwV3BvOEdkNmc6MQ#gid=0

If you want to register your attendance, please do so now.

Thanks

On Mon, Jul 25, 2011 at 2:00 PM, nicolas HERSOG  wrote:

> I won t be able to follow the live session but I can't wait to watch your
> record on YT.
>
> Thx!
>
> On Mon, Jul 25, 2011 at 2:42 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Second call for register your attendance on this webcast, if you haven't
>> already done so.
>>
>> Thanks
>>
>> Cal
>>
>>
>> On Tue, Jul 12, 2011 at 2:48 PM, Cal Leeming [Simplicity Media Ltd] <
>> cal.leem...@simplicitymedialtd.co.uk> wrote:
>>
>>> Hi all,
>>>
>>> Great response to this, 45 registered votes in total.
>>>
>>> The webcast will take place on Monday 29th August 2011 - (Minimum
>>> resolution 1920x1080)
>>>
>>> However, because the time zone results are almost split 50/50, I'm going
>>> to allow users to select from two time slots, if the results are still split
>>> 50/50, then I'll do both an afternoon and evening session.
>>>
>>> Please use this form to register your place.
>>>
>>> https://spreadsheets.google.com/a/foxwhisper.co.uk/spreadsheet/viewform?formkey=dENPX3BMUUFMbi1CbElwV3BvOEdkNmc6MQ
>>>
>>> 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.



Re: "Great circle" using the django ORM?

2011-08-11 Thread Bill Freeman
Only on a flat earth of radius 1 radian.  Henrik is correct on a
spherical earth (which I
find close enough).

On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco
 wrote:
> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )
>
> Le 11 août 2011 17:09, "Thomas Weholt"  a écrit :
>> I got a model with longitude and latitude and want to be able to find
>> other objects nearby a selected object. Can this be done using the
>> django orm? What is the best approach to do this in a django project?
>>
>> I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
>> it in SQL is ok and probably the best solution performance wise, but
>> if it has to be done in python I'll do that too.
>>
>> Ref question on stackoverflow:
>>
>> http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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: "Great circle" using the django ORM?

2011-08-11 Thread Thomas Orozco
Indeed!
As a sidenote, once you factor in the size, to what extent do you think it
is not precise?
Le 11 août 2011 19:55, "Bill Freeman"  a écrit :
> Only on a flat earth of radius 1 radian. Henrik is correct on a
> spherical earth (which I
> find close enough).
>
> On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco
>  wrote:
>> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )
>>
>> Le 11 août 2011 17:09, "Thomas Weholt"  a
écrit :
>>> I got a model with longitude and latitude and want to be able to find
>>> other objects nearby a selected object. Can this be done using the
>>> django orm? What is the best approach to do this in a django project?
>>>
>>> I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
>>> it in SQL is ok and probably the best solution performance wise, but
>>> if it has to be done in python I'll do that too.
>>>
>>> Ref question on stackoverflow:
>>>
>>>
http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle
>>>
>>> --
>>> Mvh/Best regards,
>>> Thomas Weholt
>>> http://www.weholt.org
>>>
>>> --
>>> You received this message because you are subscribed to the Google
Groups
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, 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: "Great circle" using the django ORM?

2011-08-11 Thread vikas ruhil
really , indeed!!

On Thu, Aug 11, 2011 at 11:46 PM, Thomas Orozco
wrote:

> Indeed!
> As a sidenote, once you factor in the size, to what extent do you think it
> is not precise?
> Le 11 août 2011 19:55, "Bill Freeman"  a écrit :
>
> > Only on a flat earth of radius 1 radian. Henrik is correct on a
> > spherical earth (which I
> > find close enough).
> >
> > On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco
> >  wrote:
> >> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )
> >>
> >> Le 11 août 2011 17:09, "Thomas Weholt"  a
> écrit :
> >>> I got a model with longitude and latitude and want to be able to find
> >>> other objects nearby a selected object. Can this be done using the
> >>> django orm? What is the best approach to do this in a django project?
> >>>
> >>> I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
> >>> it in SQL is ok and probably the best solution performance wise, but
> >>> if it has to be done in python I'll do that too.
> >>>
> >>> Ref question on stackoverflow:
> >>>
> >>>
> http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle
> >>>
> >>> --
> >>> Mvh/Best regards,
> >>> Thomas Weholt
> >>> http://www.weholt.org
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Django users" group.
> >>> To post to this group, send email to django-users@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> django-users+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/django-users?hl=en.
> >>>
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-users+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



GenericIPAddressField validation error not translated

2011-08-11 Thread Federico Capoano
Hi all,

i'm using the new GenericIPAddressField and validation errors are not
translated to the language of my project.

Pheraps this field hasn't been internationalized yet?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: MySQL data export to Excel sheet

2011-08-11 Thread Landy Chapman
This is not strictly a django question.  What are the bounds (lower limit)
for the library you are using  eg is there really a row 0, col 0 in the
spreadsheet?

Give this a try
#--
http://pastebin.com/jz6gH9yz

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: MySQL data export to Excel sheet

2011-08-11 Thread Andre Terra
Take a look at the builtin enumerate() function.

Cheers,
AT

On Thu, Aug 11, 2011 at 11:33 AM, Dipo Elegbede
wrote:

> Hello All,
>
> I have a little problem, I,d like to share with you for possible solution.
>
> I have a models like this:
>
> class MyBuddyt(models.Model):
>
> location = models.CharField(blank=True, max_length=200)
> name = models.CharField(blank=True, max_length=200)
> email = models.CharField(blank=True, max_length=200)
> comment = models.CharField(blank=True, max_length=200)
> phone = models.DateCharField(blank=True, max_length=200)
>
> I have created over 90 buddies and these data lies in my database.
>
> I want to export these data from the database straight to an Excel file i.e
> *.xls.
>
> I know this is doable using python csv module but that's not what I want.
>
>  I have tried using the xlrd and xlwt package and I am sure they can get
> it done, I just haven't been able to get my way around.
>
> If I do this:
> buddies = MyBuddy.objects.all()
> for buddy in buddies:
>  print buddy.name, buddy.location, buddy.email, buddy.phone, buddy.comment
>
> I get 90 line of information as ordered by the print function, with each
> line having 5 values.
>
> Now I want this to go into an Excel file so that each line represents a row
> and each of the 5 values per role stays in different columns on that row e.g
> buddy.name in cell(1,a) , buddy.location in cell(2,a),
> buddy.email in cell(3,a), buddy.phone in cell(4,a),
> buddy.comment in cell(5,a)
>
> How do I get this done to happen for the 90 entries.
>
> I have tried this:
>
> for buddy in buddies:
>   for row in range(r+1):
>for col in range(4):
> sh.write(row,col,'%s' % (buddy))
>
> I got the error:
>
> Exception: Attempt to overwrite cell: sheetname=u'names' rowx=0 colx=0
>
>  Did this:
>
> for buddy in buddies:
> colm = 0
> row = 1
> for item in buddyt:
>  sh.write(row, colm, item)
>  bk.save('C:\Users\owner\Desktop\DEL\tester.xls')
>
> Got this error:
>
> TypeErrorMyBuddy object not iterable
>
> and also this:
>
> for contact in contacts:
>  row=0
>  col=0
>  r=90
>  while row < r:
>   sh.write(row,col,buddy.name)
>   col += 1
>   sh.write(row,col,buddy.location)
>col += 1
>   sh.write(row,col,buddy.email)
>   col += 1
>   sh.write(row,col,buddy.phone)
>   col +=1
> sh.write(row,col,buddy.comment)
>   row +=1
>  bk.save('C:\Users\owner\Desktop\DEL\tester.xls')
>
> then got this error:
>
> Exception: Attempt to overwrite cell: sheetname=u'names' rowx=0 colx=0
>
> Kindly help with a hint please.
>
> Regards
>
> --
> Elegbede Muhammed Dipo
> TimbaObjects Co.,
> +2348033299270
> +2348077682428
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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: "Great circle" using the django ORM?

2011-08-11 Thread Bill Freeman
The earth isn't a sphere, but is an oblate spheroid.  Note the difference
between the polar radius and the equatorial radius.  Quite small, but
measurable.  A surveyor probably knows how to calculate the error.  I
don't.  I was just noting that it exists, but that I find the difference in the
odometer accuracy of my car versus my motorcycle to be much bigger,
and thus I'm happy with the approximate formula.

On Thu, Aug 11, 2011 at 2:16 PM, Thomas Orozco
 wrote:
> Indeed!
> As a sidenote, once you factor in the size, to what extent do you think it
> is not precise?
>
> Le 11 août 2011 19:55, "Bill Freeman"  a écrit :
>> Only on a flat earth of radius 1 radian. Henrik is correct on a
>> spherical earth (which I
>> find close enough).
>>
>> On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco
>>  wrote:
>>> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )
>>>
>>> Le 11 août 2011 17:09, "Thomas Weholt"  a
>>> écrit :
 I got a model with longitude and latitude and want to be able to find
 other objects nearby a selected object. Can this be done using the
 django orm? What is the best approach to do this in a django project?

 I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
 it in SQL is ok and probably the best solution performance wise, but
 if it has to be done in python I'll do that too.

 Ref question on stackoverflow:


 http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle

 --
 Mvh/Best regards,
 Thomas Weholt
 http://www.weholt.org

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

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

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



Re: "Great circle" using the django ORM?

2011-08-11 Thread Gelonida N
On 08/11/2011 06:43 PM, Thomas Orozco wrote:
> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )

Try the formula close to the poles and you notice that there is
something missing.

Your formula is correct on a flat surface but (there you talk about x
and y and not about lattitude and longitude)  and should be rather
correct  close to the equator


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: "Great circle" using the django ORM?

2011-08-11 Thread Thomas Orozco
Thank you both for the details!
Le 11 août 2011 23:04, "Gelonida N"  a écrit :
> On 08/11/2011 06:43 PM, Thomas Orozco wrote:
>> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) )
>
> Try the formula close to the poles and you notice that there is
> something missing.
>
> Your formula is correct on a flat surface but (there you talk about x
> and y and not about lattitude and longitude) and should be rather
> correct close to the equator
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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: "Great circle" using the django ORM?

2011-08-11 Thread Gelonida N
Databases with ordinary indexes are rather bad with finding something
nearby.

Thus some DB engines implemented rtree indexes
(Look for example at http://www.sqlite.org/rtree.html )
or similiar kind of indexes allowing to locate objects
within a certain latitude / longitude range.witt much less effort as if
you had one normal laitude index and one normal longitude index.


If you have a huge set of lcoations.
You can reduce the search effort considerable by  first limiting the
search space by identifying all objects within a certain lattude /
longitude range oand only afterwards calculating the exact distance for
the object in this 'rectanguler '  sub region.

As I'm a django newbie and as I don't know the db engines that well
I'm not sure whether your database engine supports r-indexes (or alike)
and whether there are any recommendations of how to write a django
query, such, taht it benefits from such special spactial indexes.



On 08/11/2011 05:09 PM, Thomas Weholt wrote:
> I got a model with longitude and latitude and want to be able to find
> other objects nearby a selected object. Can this be done using the
> django orm? What is the best approach to do this in a django project?
> 
> I found a answer on Stackoverflow, but doesn't work with sqlite. Doing
> it in SQL is ok and probably the best solution performance wise, but
> if it has to be done in python I'll do that too.
> 
> Ref question on stackoverflow:
> http://stackoverflow.com/questions/4610717/django-determining-if-geographic-coordinates-are-inside-of-an-circle
> 


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: making history

2011-08-11 Thread Mike Dewhirst
Thanks Andre and everyone. It is holding me up too much at the moment. 
I've put it on the wish-list for post-release revision. I've kept all 
your suggestions and will investigate.


Thanks again.

Mike

On 11/08/2011 10:40pm, Andre Terra wrote:

I have played around with django-audit-log for a while, and so far it
works great. However, I do need to work on saving the records to a
separate db, as Shawn suggested.

Fwiw, there's a page on the wiki about audit trail/logs, which, albeit
outdated, should prove helpful.


Cheers,
AT

On 8/10/11, Mike Dewhirst  wrote:

On 11/08/2011 9:51am, Shawn Milochik wrote:

Mike,

I'm doing something similar in another project. I created a sublass of
models.Model and am using that throughout the project, which makes it
much easier.

I'm sub-classing models.Model to include created, updated and updated_by
fields which is pretty ordinary but nice. I'm also borrowing Marty
Alchin's (Pro Django pp257 - 260) CurrentUserField to automatically
insert the current user into updated_by.

I used the same technique to subclass models.ForeignKey('Document',
to_field='ancestor' ..) so I can just add AncestorKey() to any model
which needs to link to the "line" of documents rather than a single
document. The project isn't anywhere near finished - I'm still writing
the models - so I don't know how well all this will work - but my thanks
to Marty anyway!

Also - I just googled and found -
https://bitbucket.org/q/django-simple-history/overview which builds on
Marty Alchin's approach to history. I haven't fully understood his
approach yet so the content of that link is probably a bit beyond me at
the moment.


On the post-save of any subclass of my custom model, I serialize the
model's fields as a JSON object and store it in a text field of my
application's database in a special audit model. That audit object
stores the timestamp, instance's primary key, and optionally the User
instance that changed it.

There's also a 'description' field in my audit model. For every entry
in the audit table for the same primary key you can grab the JSON and
compare them and write plain text to the description field like 'last
name changed from Smith to Smithe by someguy at 2011-08-10 13:42.'

The beauty of the 'description' field is that if I ever want to change
the format of that, I can change my code and then re-generate the
description from the JSON, so there won't be a cutoff between
"old-style audit history" and "new-style audit history."

Beauty indeed :)

I'm definitely going to rethink my design. You are making me think a
generic solution is worthwhile.


Incidentally, my custom model (and therefore all subclasses of it) are
using a UUID as a primary key to avoid the horror that is generic
foreign keys. Just in case you were wondering how my audit scheme
works across various models.

That's something I haven't investigated. I haven't experienced too many
horrors yet.

Thanks again

Mike


Shawn


--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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.



Django, Json and Android

2011-08-11 Thread Kevin Anthony
i'm trying to interface a django json page with an android application.
it seems most json applications written for android use
www.somepage.com/json.php?this=that&something=anotherthing

But that doesn't work with django,

Has anyone interfaced Django and Android? and if they did, is there
any reading material on it?

-- 
Thanks
Kevin Anthony
www.NoSideRacing.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.



data modeling in Django

2011-08-11 Thread Adam Zedan
hi coming from a background dealing with Relational database, i am q bit
unfamiliar to the concepts of data modelling such as one to one,one to many
etc.When to use them why to use them and the drawbacks of not using
them.Could anyone please suggest a good resource(books,websites..) on
quickly getting started with this thanks..

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



Re: data modeling in Django

2011-08-11 Thread Shawn Milochik
If you're already familiar with relational databases then you probably 
already know this stuff, just with different terminology.


This should clear things up:
https://docs.djangoproject.com/en/1.3/ref/models/fields/#module-django.db.models.fields.related

Also, do the tutorial, then fiddle with the models a bit more if you 
like, then use sqlall to see the raw SQL your model definitions represent:

https://docs.djangoproject.com/en/1.3/ref/django-admin/#sqlall-appname-appname


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



Running the orbited server?

2011-08-11 Thread raj
Odd question, but I'm trying to follow this tutorial which explains
how to set up comet with django. I'm just confused about some stuff
when I'm trying to do the tutorial.

Firstly, where does the orbited.cfg file go? I just placed it at the
root of my application (where the settings.py file etc. is). Also, in
the cfg, It says to use the localhost address as the http, but I'm not
running a development server, can I just put the url I'm using there?
What about the port issue?

Secondly, at the end of the tutorial, it says to run the orbited
server. How do I do this? Do I need to install orbited beforehand? I
ask this also because the html file requires an orbited.js file, and I
have no clue where to find that. orbited.org doesn't seem to work. I
found some github distros, but I dunno exactly how to make all the
pieces fit. Currently I have pyorbited installed. 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.



Django NoSQL support status?

2011-08-11 Thread Nathan Hoad
Hi guys, just wondering what the status is on the official NoSQL
support? I've done a lot of reading and the last official post I can
see is Alex Gaynor's GSoC post, from August last year mentioning the
Query refactor and how it should help down the road for NoSQL, but
nothing past that.

Basically, I'm just wondering what, if anything, is being done about
it?

Thanks,

Nathan.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 NoSQL support status?

2011-08-11 Thread Nathan Hoad
Hmm, silly me. I posted this to the users group, not the developers
group. My mistake!

On Aug 12, 1:18 pm, Nathan Hoad  wrote:
> Hi guys, just wondering what the status is on the official NoSQL
> support? I've done a lot of reading and the last official post I can
> see is Alex Gaynor's GSoC post, from August last year mentioning the
> Query refactor and how it should help down the road for NoSQL, but
> nothing past that.
>
> Basically, I'm just wondering what, if anything, is being done about
> it?
>
> Thanks,
>
> Nathan.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Running the orbited server?

2011-08-11 Thread william ratcliff
Can't write much now, but you may look at my students' prototype of a web
based system for data reduction at:
https://github.com/pjreddie/WRed

Here, we were updating the client every time a new datapoint came off of our
instrument.  The README tells you how to start orbited, what to do with
STOMP, etc.However, I've also had problems with orbited.org--at some
point, I think the project forked into orbited2 and hookbox.   I'd be really
curious to know what other people are using for Comet--are they still using
django, or did they move on to using something else?

Best,
William
(btw. for our app, it's big and you'd have to fake the data stream to run
the live data part, but it should give you an idea where to put things and
what goes in a cfg file)

On Thu, Aug 11, 2011 at 10:24 PM, raj  wrote:

> Odd question, but I'm trying to follow this tutorial which explains
> how to set up comet with django. I'm just confused about some stuff
> when I'm trying to do the tutorial.
>
> Firstly, where does the orbited.cfg file go? I just placed it at the
> root of my application (where the settings.py file etc. is). Also, in
> the cfg, It says to use the localhost address as the http, but I'm not
> running a development server, can I just put the url I'm using there?
> What about the port issue?
>
> Secondly, at the end of the tutorial, it says to run the orbited
> server. How do I do this? Do I need to install orbited beforehand? I
> ask this also because the html file requires an orbited.js file, and I
> have no clue where to find that. orbited.org doesn't seem to work. I
> found some github distros, but I dunno exactly how to make all the
> pieces fit. Currently I have pyorbited installed. 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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Running the orbited server?

2011-08-11 Thread william ratcliff
You may also want to look at some of the projects at:
https://github.com/mcarter

On Fri, Aug 12, 2011 at 12:58 AM, william ratcliff <
william.ratcl...@gmail.com> wrote:

> Can't write much now, but you may look at my students' prototype of a web
> based system for data reduction at:
> https://github.com/pjreddie/WRed
>
> Here, we were updating the client every time a new datapoint came off of
> our instrument.  The README tells you how to start orbited, what to do with
> STOMP, etc.However, I've also had problems with orbited.org--at some
> point, I think the project forked into orbited2 and hookbox.   I'd be really
> curious to know what other people are using for Comet--are they still using
> django, or did they move on to using something else?
>
> Best,
> William
> (btw. for our app, it's big and you'd have to fake the data stream to run
> the live data part, but it should give you an idea where to put things and
> what goes in a cfg file)
>
> On Thu, Aug 11, 2011 at 10:24 PM, raj  wrote:
>
>> Odd question, but I'm trying to follow this tutorial which explains
>> how to set up comet with django. I'm just confused about some stuff
>> when I'm trying to do the tutorial.
>>
>> Firstly, where does the orbited.cfg file go? I just placed it at the
>> root of my application (where the settings.py file etc. is). Also, in
>> the cfg, It says to use the localhost address as the http, but I'm not
>> running a development server, can I just put the url I'm using there?
>> What about the port issue?
>>
>> Secondly, at the end of the tutorial, it says to run the orbited
>> server. How do I do this? Do I need to install orbited beforehand? I
>> ask this also because the html file requires an orbited.js file, and I
>> have no clue where to find that. orbited.org doesn't seem to work. I
>> found some github distros, but I dunno exactly how to make all the
>> pieces fit. Currently I have pyorbited installed. 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.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: dull look after install on ubuntu

2011-08-11 Thread Derek
To quote a sporting hero from my country:
"The more I practice, the luckier I get"
~ Gary Player

On Aug 11, 12:48 pm, Peter Kovgan  wrote:
> Gelonida N, thanks.
>
> I believe you , I'm just unlucky programmer :)
>
> I should reinstall my linux django from scratch.
>
> Thank you for the explanation! It was very helpful.
>
> Peter.

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