django comments application Caught No Reverse Mismatch while rendering

2011-06-19 Thread Pulkit Mehrotra
{% load comments i18n %} 2 {% csrf_token %} 3 {% if next %}{% endif %} 4 {% for field in form %} 
5 {% if field.is_hidden %} 6 {{ field }} 7 {% else %} 8 {% if 
field.errors %}{{ field.errors }}{% endif %} 9  12 {{ field.label_tag }} {{ field }} 





Whenever i use comment_form_target i am getting this error,i am using django 
version 1.3
















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



Form wizard

2011-06-19 Thread veva...@yandex.ru
Please give me a reference to a full example of Form wizard.
To learn it I try to solve such an application (details are omitted):
urls.py:
urlpatterns = patterns('',
(r'^hotel_wizard/', 'my.app.views.hotel_info'),
models.py:
class Country(models.Model):
name = models.CharField(max_length=50)
objects = models.Manager()
class Region(models.Model):
name = models.CharField(max_length=50)
country = models.ForeignKey(Country)
objects = models.Manager()
class Hotel(models.Model):
name = models.CharField(max_length=255)
region = models.ManyToManyField(Region)
price = models.IntegerField()
objects = models.Manager()
forms.py:
class HotelForm1(forms.Form):
country = forms.ModelChoiceField(queryset=Country.objects.all())
class HotelForm2(forms.Form):
region = forms.ModelChoiceField(queryset=Region.objects.all()) ???
price = forms.DecimalField(max_digits=7)
class HotelWizard(FormWizard):
def done(self, request, form_list):
return HttpResponseRedirect('/page-to-redirect-to-when-done/')
I stopped at this step. How can I pass country selected to HotelForm2
and use it in queryset, and so on.
Maybe the best way for me is to look at an example. I didn't find it
in djangoproject.com and 3 books on Django I have.
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.



Re: registering unzipped files on the local disk

2011-06-19 Thread francescortiz
Faheem,

In your post you write:

"This works, but I traced through the code, and found that the code
was using streaming, when clearly the optimal thing to do in this case
would be to just copy the file from the temporary location to the
permanent location"

In java copying files is performed by redericting data from a file
input stream to a file ouput stream, so your sentence sounded to me
like "Instead of copying a file I want to just copy a file" :P

Though I am no python expert, I suspect that using streams in python
is fine as well.

You could do some performance tests of stream copy vs copyfile
function in python. If you do, please share results!

Hope I help,

Francesc

On Jun 17, 10:37 pm, Faheem Mitha  wrote:
> Hi,
>
> Can anyone help me with
>
> http://stackoverflow.com/questions/6386062/django-registering-unzippe...
>
> ?
>
> If you reply via email, please cc me. Thanks.
>
>                               Regards, Faheem.

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

2011-06-19 Thread francescortiz
Well, I run the test:

code used:

http://pastebin.com/9FNT82ym

results (second result is stream copy):

$ python2 cp.py
8.55721712112
5.28589200974

$ python2 cp.py
8.5057990551
6.55976104736

$ python2 cp.py
6.88285589218
8.86908006668

$ python2 cp.py
5.8047721386
8.57982397079

$ python2 cp.py
8.38824915886
7.2968108654

$ python2 cp.py
5.52904415131
5.24869608879

$ python2 cp.py
7.50472903252
7.09118294716

So, stream copy seams to faster most of the times, what allows us to
conclude that it is fine to use stream copy.

Regards,

Francesc


On Jun 17, 10:37 pm, Faheem Mitha  wrote:
> Hi,
>
> Can anyone help me with
>
> http://stackoverflow.com/questions/6386062/django-registering-unzippe...
>
> ?
>
> If you reply via email, please cc me. Thanks.
>
>                               Regards, Faheem.

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



Easiest way to limit email warnings?

2011-06-19 Thread graeme
What is the simplest way of preventing the flood of emails that
results from a site wide error? I do not want to end up with 10,000
emails because the database was down for an extended period.

I do not want to turn it off with ADMINS = () because it is useful for
reporting one-off errors.

I cannot limit at the mail server because the site is on shared
hosting.

Django Sentry seems to be able to email an error only the first time
it is seen, but it seems overkill for a very simple site - its bigger
than the apps that run the site combined and it introduces an external
dependency on a site that has only has one (other than Django and the
database driver that is!), and even that is non-critical.

Are there any other options?

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



Form login and get information.

2011-06-19 Thread Carsten Jantzen
Hi

I have started to build a application using django.
I am about to receive input from a form.
Using this input ( login and security code ) and I have to connect to
another site login and retrive player information.

I am kind confused as to where should the code which connect to the
remote site be?

I have made a form class, inside this I could retrive the variables
and make the form connect and return failure to connect or player
information.

Or should the views handle the form and make the connection and get
the information.

Or should the information be passed on to a view which handles the
login and gets the information.

/Carsten

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



Re: Easiest way to limit email warnings?

2011-06-19 Thread Developr
Look into Queuing, something like AMQP or REDIS

On Jun 19, 2:17 pm, graeme  wrote:
> What is the simplest way of preventing the flood of emails that
> results from a site wide error? I do not want to end up with 10,000
> emails because the database was down for an extended period.
>
> I do not want to turn it off with ADMINS = () because it is useful for
> reporting one-off errors.
>
> I cannot limit at the mail server because the site is on shared
> hosting.
>
> Django Sentry seems to be able to email an error only the first time
> it is seen, but it seems overkill for a very simple site - its bigger
> than the apps that run the site combined and it introduces an external
> dependency on a site that has only has one (other than Django and the
> database driver that is!), and even that is non-critical.
>
> Are there any other options?

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

2011-06-19 Thread raj
Thank you so much.
It worked, but I had to also comment out the EMAIL_BACKEND part of the
settings.py file. Thanks again.

On Jun 17, 10:57 pm, william ratcliff 
wrote:
> Hi Raj,
>
> It sounds like your problem is email, rather than the form.   In our
> settings.py we use:
>
> EMAIL_USE_TLS= True
> EMAIL_HOST='smtp.webfaction.com'
> EMAIL_HOST_USER=''
> EMAIL_HOST_PASSWORD=r' EMAIL_PORT=587
> DEFAULT_FROM_EMAIL='My Company '
> SERVER_EMAIL='webmas...@example.com'
>
> Webfaction has the concept of a mailbox, which you setup and that is your
> email host user.
> Your email host password is what you set from their control panel.   The
> default from email and the server email need to be valid emails for the
> mailbox that you have created at webfaction.   If this doesn't work, then
> test your code with a known email provider (ex. gmail) and verify that it
> works.   For gmail the email host will be smtp.gmail.com.  Change the
> email_host_user and password to your gmail account.
>
> Good Luck!
>
> William
>
>
>
>
>
>
>
> On Fri, Jun 17, 2011 at 12:43 PM, raj  wrote:
> > Thanks, I tried the shell thing above. It says that it sends without
> > error, but I still dont receive any emails. Thank you
> > -Raj
>
> > On Jun 17, 12:23 pm, william ratcliff 
> > wrote:
> > > If you can wait, I use webfaction and can give you a response for what we
> > do
> > > when I get home late tonight--the email part was a bit annoying to
> > > setup--the main thing is to recognize that they are using their mailbox.
>
> > > Best,
> > > William
>
> > > On Fri, Jun 17, 2011 at 2:27 AM, raj  wrote:
> > > > Hey guys,
>
> > > > I have a webfaction account, and I was trying to get a contact form
> > > > working for my website. The problem is that I can't seem to get it to
> > > > work. Can someone walk me through this? I couldn't figure it out from
> > > > the djangobook tutorial. I think something is wrong with my settings
> > > > and stuff. Here are my files:
>
> > > > forms.py:
>
> > > > from django import forms
>
> > > > class ContactForm(forms.Form):
> > > >    email = forms.EmailField()
> > > >    name = forms.CharField()
> > > >    subject = forms.CharField()
> > > >    message = forms.CharField(widget=forms.widgets.Textarea())
>
> > > > views.py:
>
> > > > def contact(request):
> > > >    if request.method == 'POST':
> > > >        form = ContactForm(request.POST)
> > > >        if form.is_valid():
> > > >            cd = form.cleaned_data
> > > >            send_mail(
> > > >                cd['subject'] + " - " + cd['name'],
> > > >                cd['message'],
> > > >                cd.get('email', 'nore...@oneadmissions.com'),
> > > >                ['i...@oneadmissions.com'],
> > > >            )
> > > >            return HttpResponseRedirect('/contact/thanks/')
> > > >    else:
> > > >        form = ContactForm()
> > > >    return render_to_response('/home/oneadmin/webapps/oneadmin/
> > > > oneadmin/templates/oneadmissions/contact.html', {'form': form},
> > > > context_instance=RequestContext(request))
>
> > > > def thanks(request):
> > > >    return render_to_response('/home/oneadmin/webapps/oneadmin/
> > > > oneadmin/templates/oneadmissions/random.html', {'phrase': "Thank you!
> > > > We will get back to you shortly"},
> > > > context_instance=RequestContext(request))
>
> > > > settings.py:
>
> > > > EMAIL_HOST = 'smtp.webfaction.com'
> > > > EMAIL_HOST_USER = 'i...@oneadmissions.com' #the email account that
> > > > receives the email
> > > > EMAIL_HOST_PASSWORD = 'PASSWORD'
> > > > EMAIL_USE_TLS = True
>
> > > > *I've tried adding an EMAIL_PORT, DEFAULT_FROM_EMAIL, and
> > > > SERVER_EMAIL variables, didn't do anything.
>
> > > > urls.py:
> > > > urlpatterns = patterns('',
> > > >                        (r'^contact/$', views.contact),
> > > >                        (r'^contact/thanks/$', views.thanks),
> > > > )
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django-users@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > django-users+unsubscr...@googlegroups.com.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

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

Re: Easiest way to limit email warnings?

2011-06-19 Thread Brian Bouterse
+1 for django-sentry.  I use it on even the smallest sites and it works
great there too.

Brian

On Sun, Jun 19, 2011 at 9:17 AM, graeme  wrote:

> What is the simplest way of preventing the flood of emails that
> results from a site wide error? I do not want to end up with 10,000
> emails because the database was down for an extended period.
>
> I do not want to turn it off with ADMINS = () because it is useful for
> reporting one-off errors.
>
> I cannot limit at the mail server because the site is on shared
> hosting.
>
> Django Sentry seems to be able to email an error only the first time
> it is seen, but it seems overkill for a very simple site - its bigger
> than the apps that run the site combined and it introduces an external
> dependency on a site that has only has one (other than Django and the
> database driver that is!), and even that is non-critical.
>
> Are there any other options?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Brian Bouterse
ITng Services

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Why does OpenLayers not load in django with this template ?

2011-06-19 Thread Malcolm Box
On 17 Jun 2011, at 23:07, Satyajit Sarangi wrote:

> 
> This is my template .
>
> 
> Where should I store the OpenLayers-2.10 folder for this template to
> work ?

Almost certainly there is no such place. Assuming your web page is at 
http://example.com/a/path/to/page, you've told it to look for the JS file at 
http://example.com/a/path/OpenLayers.js which is highly unlikely to map to 
something that gets served by your webserver.

You need to read the documentation on media files, and then put the path to 
your media root in the script tag.

Malcolm

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

2011-06-19 Thread raj
Its asking me to locate this admin.py file inside my application. I
can't find this file. Should I just make one inside an application
(after running the startapp function)?

On Jun 18, 12:40 pm, creecode  wrote:
> Hello Raj,
>
> On Saturday, June 18, 2011 8:52:44 AM UTC-7, raj wrote:
>
> And when I use the
>
> > AUTH_PROFILE_MODULE way, I am not getting the extra fields to show up
> > on my admin site. Can someone show me how to use it this way? I create
> > a model in an app, create additional fields in a UserProfile class,
> > and i syncdb, but nothing shows up in the auth_user section in the
> > admin page.
>
> You probably need to register your UserProfile with the admin 
> 
> >.
>
> Toodle-l.
> creecode

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



Re: Alternate user fields

2011-06-19 Thread Kenneth Gonsalves
On Sun, 2011-06-19 at 23:39 -0700, raj wrote:
> Its asking me to locate this admin.py file inside my application. I
> can't find this file. Should I just make one inside an application 

yes
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



How to send the class name from one template to another template both in different apps in django ?

2011-06-19 Thread Satyajit Sarangi
Lets say I work on a class in one template by a certain view . There
is a link on that template , that takes  me to another template in a
different app , where I would like to add certain permissions to that
particular class_id that I just saved in this app . How do I do that ?

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