Re: Directory structure issue.

2011-06-25 Thread Mike Dewhirst

On 26/06/2011 8:18am, Frederico Betting wrote:

Hi All

I am beginner in using django framework and I'm trying to do a project 
with a different directory structure but it's not working and I don't 
know what I am doing wrong.

Follow an example for what I am doing:

project
`-- core
|-- app1
|   |-- __init__.py
|   `-- models
|   |-- __init__.py
|   |-- model01.py
|   `-- model02.py
`-- app2
|-- __init__.py
`-- models
|-- __init__.py
|-- model03.py
`-- model04.py

As I've read in some tutorials, I've updated the __init__.py in models 
directory adding all the references contained on models files. For 
example, I updated the file project/core/app1/models/__init__.py 
adding all the model classes I had inside model01.py and model02.py. I 
also added a "class META" inside all the classes I have in my models 
like this: (example for app1)



*project/core/app1/models/__init__.py:*
/from modelFoo01 import */
/from modelFoo02 import */


*project/core/app1/models/model01.py*
/from django.db import models/
/

class foo01(models.Model):

 (...)
//
/

/
//
class Meta:
//
app_label = 'app1'


/
class foo02(models.Model):

 (...)
//
/

/
//
class Meta:
//
app_label = 'app1'

/
/
*
*
*
*
**project/core/app1/models/model02.py**
**/from django.db import models/**
**/
/**
**//
class foo03(models.Model):

 (...)
//
/

/
//
class Meta:
//
app_label = 'app1'


/
class foo04(models.Model):

 (...)
//
/

/
//
class Meta:
//
app_label = 'app1'

/
//**
/
/
In the settings.py file, I updated INSTALLED_APPS adding the values 
'core.app1' and 'core.app2'.
When I try to sync with DB, nothing happens. When I set the command 
"python manage.py sql core.app1" I get the message: "/Error: App with 
label core.app1 could not be found. Are you sure your INSTALLED_APPS 
setting is correct?/".


At first glance, my guess is that you should call them app1 and app2 if 
your settings.py file is in project/core.


Mike

I have already tried many different ways to make this thing works, but 
it doesn't work.

What is my mistake? Please, anyone could help me on this?

Thank you in advance.

Fred
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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.



Importing file to Models - Temporary store to allow confirming?

2011-06-25 Thread Victor Hooi
heya,

We have a CSV file that we are importing into a Django application, and then 
creating the appropriate models and relationships.

At the first page, we have a file upload form where the user selects a file.

We then parse the file, and return a second page showing them what would be 
created, any validation errors etc.

The user can then decide whether to proceed or not (or possibly to correct 
any areas on-screen).

What would be the best way of storing the temporary interim models, before 
it actually hits the database proper?

The CSV file will be fairly big, possibly around 200 Kb in size, and create 
several hundred models.

Should I store this in the database somewhere, and label those models 
"temporary"? It seems a bit heavy just for a confirm, and I'm not sure if 
it's appropriate use of the database. Or is there some way we could store it 
in Django sessions? Or any other way to do it?

Cheers,
Victor

-- 
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/-/zBHlA9Q2t7MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Looking for recomendation on using popup like admin "+" widget

2011-06-25 Thread GKR
Some one please help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Vgrw_-xLcI0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: need more than 1 value to unpack error

2011-06-25 Thread Python_Junkie
I found the error.

After reviewing my own post and realizing that I was getting the same
error regardless of the syntax that I was using, and only when I was
using a template, I realized where the solution was.

The settings.py The template directory was not set up.

It is all good now.
My bad

On Jun 25, 5:54 pm, Python_Junkie 
wrote:
> I am just getting started with django.  Have been a python developer
> for a number of years
>
> I am following the examples in the book The Definitive Guide to Django
> and the same error keeps popping up.
>
> "need more than 1 value to unpack"
>
> I understand what it is trying to say, but I do not see where the
> problem lies.
>
> I have written 2 almost similar functions.
> The first works ( I know that it is not elegant code)
> The second gives me the above error.
>
> def current_section(request):
>     title="This is the best web page"
>     fp=open('my_page.html')
>     t=Template(fp.read())
>     fp.close()
>     html=t.render(Context({'title':title}))
>     return HttpResponse(html)
>
> def current_section(request):
>     title="This is the best web page"
>     return render_to_response('my_page.html',{'title':title})
>
> Also, in the first fucntion above I am getting the same error when I
> use the {% include 'nav.html' %} in my_page.html
>
> and I am also getting the same error when I use template tags.
>
> It is happening in so many areas, that there has to be something
> commonly incorrect.
>
> Any suggestions would be much appreciated.

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



