Re: Forbidden (403)

2012-11-13 Thread Nebros
kundendaten- {% include "header.html" %} Kundendaten {% include "header2.html" %} Portal Ausgabe Kundendaten {% include "sql.html" %} NameE-Mail '.$result['t_name'].''.$result['t_mail'].' {% include "footer.html" %} -

Re: Forbidden (403)

2012-11-13 Thread Jirka Vejrazka
I may be wrong, but I don't see you using {% csrf_token %} anywhere. You're posting random snippets from your code that only loosely relate - I have trouble finding full code for the view and all components of HTML templates causing you trouble. So I'll just post a few tips: - before submitting

Re: Forbidden (403)

2012-11-13 Thread Nebros
thanks for your answer. by point one, it doesnt contain the csrf_token parameter, but i dont know why. ^^ to see the html better, i give the full now: portal-- Kunde Kunde {% block content %}Zeit der Aktualisierung {{ current_date }}.{% endblock %}

Re: Forbidden (403)

2012-11-13 Thread Daniel Roseman
On Tuesday, 13 November 2012 08:05:28 UTC, Nebros wrote: > > Forbidden (403)- > > CSRF verification failed. Request aborted. > Help > > Reason given for failure: > > CSRF cookie not set. > > > In general, this can occur when there is a genuine Cross Site R

Re: Forbidden (403)