please recommend a video streaming app/lib

2011-06-25 Thread akonsu
hello,

can anyone recommend a library or an application for video streaming
that can be used in a commercial site that requires good performance
and scalability? we expect the site to receive a lot of traffic. and
the main functionality is video on demand.

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: can i control select column order in a queryset?

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 6:39 PM, Joe Linoff  wrote:

> I am a newbie who is really enjoying Django. It is a great system and has
> really saved me a lot of time but I am having a problem trying to control
> the column order in a queryset.
>
> In SQL my queries would look something like this:
>
>   -- column order #1
>   SELECT 'Third','Second',First' FROM test ORDER BY 'Third' ASC;
>   -- column order #2
>   SELECT 'First','Third','Second' FROM test ORDER BY 'First' ASC;
>
> In Django 1.3 I am doing this:
>
> # column order #1
> data =
> test.objects.values('Third','Second','First').order_by('Third').all()
> data = test.objects.values('Third','Second','First') # tried this as
> well
>
> # column order #2
> data =
> test.objects.values('First','Third','Second').order_by('First').all()
> data = test.objects.values('First','Third','Second') # tried this as
> well
>
> Unfortunately, the columns are always returned in the same order.
>
> What am I doing wrong? I am trying to do something that isn't supported?
>

The calls you are showing returns lists of dictionaries. Dictionaries have
no specified order.

The order_by call you've tried in a couple of places orders the elements in
the lists, based on the values in the specified columns. It has nothing to
do with "column order".

If you describe what you are trying to achieve someone might be able to
help. You should not be caring about "column order" when using Django.

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

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



Re: need more than 1 value to unpack error

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 5:54 PM, Python_Junkie <
software.buy.des...@gmail.com> wrote:

> I am just getting started with django.  Have been a python developer
> for a number of years
>
> I am following the examples in the book The Definitive Guide to Django
> and the same error keeps popping up.
>
>
> "need more than 1 value to unpack"
>
> I understand what it is trying to say, but I do not see where the
> problem lies.
>

You'll be more likely to get help if you provide the traceback that goes
with that message.

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

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



Re: Can't get official "djangoproject.com" site running

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 4:35 PM, mark elion  wrote:

> Hello guys. I am quite a beginner in using django and python. I have
> read through tutorial on the official website, and also separate
> topics on models, views, templates, urls, forms. So I have basic idea
> on how django works.
> I have choosen the official djangoproject website from here
> https://github.com/django/djangoproject.com as the subject for my
> experiments. But I can't get it running.
> I have installed all packages it needed. And, as I didn't want to
> bother myself with PostgreSQL I changed engine to sqlite3.
>
> Now I have error:
>
> --
> DoesNotExist at /
>
> DocumentRelease matching query does not exist.
>
>
Your database doesn't have some content the code is expecting.

Your choice of base for experimentation seems a bit odd to me.
djangoproject.com isn't intended (so far as I know) to be a re-usable
project. I don't know that you are going to find anywhere what assumptions
the code makes about  what content is pre-existing in the database.

Karen

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



can i control select column order in a queryset?

2011-06-25 Thread Joe Linoff
Hi Folks:

I am a newbie who is really enjoying Django. It is a great system and has 
really saved me a lot of time but I am having a problem trying to control 
the column order in a queryset.

In SQL my queries would look something like this:

  -- column order #1
  SELECT 'Third','Second',First' FROM test ORDER BY 'Third' ASC;
  -- column order #2
  SELECT 'First','Third','Second' FROM test ORDER BY 'First' ASC;

In Django 1.3 I am doing this:

# column order #1
data = 
test.objects.values('Third','Second','First').order_by('Third').all()
data = test.objects.values('Third','Second','First') # tried this as 
well

# column order #2
data = 
test.objects.values('First','Third','Second').order_by('First').all()
data = test.objects.values('First','Third','Second') # tried this as 
well

Unfortunately, the columns are always returned in the same order. 

What am I doing wrong? I am trying to do something that isn't supported?

Regards,

Joe


-- 
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/-/sPhNTN8fqv0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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 override a ModelChoiceField in order to add FKs directly in a TextInput?

2011-06-25 Thread snfctech
I can get text inputs rendered fine by setting the widget to a
TextInput like so:

myrelation = ModelChoiceField(MyRelatedClass.objects.none(),
widget=TextInput)

But I still get ModelChoiceField validation errors on validate:

'Select a valid choice. That choice is not one of the available
choices.'

Can I disable the ModelChocieField validation or override it?  Or can
I override the ModelChoiceField entirely?  I tried using

myrelation = IntegerField(widget=TextInput) but get:

Cannot assign "123": "MyClass.relation" must be a "MyRelatedClass"
instance.

Any tips would be greatly appreciated.

Tony

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



Looking for recomendation on using popup like admin "+" widget

2011-06-25 Thread GKR
Im looking for some way to use the widget with a choice filed  like admin 
interface (+) to popup a window when clicked on it and popup should give the 
way to add new data like the datas in the choice field.

on save the window to close and the choice field to get updated along with 
that..

Please help me ...

Thanking u

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



Directory structure issue.

2011-06-25 Thread Frederico Betting
Hi All

I am beginner in using django framework and I'm trying to do a project with
a different directory structure but it's not working and I don't know what I
am doing wrong.
Follow an example for what I am doing:

project
`-- core
|-- app1
|   |-- __init__.py
|   `-- models
|   |-- __init__.py
|   |-- model01.py
|   `-- model02.py
`-- app2
|-- __init__.py
`-- models
|-- __init__.py
|-- model03.py
`-- model04.py

As I've read in some tutorials, I've updated the __init__.py in models
directory adding all the references contained on models files. For example,
I updated the file project/core/app1/models/__init__.py adding all the model
classes I had inside model01.py and model02.py. I also added a "class META"
inside all the classes I have in my models like this: (example for app1)


*project/core/app1/models/__init__.py:*
*from modelFoo01 import **
*from modelFoo02 import **


*project/core/app1/models/model01.py*
*from django.db import models*
*

class foo01(models.Model):

 (...)
**

**
class Meta:
**
app_label = 'app1'


class foo02(models.Model):

 (...)

class Meta:
app_label = 'app1'

*
*
*
*
*
*project/core/app1/models/model02.py*
*from django.db import models*
*
*
*
class foo03(models.Model):

 (...)

class Meta:
app_label = 'app1'


class foo04(models.Model):

 (...)

class Meta:
app_label = 'app1'

*
*
*
In the settings.py file, I updated INSTALLED_APPS adding the values
'core.app1' and 'core.app2'.
When I try to sync with DB, nothing happens. When I set the command "python
manage.py sql core.app1" I get the message: "*Error: App with label
core.app1 could not be found. Are you sure your INSTALLED_APPS setting is
correct?*".
I have already tried many different ways to make this thing works, but it
doesn't work.
What is my mistake? Please, anyone could help me on this?

Thank you in advance.

Fred

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



need more than 1 value to unpack error

2011-06-25 Thread Python_Junkie
I am just getting started with django.  Have been a python developer
for a number of years

I am following the examples in the book The Definitive Guide to Django
and the same error keeps popping up.


"need more than 1 value to unpack"

I understand what it is trying to say, but I do not see where the
problem lies.

I have written 2 almost similar functions.
The first works ( I know that it is not elegant code)
The second gives me the above error.

def current_section(request):
title="This is the best web page"
fp=open('my_page.html')
t=Template(fp.read())
fp.close()
html=t.render(Context({'title':title}))
return HttpResponse(html)


def current_section(request):
title="This is the best web page"
return render_to_response('my_page.html',{'title':title})

Also, in the first fucntion above I am getting the same error when I
use the {% include 'nav.html' %} in my_page.html

and I am also getting the same error when I use template tags.

It is happening in so many areas, that there has to be something
commonly incorrect.

Any suggestions would be much appreciated.

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



Can't get official "djangoproject.com" site running

2011-06-25 Thread mark elion
Hello guys. I am quite a beginner in using django and python. I have
read through tutorial on the official website, and also separate
topics on models, views, templates, urls, forms. So I have basic idea
on how django works.
I have choosen the official djangoproject website from here
https://github.com/django/djangoproject.com as the subject for my
experiments. But I can't get it running.
I have installed all packages it needed. And, as I didn't want to
bother myself with PostgreSQL I changed engine to sqlite3.

Now I have error:
--
DoesNotExist at /