2012-11-13 Thread Tom Evans
On Mon, Nov 12, 2012 at 2:00 PM, Nebros wrote: > I know this is an old problem with many answers... but no one helps me. ^^ > what i have: > > Settings > MIDDLEWARE_CLASSES = ( > 'django.middleware.csrf.CsrfViewMiddleware', > 'django.middleware.common.Common

settings.DATABASES is improperly configured

2012-11-13 Thread Yacov Schondorf
I am doing the Django tutorial. When I execute the command "python manage.py syncdb", I get the following error: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. I am executing from /Django-projects/tutorial01/mysite, and

settings.DATABASES is improperly configured

2012-11-13 Thread Yacov Schondorf
I am doing the Djando tutorial https://docs.djangoproject.com/en/1.4/intro/tutorial01/ When I execute "python manage.py syncdb" I get the error below: settings.DATABASES is improperly configured. Please supply the ENGINE value. The settings.DATABASES IS configured exactly as described in the tutor

Re: __unicode__() addition not working in basic poll application.

2012-11-13 Thread Colin Keenan
I found out the reason `__str__()` worked for me but `__unicode__()` didn't. It's because python3 already uses unicode in the `__str__` method, so if using python3, don't use `__unicode__`. On Monday, May 16, 2011 7:32:41 AM UTC-5, maaz muqri wrote: > > Hi, > ___

Re: __unicode__() addition not working in basic poll application.

2012-11-13 Thread Colin Keenan
I also found this by searching from google. I am also having the exact same problem. I know python well enough not to make a "spacing" error. The people that were having this problem over a year ago seem to have never gotten the solution to their problem. I installed everything myself from dev

Re: __unicode__() addition not working in basic poll application.

2012-11-13 Thread Colin Keenan
As of the moment I'm writing this post, my first post hasn't shown up yet. I'm having the same problem. After posting my situation, I decided to also write a __str__(self) method. That worked! But, the tutorial clearly states that we should not be doing the usual __str__, and instead doing __un

Re: django mogilefs file backend?

2012-11-13 Thread DK
If somebody search for mogilefs django backend, I've ended up with writing my own: https://github.com/cypreess/django-mogilefs-storage it uses internally pymogile client. On Sunday, November 11, 2012 10:23:57 PM UTC+1, DK wrote: > > Is there any working django 1.4 file backend for MogileFS? > >

Form wizard step back

2012-11-13 Thread azurIt
Hi, i have the following problem: User is choosing a login in first step (login is validated and is checked if it's available) and is filling up some other data in second step. Finally, i'm trying to create a new account BUT the login can be already taken (there's a little time frame between 1

Re: Obtaining field name in template

2012-11-13 Thread Axel Rau
Am 12.11.2012 um 22:59 schrieb Lachlan Musicman: > On Tue, Nov 13, 2012 at 9:51 AM, Axel Rau wrote: >> 1st trial with generic views: >> >> url.py: >>url(r'^account/(?P\d+)/$', AccountDetailView.as_view(), >> name='account-detail'), >> >> views.py: >> class AccountDetailView(DetailView): >>

Re: Forbidden (403)

2012-11-13 Thread Nebros
ok, i have it done. but i have now the next problem... what i have chaged: views @csrf_protect def portal(request): c = {} c.update (csrf(request)) now = datetime.datetime.now() return render_to_response('portal.html', {'current_date': now}, cont

Re: Form wizard step back

2012-11-13 Thread Bill Freeman
On Tue, Nov 13, 2012 at 8:17 AM, azurIt wrote: > Hi, > > i have the following problem: > User is choosing a login in first step (login is validated and is checked > if it's available) and is filling up some other data in second step. > Finally, i'm trying to create a new account BUT the login can

Re: Form wizard step back

2012-11-13 Thread azurIt
>You really need to create the account, thus reserving the login (username?) >in step 1, when the check succeeds (in fact, the test probably should be >an attempt to create the account, whose failure is what kicks the user back >to choose another login). You keep a creation date and note (perhaps

Re: Forbidden (403)

2012-11-13 Thread Nebros
Edit: first error was TypeError at /portal/... i realyzed now, the error is for the next page... > TypeError at /kundendaten/ > > pop expected at least 1 arguments, got 0 > > > > i tryed the post from this page: > http://stackoverflow.com/questions/7678231/problems-with-csrf-token > > > > n

Re: Form wizard step back

2012-11-13 Thread Bill Freeman
On Tue, Nov 13, 2012 at 9:07 AM, azurIt wrote: > >You really need to create the account, thus reserving the login > (username?) > >in step 1, when the check succeeds (in fact, the test probably should be > >an attempt to create the account, whose failure is what kicks the user > back > >to choose

[no subject]

2012-11-13 Thread vinoth kumar renganathan
i am new one to the django when i am running ./manage.py syncdb i got this in my terminal Traceback (most recent call last): File "./manage.py", line 10, in execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core

Re: Forbidden (403)

2012-11-13 Thread Tom Christie
You don't need the `c.update` etc... lines, since it's not actually being used anywhere by your view. Also you should probably just use `render` instead of `render_to_response`, since `render` will always use a RequestContext. https://docs.djangoproject.com/en/dev/topics/http/shortcuts/ On Tues

update the part 1 of Django Tutorial perhaps

2012-11-13 Thread XIE Enming
Hi, guys: I had followed the part 1 of Django Tutorial, and when I went to Part 2, I got this error: "DoesNotExist at /admin/", just like this one : https://groups.google.com/forum/?fromgroups=#!topic/django-users/o2FpMeINpPA The reason is that I should add in the table

Re: __unicode__() addition not working in basic poll application.

2012-11-13 Thread Tom Evans
On Tue, Nov 13, 2012 at 8:35 AM, Colin Keenan wrote: > I found out the reason `__str__()` worked for me but `__unicode__()` didn't. > It's because python3 already uses unicode in the `__str__` method, so if > using python3, don't use `__unicode__`. You should be fore-warned that Django does not o

Re: settings.DATABASES is improperly configured

2012-11-13 Thread Babatunde Akinyanmi
Hi Yacov, Why do you think python is importing another settings.py?? On 11/13/12, Yacov Schondorf wrote: > I am doing the Django tutorial. When I execute the command "python > manage.py syncdb", I get the following error: > settings.DATABASES is improperly configured. Please supply the ENGINE > v

nested fields

2012-11-13 Thread Gink Labrev
Hi, How to insert multiple, indefinite fields in a form ? I found this component to Rails [1], that allows to create nested fields. It's different than the native Django nested form. It's only one form, but a indefinite number of fields. You can see a example here: http://phonebook.guava.com.br/

Re: settings.DATABASES is improperly configured

2012-11-13 Thread Yacov Schondorf
I debugged using pdb and got to a point where I could examine settings.DATABASES. It was *not* the settings.DATABASES defined in my settings.py. There seems to be another Django installation on the station which conflicts with the tutorial. On Tuesday, November 13, 2012 6:32:06 PM UTC+2, Tunde

Re: Form wizard step back

2012-11-13 Thread azurIt
>Separate step is separate browser interaction. Even if you did this with >AJAX, other requests can come in in between actions. Other users don't get >blocked from accessing the site just because one is in the middle of >registering. Sorry, but that's the way the web works. > >By the way, you do

Re: settings.DATABASES is improperly configured

2012-11-13 Thread Yacov Schondorf
Just to clarify - I cannot modify the other installation but I still need to run the tutorial, so I am still looking for a solution... On Tuesday, November 13, 2012 6:46:10 PM UTC+2, Yacov Schondorf wrote: > > I debugged using pdb and got to a point where I could > examine settings.DATABASES. It

Re: Obtaining field name in template

2012-11-13 Thread Lachlan Musicman
On Wed, Nov 14, 2012 at 1:23 AM, Axel Rau wrote: > Am 12.11.2012 um 22:59 schrieb Lachlan Musicman: > >> On Tue, Nov 13, 2012 at 9:51 AM, Axel Rau wrote: >>> 1st trial with generic views: >>> >>> url.py: >>>url(r'^account/(?P\d+)/$', AccountDetailView.as_view(), >>> name='account-detail'), >

Re: __unicode__() addition not working in basic poll application.

2012-11-13 Thread Colin Keenan
Thanks for the advice. It's true that I'm just learning django, and because I wanted to use python3, I installed via the most up-to-date development source code. My experience with development versions of stuff has actually been better than the fully supported versions of the same product for s

Re: __unicode__() addition not working in basic poll application.

2012-11-13 Thread Colin Keenan
By the way, I just checked django.VERSION and it's (1, 6, 0, 'alpha', 0) So, since version 1.6 is supposed to fully support python 3, I should be fine. Obviously, being 'alpha' means I'll run into trouble, but I'll keep checking out new versions as I learn so by the time 1.6 is really out, I'll

Re: Form wizard step back

2012-11-13 Thread azurIt
for anyone having the same problem: https://code.djangoproject.com/ticket/19285 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to d

django - adding a counter for every ManyToMany field added

2012-11-13 Thread luke lukes
Hi everyone. hi have these models: #models.py class Subject(models.Model): name = models.CharField("Name",max_length=50, blank=True) ... ... class Activity(models.Model): label = models.CharField("Act. name",max_length=150) price = models.DecimalField("price", max_digits=10, decimal_place

Re: update the part 1 of Django Tutorial perhaps

2012-11-13 Thread Jirka Vejrazka
>The reason is that I should add in the table "django_site" of my database : domain and name, I did it : insert into django_site (domain, name) values ("ncegcolnx270", "mysite"); And it works. But this point, the Tutorial 1 doesn't say.. How can I perhaps help update the Tutoria

Re: django - adding a counter for every ManyToMany field added

2012-11-13 Thread Nikolas Stevenson-Molnar
With an Invoice instance, you can easily get the number of related Activity objects: i = Invoice.objects.get(pk=1) num_activities = i.activities.all().count() _Nik On 11/13/2012 12:49 PM, luke lukes wrote: > Hi everyone. hi have these models: > > #models.py > > class Subject(models.Model):

Re: django - adding a counter for every ManyToMany field added

2012-11-13 Thread luke lukes
Hi. I don't need a total counter for all related activities. I need a counter for each related Activity: Invoice instance: activity A -> counter: 3 activity B -> counter: 5 ... ... is this possible? thanks, Luke Il giorno martedì 13 novembre 2012

Re: django - adding a counter for every ManyToMany field added

2012-11-13 Thread Nikolas Stevenson-Molnar
I'm not sure I understand. Do you want the value of the "count" field in the Activity model? In that case, you could use values: activity_counts = i.activities.all().values('id', 'count') #Will give you something like [{'id': 1, 'count': 3}, {'id': 2, 'count': 5}, ...] _Nik On 11/13/2012 3:09 PM

Whats the point of having dicts in templates if one cannot access them by key?

2012-11-13 Thread Juan Pablo Tamayo
Let me explain, I have a nested dictionary like: agenda = {'3': {'2012-11-11': , '2012-11-14': , ...}, '7': {'2012-11-9': , }, '2': {'2012-10-28': }, } And I want to access it by specifying the two keys. I've red that i must access the dict like (where attribute is an attribute of : {% fo

Re: nested fields

2012-11-13 Thread Juan Pablo Tamayo
Maybe many_to_many relationships ? On Tuesday, November 13, 2012 11:43:20 AM UTC-5, Gink Labrev wrote: > > Hi, > > How to insert multiple, indefinite fields in a form ? I found this > component to Rails [1], that allows to

Re: django - adding a counter for every ManyToMany field added

2012-11-13 Thread Vibhu Rishi
Would this not work : count = i.objects.filter(activities=Activity).count() Where you would put the count in a for loop for the Activity and iterate over it. V. On Wed, Nov 14, 2012 at 5:05 AM, Nikolas Stevenson-Molnar < nik.mol...@consbio.org> wrote: > I'm not sure I understand. Do you want

Re: Whats the point of having dicts in templates if one cannot access them by key?

2012-11-13 Thread Lachlan Musicman
I used the SortedDict datastructure :) https://docs.djangoproject.com/en/dev/ref/utils or /path/django-docs/ref/utils.html#django.utils.datastructures.SortedDict On Wed, Nov 14, 2012 at 4:40 PM, Juan Pablo Tamayo wrote: > Let me explain, I have a nested dictionary like: > > agenda = {'3': {'201