DocumentRelease matching query does not exist.


Environment:

Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.3
Python Version: 2.7.2
Installed Applications:
['django.contrib.sites',
 'django.contrib.auth',
 'django.contrib.admin',
 'django.contrib.comments',
 'django.contrib.contenttypes',
 'django.contrib.flatpages',
 'django.contrib.humanize',
 'django.contrib.redirects',
 'django.contrib.sessions',
 'django.contrib.sitemaps',
 'django_website.blog',
 'django_website.aggregator',
 'django_website.docs',
 'registration',
 'south']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'django.contrib.redirects.middleware.RedirectFallbackMiddleware']


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
get_response
  111. response = callback(request,
*callback_args, **callback_kwargs)
File "C:\Python27\lib\site-packages\django\views\generic\simple.py" in
direct_to_template
  26. c = RequestContext(request, dictionary)
File "C:\Python27\lib\site-packages\django\template\context.py" in
__init__
  177. self.update(processor(request))
File "C:\Documents and Settings\user2\Desktop\!system\djangosite
\django_website\context_processors.py" in recent_release
  9. recent_release =
DocumentRelease.objects.default().version
File "C:\Documents and Settings\user2\Desktop\!system\djangosite
\django_website\docs\models.py" in default
  7. return DocumentRelease.objects.get(is_default=True)
File "C:\Python27\lib\site-packages\django\db\models\manager.py" in
get
  132. return self.get_query_set().get(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in get
  349. % self.model._meta.object_name)

Exception Type: DoesNotExist at /
Exception Value: DocumentRelease matching query does not exist.



Any help would be good, please.

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



Re: Social Networking basics? -Raj

2011-06-25 Thread Ronnie Betzen
Being a newbie myself, I find this much more appealing.
I'm grateful this is being considered, having read ESR's version as well. 

I'll also try to be very careful to follow these guidelines as I appreciate 
the time everyone here takes to help people like me.  Thanks a bunch!

On Thursday, June 23, 2011 09:17:54 PM Fabian Ezequiel Gallina wrote:
> 2011/6/23 Russell Keith-Magee :
> > On Fri, Jun 24, 2011 at 12:49 AM, Cal Leeming [Simplicity Media Ltd]
> > 
> >  wrote:
> >> On Thu, Jun 23, 2011 at 5:46 PM, Shawn Milochik  
wrote:
> >>> On 06/23/2011 12:36 PM, Cal Leeming [Simplicity Media Ltd] wrote:
>  The perfect link to refer these users to:
>  
>  http://www.catb.org/~esr/faqs/smart-questions.html
>  
>  
>  (props to harryr for finding this)
> >>> 
> >>> Yeah. I used to post that link pretty frequently until I was asked to
> >>> stop. ;o)
> >> 
> >> Lmao, I won't re-post this again then ;p
> >> 
> >>> I still think it's a great essay. If I remember correctly, the
> >>> objection to it was that the tone wasn't necessarily at the same level
> >>> of acceptance and friendliness we like to maintain in this group.
> >>> 
> >>> We should distill it into a shorter, newbie-friendly version and get it
> >>> posted somewhere official so we can refer to it.
> >> 
> >> That's be pretty cool. But my guess is that the maintainers just want us
> >> to reply with a "you need to give us more information before we can
> >> help you" speech, in a non-insulting tone. Shame, takes all the fun out
> >> of it lol. 
> > 
> > The tone is exactly why I've asked people to stop referring to ESR's
> > document. The spirit of the document -- that you can only get good
> > answers if you ask good questions -- is certainly valid, but to me,
> > ESR's tone in that document really comes off as "Stop wasting my time,
> > which is more valuable than yours, because I'm a hacker, which means
> > I'm awesome and you're not". I'm sorry, but being a 1337 h4X0R doesn't
> > give you carte blanche to treat anyone else like crap.
> > 
> > The Django core team have tried really hard to foster a positive,
> > accepting community culture. Everyone is a beginner once, and everyone
> > occasionally posts in haste and forgets to include salient details.
> > Absolutely nothing is gained by insulting a newcomer to the community.
> > 
> > As a side note, if someone were to redraft that document in such a way
> > that it *doesn't* have that tone, I'd gladly include the text in
> > Django's own documentation.
> > 
> > Yours,
> > Russ Magee %-)
> 
> I find this document[0] to be really nice, helpful and without that
> particular tone.
> 
> Someone from Python Argentina (PyAR) translated it to Spanish and it
> is what we use to guide newcomers.
> 
> [0] http://www.mikeash.com/getting_answers.html
> 
> 
> 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.



Re: Foreign key dependent model's data not getting saved !

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 1:42 PM, CareerDhaba tech wrote:

> Hey,
>
> Thanks Karen for the reply. I have been trying many things on this form and
> trying to save both the models data using one form in a single instance. I
> did try the commit=False method too but it gave an error which i couldnt
> figure out. Everytime i try doing something new an unknown error/exception
> pops up that too in some random file and location :(.
>
>
No, really, code does not behave this way. Errors do not pop up randomly in
random locations. You need to learn how to interpret the debug information
the system is providing you.


> This is the traceback which i got now after changing code
>
> Environment:
>
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/cd/registration/register/
>
> Django Version: 1.3
> [snip]
> Traceback:
> File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
> get_response
>   111. response = callback(request, *callback_args,
> **callback_kwargs)
> File "C:\Users\pradeep\Desktop\cd\registration\views.py" in register
>   23. return direct_to_template('success.html',{})
> File "C:\Python27\lib\site-packages\django\views\generic\simple.py" in
> direct_to_template
>   26. c = RequestContext(request, dictionary)
> File "C:\Python27\lib\site-packages\django\template\context.py" in __init__
>   177. self.update(processor(request))
> File "C:\Python27\lib\site-packages\django\core\context_processors.py" in
> debug
>   53. if settings.DEBUG and request.META.get('REMOTE_ADDR') in
> settings.INTERNAL_IPS:
>
> Exception Type: AttributeError at /cd/registration/register/
> Exception Value: 'str' object has no attribute 'META'
>
>
While the ultimate error here appears to be in Django code, line 23 of your
views.py file is higher up in the traceback, and that is the line causing
the problem. You are not passing the correct parameters to
direct_to_template. I'm not going to lay out what the correct parameters
should be (you could work that out for yourself by reading the docs),
because you shouldn't really be using direct_to_template there.

The common pattern for processing forms in a view is laid out here:

https://docs.djangoproject.com/en/1.3/topics/forms/#using-a-form-in-a-view

(Looking at that example I notice it should be updated to use render, not
render_to_response, but the overall pattern for the view is still correct.
Note that in the case of successful POST processing, the code in that view
returns a redirect, not a regular response. This is a general web
application pattern, not specific to Django, you can read about the reasons
for it here for example: http://en.wikipedia.org/wiki/Post/Redirect/Get )

Besides not redirecting after a successful completion, you are using two
different templates for different flows through your view, which is also
probably not what you want. You are using register.html for the initial get
of the page, and regcheck1.html for the case where the posted forms don't
validate successfully. In general you should be using the same template for
these cases.

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

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



Re: django 1.3 timing out on empty POST request

2011-06-25 Thread Roberto De Ioris

> @Karen, I tried the patch, and it doesn't seem to help. Do you have
> any ideas when is the 1.3.X scheduled to be released?
>
> @Bruno, using nginx + WSGI + DJANGO is the setup.

If you mean mod_wsgi for nginx, i am not able to help you, but if you mean
nginx + uWSGI, you will probably only need to enable post-buffering in
uWSGI (--post-buffering 4096 will be enough).

Remember to use 0.9.8.1 (latest stable) as it contains a much better
wsgi.input implementation.

>
-- 
Roberto De Ioris
http://unbit.it

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

2011-06-25 Thread mehdi ait oufkir
@Karen, I tried the patch, and it doesn't seem to help. Do you have
any ideas when is the 1.3.X scheduled to be released?

@Bruno, using nginx + WSGI + DJANGO is the setup.

-mehdi

On Jun 25, 8:56 am, bruno desthuilliers
 wrote:
> On Jun 25, 10:27 am, mehdi ait oufkir  wrote:
>
> > Thanks for the response Bruno.
>
> > Your comment made me think I forgot to mention that the issue only
> > happens in production when django is behind nginx.
>
> Duh...
>
> > I'm not sure how to run pdb in this context.
>
> Don't know if you can (no experience with nginx).
>
> > Any ideas where else to look?
>
> Anywhere between Django and nginx - which makes quite a few LOCs.
> What's your setup ? nginx + FCGI ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, 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: Foreign key dependent model's data not getting saved !

2011-06-25 Thread CareerDhaba tech
Hey,

Thanks Karen for the reply. I have been trying many things on this form and
trying to save both the models data using one form in a single instance. I
did try the commit=False method too but it gave an error which i couldnt
figure out. Everytime i try doing something new an unknown error/exception
pops up that too in some random file and location :(.

This is the traceback which i got now after changing code

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/cd/registration/register/

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


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
get_response
  111. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Users\pradeep\Desktop\cd\registration\views.py" in register
  23. return direct_to_template('success.html',{})
File "C:\Python27\lib\site-packages\django\views\generic\simple.py" in
direct_to_template
  26. c = RequestContext(request, dictionary)
File "C:\Python27\lib\site-packages\django\template\context.py" in __init__
  177. self.update(processor(request))
File "C:\Python27\lib\site-packages\django\core\context_processors.py" in
debug
  53. if settings.DEBUG and request.META.get('REMOTE_ADDR') in
settings.INTERNAL_IPS:

Exception Type: AttributeError at /cd/registration/register/
Exception Value: 'str' object has no attribute 'META'


On Sat, Jun 25, 2011 at 11:04 PM, Karen Tracey  wrote:

> On Sat, Jun 25, 2011 at 1:00 PM, CareerDhaba tech wrote:
>
>> The user model is getting saved with username and password but the
>> userprofile isn;t :(
>
>
> That is a somewhat misleading description of the problem since the code as
> you have posted it would not just fail to save the userprofile it would
> raise an exception on the attempt to pass user to RegForm, since RegForm as
> you have shown it is not expecting user as a keyword argument.
>
> The right way to handle saving model forms which have explicitly excluded
> necessary data is described here:
> https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form
>
> In this case you would want to save the originally-created RegForm instance
> uprofile with comit=False, then set the user attribute to the user returned
> by the other form save, then save the user profile instance:
>
> up = uprofile.save(commit=False)
> up.user = userid
> up.save()
>
> Karen
> --
> http://tracey.org/kmt/
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+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: Foreign key dependent model's data not getting saved !

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 1:00 PM, CareerDhaba tech wrote:

> The user model is getting saved with username and password but the
> userprofile isn;t :(


That is a somewhat misleading description of the problem since the code as
you have posted it would not just fail to save the userprofile it would
raise an exception on the attempt to pass user to RegForm, since RegForm as
you have shown it is not expecting user as a keyword argument.

The right way to handle saving model forms which have explicitly excluded
necessary data is described here:
https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form

In this case you would want to save the originally-created RegForm instance
uprofile with comit=False, then set the user attribute to the user returned
by the other form save, then save the user profile instance:

up = uprofile.save(commit=False)
up.user = userid
up.save()

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

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



Foreign key dependent model's data not getting saved !

2011-06-25 Thread CareerDhaba tech
Whats the problem with this code ?

*models.py

*class userprofile(models.Model):
user = models.OneToOneField(User)
Firstname = models.CharField(max_length=20)
Middlename = models.CharField(max_length=20)
Surname = models.CharField(max_length=20)
Gender = models.CharField(max_length=1, blank=False,
choices=GENDER_CHOICES)
Date_of_Birth = models.DateField()
Hometown = models.ForeignKey(city)
StudentType = models.CharField(max_length=20, blank=False,
choices=STUDENT_CHOICES)
*
forms.py
*from django.contrib.auth
class RegForm(ModelForm):
Date_of_Birth = forms.DateField(widget=SelectDateWidget(years=[y for y
in range(1960,2005)]))
class Meta:
model = userprofile
exclude = ('user',)

*
views.py
*from django.contrib.auth.forms import UserCreationForm

def register(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
uprofile = RegForm(request.POST)
if form.is_valid() and uprofile.is_valid():
userid = form.save()
a = RegForm(request.POST,user = userid)
a.save()
return direct_to_template('success.html',{})
else:
userform = UserCreationForm()
RF = RegForm()

return render_to_response('register.html',{
'uf': userform,
'rf': RF,
})

return render_to_response('regcheck1.html',{})
*
regcheck1.html

*{%
csrf_token %}
{{ rf.as_p }}
{{ uf.as_p }}

*

*The user model is getting saved with username and password but the
userprofile isn;t :(

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



Re: can we have a database settings per app in a single django project ?

2011-06-25 Thread sanket
Thanks Bruno so much.
I will take a look at the links you posted.

Thanks again,
sanket

On Jun 25, 8:50 am, bruno desthuilliers
 wrote:
> On Jun 25, 9:47 am, sanket  wrote:
>
> > Hi All,
>
> > I am quite new to Django and I am not able to figure out if I can have
> > database settings per application in a single django project.
>
> https://docs.djangoproject.com/en/1.3/topics/db/multi-db/
>
> > I am
> > planning to use Django for my next project and I am in a need of using
> > MongoDB just for one app and MySQL for the other parts of the project.
>
> http://www.allbuttonspressed.com/projects/django-nonrel

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

2011-06-25 Thread Kevin Anthony
I sort of knew that
Can someone post their scrubed conf file?
On Jun 25, 2011 12:54 AM, "Andrew Brookins"  wrote:
> Sorry: posting from phones... Not always awesome.
>
> If the development server serves your static files, but Apache does not,
then the problem is likely somewhere in your Apache conf or server config.
>
> --
> 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/-/oOT5Kiyo5JcJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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: deploiment an application

2011-06-25 Thread bruno desthuilliers
Posting the same question twice under different titles won't help.

On Jun 25, 10:12 am, geonomos  wrote:
> Hi,
> I'm new in django frameworck and I'm tring to develop a simple application.
> I've a free account in alwaysdata and I've follow instruction in
> "https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/?from=...";
> but if I point with the browser to the  application's url I see only the
> content of django.fcgi:
> /*
>
> #!/usr/bin/python
> import os, sys
>
> _PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> sys.path.insert(0, _PROJECT_DIR)
> sys.path.insert(0, os.path.dirname(_PROJECT_DIR))
>
> _PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
> os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
> */
>
> Could somebody help me?
>
> 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: Django with FastCGI doesn't works

2011-06-25 Thread bruno desthuilliers
On Jun 25, 10:24 am, geonomos  wrote:
> Hi,
> I'm new in django frameworck and I'm tring to develop a simple application.
> I've a free account in alwaysdata and I've follow instruction in
> "https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/?from=...";
> but if I point with the browser to the  application's url I see only the
> content of django.fcgi:

Apache configuration problem.
https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#apache-setup

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

2011-06-25 Thread bruno desthuilliers
On Jun 25, 10:27 am, mehdi ait oufkir  wrote:
> Thanks for the response Bruno.
>
> Your comment made me think I forgot to mention that the issue only
> happens in production when django is behind nginx.

Duh...

> I'm not sure how to run pdb in this context.

Don't know if you can (no experience with nginx).

> Any ideas where else to look?

Anywhere between Django and nginx - which makes quite a few LOCs.
What's your setup ? nginx + FCGI ?

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



Re: can we have a database settings per app in a single django project ?

2011-06-25 Thread bruno desthuilliers
On Jun 25, 9:47 am, sanket  wrote:
> Hi All,
>
> I am quite new to Django and I am not able to figure out if I can have
> database settings per application in a single django project.

https://docs.djangoproject.com/en/1.3/topics/db/multi-db/

> I am
> planning to use Django for my next project and I am in a need of using
> MongoDB just for one app and MySQL for the other parts of the project.

http://www.allbuttonspressed.com/projects/django-nonrel

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

2011-06-25 Thread Karen Tracey
On Sat, Jun 25, 2011 at 4:27 AM, mehdi ait oufkir wrote:

> Thanks for the response Bruno.
>
> Your comment made me think I forgot to mention that the issue only
> happens in production when django is behind nginx.
> I'm not sure how to run pdb in this context.
> Any ideas where else to look?
>

I'd first try running with current 1.3.X branch code. This ticket:

https://code.djangoproject.com/ticket/15679

sounds like it might be related, and has been fixed on the 1.3.X maintenance
branch.

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

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



Re: Looking for recommendations for Custom Forms from Admin

2011-06-25 Thread Venkatraman S
On Sat, Jun 25, 2011 at 8:17 PM, Venkatraman S  wrote:

>
>
> On Sat, Jun 25, 2011 at 7:56 PM, Matthias Kestenholz wrote:
>
>> You might want to have a look at form_designer:
>>
>> https://github.com/matthiask/form_designer
>>
>> It contains a FeinCMS content type (form_designer.models.FormContent),
>> the rest of it isn't FeinCMS-specific. A FeinCMS installation isn't
>> needed either.
>>
>> If you want to write a view yourself, the code should be structured
>> similarly to the render() method of FormContent.
>>
>
> Thanks. I actually stumbled on this and django-forms-builder (
> https://github.com/stephenmcd/django-forms-builder).
> Havent tried installing and checking both of them.
>
> Wasnt sure if there existed some other apps too?
>

And also this one : https://github.com/cuker/django-form-designer

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

2011-06-25 Thread Venkatraman S
On Sat, Jun 25, 2011 at 7:56 PM, Matthias Kestenholz  wrote:

> You might want to have a look at form_designer:
>
> https://github.com/matthiask/form_designer
>
> It contains a FeinCMS content type (form_designer.models.FormContent),
> the rest of it isn't FeinCMS-specific. A FeinCMS installation isn't
> needed either.
>
> If you want to write a view yourself, the code should be structured
> similarly to the render() method of FormContent.
>

Thanks. I actually stumbled on this and django-forms-builder (
https://github.com/stephenmcd/django-forms-builder).
Havent tried installing and checking both of them.

Wasnt sure if there existed some other apps too?

-V
http://blizzardzblogs.blogspot.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.



Re: Looking for recommendations for Custom Forms from Admin

2011-06-25 Thread Matthias Kestenholz
On Sat, Jun 25, 2011 at 3:00 PM, Venkatraman S  wrote:
> Hi,
>
> Was looking for possible django apps that help one build custom forms "on
> the fly" from the admin screens.
>

You might want to have a look at form_designer:

https://github.com/matthiask/form_designer

It contains a FeinCMS content type (form_designer.models.FormContent),
the rest of it isn't FeinCMS-specific. A FeinCMS installation isn't
needed either.

If you want to write a view yourself, the code should be structured
similarly to the render() method of FormContent.


Matthias

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

2011-06-25 Thread geonomos
Hi,
I'm new in django frameworck and I'm tring to develop a simple application.
I've a free account in alwaysdata and I've follow instruction in 
"https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/?from=olddocs#running-django-on-a-shared-hosting-provider-with-apache";
 
but if I point with the browser to the  application's url I see only the 
content of django.fcgi:
#

#!/usr/bin/python
import os, sys

_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
sys.path.insert(0, os.path.dirname(_PROJECT_DIR))

_PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

could somebody help me

Thanks

Geonomos


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



deploiment an application

2011-06-25 Thread geonomos
Hi,
I'm new in django frameworck and I'm tring to develop a simple application.
I've a free account in alwaysdata and I've follow instruction in 
"https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/?from=olddocs#running-django-on-a-shared-hosting-provider-with-apache";
 
but if I point with the browser to the  application's url I see only the 
content of django.fcgi:
/*

#!/usr/bin/python
import os, sys

_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
sys.path.insert(0, os.path.dirname(_PROJECT_DIR))

_PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
*/

Could somebody help me?

Thanks in advance


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



can we have a database settings per app in a single django project ?

2011-06-25 Thread sanket
Hi All,

I am quite new to Django and I am not able to figure out if I can have
database settings per application in a single django project. I am
planning to use Django for my next project and I am in a need of using
MongoDB just for one app and MySQL for the other parts of the project.
I know, it sounds weird but can you please let me know if that's even
possible ? if not, I would appreciate the ideas to achieve this
requirement.

Thanks,
sanket

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



Looking for recommendations for Custom Forms from Admin

2011-06-25 Thread Venkatraman S
Hi,

Was looking for possible django apps that help one build custom forms "on
the fly" from the admin screens.

Venkat

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

2011-06-25 Thread mehdi ait oufkir
Thanks for the response Bruno.

Your comment made me think I forgot to mention that the issue only
happens in production when django is behind nginx.
I'm not sure how to run pdb in this context.
Any ideas where else to look?
-mehdi

On Jun 24, 11:37 am, bruno desthuilliers
 wrote:
> On Jun 24, 7:19 pm, mehdi ait oufkir  wrote:
>
>
>
> >     def cleanup_request(request):
> >         """
> >         Removes `oauth_` keys from various dicts on the
> >         request object, and returns the sanitized version.
> >         """
> >         for method_type in ('GET', 'PUT', 'POST', 'DELETE'):
>
>               if method_type == "POST":
>                    import pdb; pdb.set_trace()
>
> >             block = getattr(request, method_type, { })
>
> Then you start the dev server, send a POST request with an empty body,
> and step thru the code until you find out  what's happening.

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