mod_python errors in production deployment. apache vs django

2008-09-16 Thread NoviceSortOf

apache conf file is configured as

*

SetHandler python-program
PythonPath "['/var/www'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE bookstor.settings
PythonOption django.root /bookstor
PythonDebug On

*

attempting to load the admin url returns


Mod_python error: "PythonHandler django.core.handlers.modpython"
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)
  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 222, in handler
return ModPythonHandler()(req)
  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 185, in __call__
self.load_middleware()
  File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 31, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 28, in __getattr__
self._import_settings()
  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 59, in _import_settings
self._target = Settings(settings_module)
  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 92, in __init__
mod = __import__(self.SETTINGS_MODULE, {}, {}, [''])
  File "/var/www/bookstor/settings.py", line 80
‘django.contrib.admin’,
^
SyntaxError: invalid syntax

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



Re: mod_python errors in production deployment. apache vs django

2008-09-16 Thread NoviceSortOf

Thanks Karen

Now having fixed the curly quotes and loaded psycopg2, I'm on to
another set of problems.

**

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 222, in handler
return ModPythonHandler()(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 195, in __call__
response = self.get_response(request)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 67, in get_response
response = middleware_method(request)

  File "/usr/lib/python2.3/site-packages/django/middleware/common.py",
line 57, in process_request
urlresolvers.resolve(request.path_info)

  File "/usr/lib/python2.3/site-packages/django/core/urlresolvers.py",
line 244, in resolve
return get_resolver(urlconf).resolve(path)

  File "/usr/lib/python2.3/site-packages/django/core/urlresolvers.py",
line 178, in resolve
for pattern in self.urlconf_module.urlpatterns:

AttributeError: 'module' object has no attribute 'urlpatterns'

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



Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread NoviceSortOf

On Sep 16, 10:33 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote:
> What is in your urls.py file?  That's where your urlpatterns should be
> stored. > R.

my url.py is simply

from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Uncomment the admin/doc line below and add
'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
 (r'^admin/(.*)', admin.site.root),
)


Our objective is to get the admin modules to work on a production
server for testing.

Testing for url patterns using the equivalent of
>>> http://www.mysite.com/bookstor/

I get a Page Not found 404
***
Using the URLconf defined in bookstor.urls, Django tried these URL
patterns, in this order:
^admin/doc/
^admin/(.*)
The current URL, , didn't match any of these.

Testing the admin page
>>> http://www.mysite.com/bookstor/admin

we get as final errors...

...
File "/usr/lib/python2.3/site-packages/django/db/models/sql/query.py",
line 206, in results_iter
for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.3/site-packages/django/db/models/sql/
query.py", line 1700, in execute_sql
cursor.execute(sql, params)
  File "/usr/lib/python2.3/site-packages/django/db/backends/util.py",
line 19, in execute
return self.cursor.execute(sql, params)
ProgrammingError: relation "django_session" does not exist



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



Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread NoviceSortOf

Ok finally got this resolved there were several problems.

Following the book the Definative Guide to Django and online
documentation somehow did not eliminate several snags,
I'd like to post my findings here.

1. postgresql psycopg2 had best be installed on server
   and tested before moving onto django production deployment.

   a. I found phppgadmin GUI interface essential in getting this
started.

   b. I created my a basic database 'mysite' using phpPGadmin and
added one
  simple table to prime the pump so to speak.

   c. 'mysite' database then was declared in the PROJECT settings.py
   ie...DATABASE_ENGINE = 'postgresql_psycopg2'
 DATABASE_NAME =   'mysite'

2. With that in place something the book and instructions fail to
emphasize
I ran  python manage.py syncdb
then
python manage.py sqlall myapp

NOTE: sqlall would not work prior to running syncdb

Now I've spent 2 weeks studying the documentation and followed the
book on this
and must say there are myriad gotchas so far. Also I'm working with
some Linux
gurus to help me get apache, mod_python and postgres all in order, it
has not been
easy.

One serious problem I had seems to be a typo in the documentation,
that suggests one use syntax like name =
models.CharField(maxlength=30)
which returned an error everytime I tried to run python manage.py
sqlall myapp.
When it should in fact be CharField(max_length=30), little things like
this have me
a little worried how many gotchas are going to be further down the
line.

The positive thing is after a day and half we do have a Redhat server
wired with Postgre,
Python and Django admin seems to be working, thanks in large part to
answers found on
this google group.


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



Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread NoviceSortOf

On Sep 17, 4:54 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote:
> Glad to hear you have some of your setup up and running.
>
> Your comment on defining fields in the models surprised me though.
> All the fields for your models in Django should start with model,
> followed by the field-type, as the documentation states.  Are you sure
> you have models module being imported?  The line 'from django.db
> import models' should be at the top of all your models.py files.
>
> R.

That seems to be in order, the problems though were the confusion over
the
max_length (current usage) maxlength (seemingly from and older ver. of
django)
parameters in models.py, and not having setup a 'mysite' database to
begin with prior to running "python manage.py sqlall"

Chapter 5 [...Databases] in the Definative Guide to Django, makes
quick
mention of using command line CREATE DATABASE but its an easy detail
to pass over. We found going to phpPGadmin GUI for preliminary
database
creation, and subsequent data inspection after a succesful run of
manage.py sqlall a big help.

With Redhat we are swimming a little upstream, as something like
Ubuntu may
of made things easier by having better installation mechanisms, that
better match the django documentation.  Our idea was well, we have
python,
and apache already loaded on our production server so why not go for
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to trigger html traceback and verbose django environmental variable list

2008-09-18 Thread NoviceSortOf


Does anybody know how to return the full debug list of settings and
django
related variables from something like www.mysite.com/mysite/admin
or www.mysite.com/mysite/

I did receive this comprehensive list traceback a couple of times that
listed
a comprehensive list of stuff like...

Request information
GET
No GET data
POST
No POST data
COOKIES
and so on
;;; METAVariableValue
AUTH_TYPE   None
CONTENT_LENGTH  0L
CONTENT_TYPE'httpd/unix-directory'
GATEWAY_INTERFACE   'CGI/1.1'
...

Paths and so on, very valuable in debuging a setup configuration, is
there a URL
to persistently trigger this?



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



get_template problem

2008-09-26 Thread NoviceSortOf


this works

>>>from django.template import loader
>>>loader.get_template('myfile.html')

but how do i get this syntax to work?

>>>get_template('myfile.html')

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



Re: get_template problem

2008-09-29 Thread NoviceSortOf


I've spent some time with the book recommend as well as other
tutorials on Python. My question here is directly related
to Chapter 7 of the Tutorial/Definative guide to Django,
which does not seem to provide a comprehensive list of imports
for the code for doing a data search it works the reader through.

The snag I hit and possibly other people hit,

Where the book says

from django.db.models import Q
from django.shortcuts import render_to_response
from mysite.books.models import Book

# The book omits

from django.template.loader import get_template

Now this can be an assumption that it is loaded
earlier. Yet working through the book I don't see
anywhere that is mentioned.

__So to rephrase my questions

* Does Django assume that certain modules are loaded?

* Does the tutorial assume certain modules are loaded?

And if so -- what modules are these and where is this stated?



On Sep 26, 5:07 pm, Håkan Waara <[EMAIL PROTECTED]> wrote:
> from django.template.loader importget_template
>
> I recommend learning some general python before you dive into django.  
> There are lots of great sites for this, for examplewww.diveintopython.org
>
> /H
>
> 26 sep 2008 kl. 15.44 skrev NoviceSortOf:
>
>
>
> > this works
>
> >>>> from django.template import loader
> >>>> loader.get_template('myfile.html')
>
> > but how do i get this syntax to work?
>
> >>>>get_template('myfile.html')
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django Admin - Does not see templates, images or templates.

2008-10-06 Thread NoviceSortOf

I'm using Linux Fedora, Apache and mod_python.

I have 3 dashboard.css candidates on my system but Django admin will
not see any of them...

-
# locate dashboard.css [RETURNS]

/var/www/Django-1.0/django/contrib/admin/media/css/dashboard.css

/usr/lib/python2.3/site-packages/django/contrib/admin/media/css/
dashboard.css

/var/www/django-trunk/django/contrib/admin/media/css/dashboard.css
-
So I adjust settings.py to say
ADMIN_MEDIA_PREFIX = '/var/www/django-trunk/django/contrib/admin/
media/'

When I log onto Administration, I get functional plain text screen,
and it seems clear templates and/or .css are not being seen.

After logging in with
View>Page Source source from the browser I see in the html
<
link rel="stylesheet"
type="text/css"
href="/var/www/django-trunk/django/contrib/admin/media/css/
dashboard.css"
/>

Why doesn't my admin html see the admin templates with the settings
above?

Why are there 3 Django dashboard.css files on our server?





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



Re: Django Admin - Does not see templates, images or templates.

2008-10-07 Thread NoviceSortOf


Thanks the link did the trick.

The admin page though still loads rough, sometimes
taking 3 screen refreshes to get past a
"No module named urls" error - then it finally loads.






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



Re: Django Admin - Does not see templates, images or templates.

2008-10-07 Thread NoviceSortOf


Yes I restarted, but I also noticed in urls.py

2 distinct suggested admin url patterns...

(r'^admin/', include('django.contrib.admin.urls')),
# (r'^admin/(.*)', admin.site.root),

Commenting out the second entry seems to correct
the admin_urls problem.

Why does the documentation suggest
 (r'^admin/(.*)', admin.site.root)?





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



Re: Django Admin - Does not see templates, images or templates.

2008-10-08 Thread NoviceSortOf

> What version of Django are you running?  These two patterns are from
> different Django versions.  The first, with the include of
> 'django.contrib.admin.urls' was the old one -- that file does not exist in
> Django 1.0.  The 2nd pattern, referring to 'admin.site.root', is what should 
> be used for Django 1.0.

>>>VERSION
returns
>>>1.0 Final

I'm am though concerned that there may be a duplicate installation
on this machine.

These 3 directories seem to contain many redundant files.

/var/www/Django-1.0/django/
/var/www/django-trunk/django/

/usr/lib/python2.3/site-packages/django/

How do I determine if one of these directories
contains a duplicate installation and which
one is the latest?





> If you are actually running 1.0 the old pattern would have produced a "No
> module named urls" error since django/contrib/admin/urls.py no longer
> exists.  So I am confused as to how commenting out the 2nd version, which is
> the one that is correct for 1.0, would have fixed that problem.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Hosting Survey

2008-10-08 Thread NoviceSortOf

(ROSS) you say  256 RAM but I'm curious if you are
running Ubuntu server or some other distro?

Is 256 RAM sufficient for Ubuntu or should
one allow for more headroom?

I'm leaning towards the Slicehost or Lincode type solution.
Because in the past with frameworks and platforms we have
learned the hard way you need to be ready to move and move
fast whenever your hosting service (for whatever reason)
changes the rules of the game,  or you hit a limitation.
Being able to rachet up the memory to the next level can
save a lot of headaches, and sometimes can prove an
instant cure, to problems that would otherwise require
re-coding or re-configuration.

Also it seems an easy matter these days to take a second
hand HD off the stack and mock up a production server
on an old machine then to duplicate that on something
like Slicehost or Linode . Ubuntu server seems the best
candidate for this.

I'm reluctant to work with djangohosting.ch and
the entry Webfaction plans because we have had
problems with how subleased space works with
virtual hosting.

For instance

  .mysite.com
  may not equal

  mysite.com and/or the sites IP number
  may not take you to the site.

This gets important when you are setting up rollover scenarios, using
3rd party monitoring/dns services... at least that is where we have
had
snags, but I can imagine there other issues.

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



Re: Django Admin - Does not see templates, images or templates.

2008-10-08 Thread NoviceSortOf

> Of the other two, one claims to be Django 1.0 and one claims to be
> Django SVN trunk.  Assuming they are what they claim to be, which one
> is the latest depends on whether the trunk checkout is from before or
> after 1.0.  You might get a clue by looking at django/__init__.py in
> both and checking the value of VERSION.

Thanks Carl and Karen:

All the duplicates were 1.0 final.

* I removed all django directories except - /usr/lib/python2.3/site-
packages/django/

* Inspecting active  __init__.py file I verify Version 1.0. Final.

* In the .../django directory I see a broken link called
  "django" pointing to "pwd/django-trunk/django"
  I rename it to get it out of the way.

* Editing my urls.py I comment out the old admin line and uncomment
the new.
#(r'^admin/', include('django.contrib.admin.urls')),
  (r'^admin/(.*)', admin.site.root),

* My first 4 attempts to go to www.mysite.com/admin/ return
  TemplateSyntaxError at /admin/
  Caught an exception while rendering: No module named urls

* The debug page points to
  .../django/contrib/admin/templates/admin/base.html, error at line 25
line 25 has  {% url django-admindocs-docroot as docsroot %}
highlighted in red.
   same behavior with both IE or Firefox/Mozilla.




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



Registration - adding first_name and last_name to form.

2008-10-10 Thread NoviceSortOf


I'm trying to add first_name and last_name to the registration form.

Under class RegistrationForm(forms.Form)

I add

   first_name = forms.RegexField(regex=r'^\w+$',
max_length=30,
 
widget=forms.TextInput(attrs=attrs_dict),
label=_(u'First Name'))
...same for last name

Then I attempt to add under the save function,
to add first_name and last_name

def save(self, profile_callback=None):
new_user =
RegistrationProfile.objects.create_inactive_user(username=self.cleaned_data['username'],
 
password=self.cleaned_data['password1'],
 
first_name=self.cleaned_data['first_name'],
 
last_name=self.cleaned_data['last_name'],
 
email=self.cleaned_data['email'],
 
profile_callback=profile_callback)

This though returns an error,

I try a couple of other syntactical permutations of last_name and
first_name with
out much luck. I can get first and last name to appear in the form,
but can't get
them to save.

What steps am I missing?






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



Re: Registration - adding first_name and last_name to form.

2008-10-11 Thread NoviceSortOf

These lines in forms.py
---
92.  new_user =
RegistrationProfile.objects.create_inactive_user(username=self.cleaned_data['username'],
  93. password=self.cleaned_data['password1'],
  94. first_name=self.cleaned_data['first_name'],
  95. last_name=self.cleaned_data['last_name'],
  96. email=self.cleaned_data['email'],
  97. profile_callback=profile_callback)

Return this error

create_inactive_user() got an unexpected keyword argument 'first_name'

Note: first_name and last_name fields already exist in auth_user
  they are original fields along with username and password,
  it seems it would easy to add them to the form and save them.


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



AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf


In my settings file I've set AUTH_PROFILE_MODULE =
"myproject.myprofiles"

Looking at my database, I've something called
"registration_registrationprofile"

I've defined myproject.myprofiles in models.py and the file clearly
exists.

Instead though "registration_registrationprofile" is the file that
continues to be acted on.

Since "registration_registrationprofile" is populating beautifully
over hundreds of records,
I'd like to use that file and expand it with more fields for
customized profile use.

So my problem is twofold.

* Where is  the model file for "registration_registrationprofile" ?
  _If I go to ...site-packages/registration where I would assume the
models.py
   file would contain the definition for this data it does not exist
there.

* While does  "registration_registrationprofile" populate when
"myproject.myprofiles" is
  set in settings.py as AUTH_PROFILE_MODULE ?





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf


I'm rewording my question for clarification.

* Where is  the model file for "registration_registrationprofile" ?

  _If I go to ...site-packages/registration where I would assume the
models.py file would contain the definition for this table,
it does not exist there.

* Why does the "registration_registrationprofile" table populate when
"myproject.myprofiles" is set in settings.py as AUTH_PROFILE_MODULE ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf


OK. Please correct me if I'm wrong

The  "registration_registrationprofile"  is simply a reference table
created during
the process of creating an inactive account.

* If that is the case then how do I simply create a related record to
users in
 "myproject.myprofiles"  as set in settings.py as
AUTH_PROFILE_MODULE ?

* I want to create my own profiles routine based on the data I've
already defined in
   "myproject.myprofiles"  what is the simplest way to do that?

Please advise
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf

> It isn't at all clear to me from what you have posted what difficulty you
> are having in using your own auth profile module.  I do not understand why
> the presence of the django-registration table would be causing any trouble.
> At any rate, since you are already using django-registration, you may want
> to consider also using django-profiles, there is a link to that project on
> the page I linked to above.

I've loaded django-profiles and can't manage to get it to work after
many hours
of attempts, and after much thought of the small scale of our user/
profile database
and the limited scope of our website would prefer to simply the
process by
bringing more control of the profiles into our own coding.

So my idea at this point was if the AUTH_PROFILE_MODULE
declares a constant object that has built in functions for it, then I
just wanted
to build my own profile, views and model and take it from there. I'm
not building a
large site by any stretch of the imagination, in fact most of the
activation,
profile maintenance and so on we do manually, including account
activation
and can do direct on the data via phpAdmin, via data importation
or some other interface.

With registration working, all we need from Django is a simple hook to
initiate
the AUTH_PROFILE_MODULE via the related field/row of user during
registration,
so we can then build our own models, forms and views for our user
profiles.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: AUTH_PROFILE_MODULE setting does not relate at all to actual reg file being populated

2009-01-19 Thread NoviceSortOf

> I'm feeling a bit dense here.  What is it, exactly, that isn't working?
> What have you done, what did you expect, and what happens instead?
> AUTH_PROFILE_MODULE isn't fundamentally broken, so some specifics on what
> isn't working for you would help someone to help you fix whatever it is that
> isn't working.  But from all you've written I still have no idea what that
> is.

Karen:

Thanks for your patience, at least I'm driving and drilling towards a
clearer definition of the question.

I'll try getting more specific.

We can't determine how to populate the table specified in
AUTH_PROFILE_MODULE
with the user row during the registration process.

Inside of registration.models.py there is a class defined called
RegistrationManager with the methods create_inactive_user and
create_profile. Create_inactive user does what one would think that it
would.
The code in create_inactive_user explicit in telling you it is saving
the fields self, username, password & email.

create_profile on the otherhand although its method name is analogous
seems simply to
create an activation key, and there is way to determining how and
where it is actually saving
the profile.

it is also unclear from the code in comments in model.py where and how
AUTH_PROFILE_MODULE
is being handled. from our experience the object AUTH_PROFILE_MODULE
is not being writen
to at all.

Now it seems that if AUTH_PROFILE_MODULE is being defined as a
constant object then somehow
in Django there would be a way to open and save to it, during the
registration process.

We also can't find figure out how  the registration process writes the
temporary file with registration
information but does not write anything to the AUTH_PROFILE_MODULE
object as in our
myproject.mysite.models.py file and in  myproject.mysite.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: AUTH_PROFILE_MODULE confusion

2009-01-20 Thread NoviceSortOf


Thanks creecode:

I've read those docs in the past, but they do help in further
refreshing my memory,
and further refining the question.

* django-registration is installed and works great, the only problem I
have
  is that somehow I need to populate the profiles table defined as
  AUTH_PROFILE_MODULE in settings.py
  and in mysite.myproject.models.py.

  The temporary registration table is being populated for every
registration,
  along with the user authorization tables, but the table defined in
  AUTH_PROFILE_MODULE  is not.

* i'd suspect that somewhere in models.py there would be a hook for
this,
  there is reference to something called profile_callback that seems
like it
  might be clue to this but I can't figure it out from the docs and
code
  I've read so far.

* i'm very uncertain at this point if i want to use django-profiles
for this,
  but would prefer for now to just get a hook into the "profiles"
table i've
  assigned to AUTH_PROFILE_MODULE.

any help would be 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
-~--~~~~--~~--~--~---



Re: AUTH_PROFILE_MODULE confusion

2009-01-20 Thread NoviceSortOf


* Objective create and save a row/record to the table defined as
AUTH_PROFILE_MODULE
  via the instructions in models.py

I'll demonstrate what I've tried to do so far, all which seemed
logical
but had no effect other than adding a row to auth.user and
registration.registrationprofile. my custom profile still did not
append.

Strategy 1
**
in models.py  i defined and called the following method as

def profile_callback(user):
new_user_profile = UserProfile.objects.create(user=user, status="1")
new_user_profile.save()
# Result - No error but no adding to table was found
***

Strategy 2

in models.py
from from mysite.myproject models import MyprojectProfile

# then in create_inactive_user i added these lines

new_custom_profile = MysiteProfile.objects.create(user=user)
new_custom_profile.save()

# Result - returned error on create MysiteProfile is not global
object
***

Strategy 3

in models.py

# underneath the line
registration_profile = self.create_profile(new_user)
# i added
registration_profile.save()
# result


All I want to do is add "user" field to my custom profile
as defined in Mysite.Myproject with django-registration,
yet from reading the code and trying examples from
this forum and attempting to code based on the existing
logic, can't seem to make this happen.

Any suggestions,  pointers, or clues to a solution would be
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
-~--~~~~--~~--~--~---



Re: AUTH_PROFILE_MODULE confusion

2009-01-21 Thread NoviceSortOf


creecode:

we cross posted yesterday. i tried your suggestion about using signal
but
could not get it to add records to the designated user profile.

for now i've reinstalled registration upgrading to .06 as well as the
matching
userprofile profiles .06

Still am encountering hours of problems getting it to work but will
post
those issues in another topic, for now. I 'm hoping by standardizing
on django-registration and django-profiles can perhaps get this to
work.



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



Ongoing problems with django-registration installation.

2009-01-21 Thread NoviceSortOf


Initially my problem was getting django-registration to add/update new
users to my
custom designed mysite.UserProfile table.

Other than that django-registration worked o.k. sent notifications and
so on,
but without it giving me control of our custom user profile it was
impossible to
move forward.

I'm my discussions here though in this discussion group, it appears
that the my questions might be better answered if I used the profiles
component that registration was built to work with, so the questions
and answers would have more of a standard context.

* Today I updated django-registration to .06 and also installed its
userprofiles .06 cousin.

* Modifications to mysite.myproject.models.py and mysite.settings were
made
  closer to online examples to make my installation more standard for
the sake
  of discussion.


*** I though have the following problems.

* after running manage.py the new table that should be created from
  from the userprofile.models imported from BaseProfile does not
  appear in my phpPgAdmin (postgreSQL) browser even after
  refresh and reboot of the server.

* when attempting a registration i get the following error
  global name 'alnum_re' is not defined

  so i go to registration.views.py and
  rem out that...
  #from django.core.validators import alnum_re

  and add:

  import
  alnum_re = re.compile(r'^\w+$') # regexp. from jamesodo in #django

* now when I attempt registration i get
  Request URL:  http://www.rareasianbooks.com/accounts/register/
  invalid syntax (views.py, line 87)
  Exception Location:   /usr/lib/python2.3/site-packages/userprofile/
urls/en.py in ?, line 3


Any suggestions would be 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
-~--~~~~--~~--~--~---



Re: Ongoing problems with django-registration installation.

2009-01-21 Thread NoviceSortOf


update to the above -  running manage.py syncdb DID
create the mysite.myproject.userprofile
with all the userprofile.models base fields included.

on completion of the registration form though i still get The
following error

* Request URL:  http://www.rareasianbooks.com/accounts/register/
  invalid syntax (views.py, line 87)
  Exception Location:   /usr/lib/python2.3/site-packages/userprofile/
urls/en.py in ?, line 3


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

2009-01-21 Thread NoviceSortOf

> 0.7 is where full Django 1.0 compatibility was included.  I'm assuming you
> are using Django 1.0 or higher?  The error related to 'alnum_re' you mention
> later looks to be the result of django-registration using a core validator
> thingy -- these were all removed prior to Django 1.0, so if you got an error
> on that then it sounds like you are running a later version of Django than
> is supported by the version of django-registration you installed.  Rather
> than trying to patch the registration code you have (which is what has led
> to the syntax error you report), upgrade to a django-registration version
> (0.7 or current code) that supports the level of Django you are running.

Karen:

I'm running django version 1.0 final SVN
I upgraded to Django registration 0.7 just now.
Thanks, that certainly sorts out the  'alnum_re' problem

Now the remaining problem is after filling the form I get is


SyntaxError at /accounts/register/
invalid syntax (views.py, line 87)
Request Method: POST
Request URL:http://www.rareasianbooks.com/accounts/register/
Exception Type: SyntaxError
invalid syntax (views.py, line 87)
Exception Location: /usr/lib/python2.3/site-packages/userprofile/urls/
en.py in ?, line 3
*
verbose paste of debug results can be seen here  http://dpaste.com/111499/

I looked at ...registration.views.py but line 87 there is a commented
area so it
must be talking about another view.py file.

Where should I look next?


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

2009-01-21 Thread NoviceSortOf


Karen:

Thanks again, you are right I had the userprofile installed instead of
django-profiles
installed.

I went to the bitbucket django-registration link you mentioned before
and downloaded the django-profiles linked there and installed it.
I made a small modification to mysite.myproject.models to reconcile
the data definitions.

Registration is sort of working
_email notifications get sent
_user tables get appended to

but

_the program still chokes returning the following errors in the
browser.


ImportError at /accounts/register/   No module named urls
Request URL:http://.../accounts/register/
Exception Type: ImportError
Exception Location: /usr/lib/python2.3/site-packages/django/core/
urlresolvers.py in _get_urlconf_module, line 197

Detail http://dpaste.com/111548/

Now my question is twofold and proactive.

1. Import error says No module named urls
   _how do i determine exactly which set of urls it's trying to call,
i can see its line 197 in _get_urlconf_module but can't seem to
get a grip on exactly what line of code with exactly what
paramters
are calling this.

2. any other insights in how to correct this 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
-~--~~~~--~~--~--~---



Re: Ongoing problems with django-registration installation.

2009-01-22 Thread NoviceSortOf


Django 1.0/django-registration .07 problems continue

***
Issue 1 - No module named urls occuring during registration form
completion.


Via the methodology listed by Karen above I was able to trace my
missing url error.

The only way I could correct the error in registration was to hardcode
modify
line 142 in ...site-packages.registration.views.py to point to
"complete"

For now though this is what it took to get it working.
 ( r'^accounts/', include ( 'registration.urls' ) ),
is in my url.py file but somehow this "complete" link is not part of
that set.

No worries,  I want to draw close to my main goal.


Issue 2. * Objective, how to add records to my custom UserProfile
table?

I've read the django-registration docs numerous times and still can't
figure out how it is supposed to work.

So I attempted adding my own code to create_inactive_user in
registration.models.py

# Original code
 def create_inactive_user(self, username, password, email,
 send_email=True):
...
   from registration.signals import user_registered

new_user = User.objects.create_user(username, email, password)
new_user.is_active = False
new_user.save()

registration_profile = self.create_profile(new_user)

# My code to add records to the custom mysite.myproject.userprofile
table

get_user_id  = int(registration_profile.id) # returning long
integer like 140L must be converted to int
from mysite.myproject.models import UserProfile
p1 = UserProfile( user_id = get_user_id )
p1.save()

*

Results = No errors, but no records added via the process to auth_user
or my own
UserProfile table either.

To quote the django-registration documentation .07 docs

"a mechanism for automatically creating an instance of a
 site-specific profile model is provided via
the ``create_inactive_user`` on ``RegistrationManager``.

Can someone tell me where is that automatic mechanism?


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

2009-01-22 Thread NoviceSortOf


creecode:

I've tried your 2 suggestions with one with no results, and the second
suggestion perhaps i
did not understand enough of where the code should go to make it work.


** Trigger adding instance to userprofile via passing profile_callback
in url.py

Tried this solution in both ...registration.url.py and
myproject.url.py but had syntax errors.

* 'profile_callback' as added to url.
ie.
url ( r'^accounts/register/$',
'registration.views.register',
{ 'profile_callback': UserProfile.objects.create },
name = 'registration_register' ),
( r'^accounts/', include ( 'registration.urls' ) ),

This provided numerous syntax errors, I tried it in both
mysite.myproject.url.py
and in the ...registration.url.py but to no avail. I tried it with 2
versions of registration, in the end though it seems ver .07 no
longer
uses this method.
**

2nd Suggestion sounds elegant and since I'm using django 1
this method may work but I'm not sure where you mean to
put the code.

I would assume this code would be in mysite.myproject.models.py

class UserProfile.

def add_user_profile ( sender, instance, created, **kwargs ):

if created:

user_profile = UserProfile ( user = instance )

user_profile.save ( )

# Now this last line here confuses me is this supposed to go in
  registration.model.py  or ...myproject.model.py

models.signals.post_save.connect ( add_user_profile, sender = User )

whatever the case i've tried it in both and get nothing from
myproject.model.py
and when calling it from  registration.model.py  it returns an error
like
add_user_profile is not a global object.

Please advise

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

2009-01-22 Thread NoviceSortOf


Although unmentioned in the django-registration docs, reading the
django-profiles code I see
a method called create_profile...which is intended for this purpose,
for now I'll try giving
that a try.

def create_profile(request, form_class=None, success_url=None,
   template_name='profiles/create_profile.html',
   extra_context=None):
"""
Create a profile for the current user, if one doesn't already
exist...


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

2009-01-22 Thread NoviceSortOf


It seems to me the that automatic mechanism mentioned in the docs
does not exist in django-registration but in its component
django-profiles, reading the source code I see this...

def create_profile(request, form_class=None, success_url=None,
   template_name='profiles/create_profile.html',
   extra_context=None):
"""
Create a profile for the current user, if one doesn't already
exist.

Now my problem is how to import the profile urls.py urls...

Looking at mysite.myproject.urls I have...

urlpatterns += patterns('',
(r'^accounts/', include('registration.urls')),
(r'^profiles/', include('profiles.urls')),
)

But seem to be missing some of the links that should be supplied by
them.

I seem to be missing all of the django-profiles.urls

The only links available are...

Using the URLconf defined in mysite.urls, Django tried these URL
patterns, in this order:
# ^accounts/ ^activate/(?P\w+)/$
# ^accounts/ ^login/$
# ^accounts/ ^logout/$
# ^accounts/ ^password/change/$
# ^accounts/ ^password/change/done/$
# ^accounts/ ^password/reset/$
# ^accounts/ ^password/reset/confirm/(?P[0-9A-Za-z]+)-(?
P.+)/$
# ^accounts/ ^password/reset/complete/$
# ^accounts/ ^password/reset/done/$
# ^accounts/ ^register/$
# ^accounts/ ^register/complete/$
# ^profiles/

The needed profiles urls do not appear even though called in urls.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
-~--~~~~--~~--~--~---



problems getting urls to import

2009-01-22 Thread NoviceSortOf

Looking at mysite.myproject.urls I have...

urlpatterns += patterns('', (r'^profiles/', include
('profiles.urls')), )

But can't get the profiles.urls to import

My URLconf list includes

# ^accounts/ ^activate/(?P\w+)/$
# ^accounts/ ^login/$
# ^accounts/ ^logout/$
# ^accounts/ ^register/$
# ^accounts/ ^register/complete/$
...(and so on, but for profiles only shows
# ^profiles/

Please advise

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



Anyway to see full UrlConf list of available imported urls?

2009-01-22 Thread NoviceSortOf


* Is there a way to see a full URLConf list of all the imported URLs,
in
  an application?

This seems it would be a big debuging help.


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



Re: AUTH_PROFILE_MODULE confusion

2009-01-23 Thread NoviceSortOf


SEE ALSO : a core method in django get_profile()
   django/contrib/auth/models.py

and as used in profiles/views.py

profile_obj = request.user.get_profile()



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Anyway to see full UrlConf list of available imported urls?

2009-01-28 Thread NoviceSortOf


I can't get this code to work perhaps I'm not importing something
but here is what I'm doing.

from mysite root dir

import settings
import urls
from django.core.urlresolvers import get_resolver

# i then do a little checking
print r

dir(r) # verifies _get_url_patterns is in r module
['class',...'_get_url_patterns',...]

# then when i issue this
for pattern in r._get_url_patterns(): print pattern

# the interpreter returns
AttributeError: 'module' object has no attribute 'urlpatterns'

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Anyway to see full UrlConf list of available imported urls?

2009-01-28 Thread NoviceSortOf


in the end i found django-command-extensions ESSENTIAL
and INDISPENSIBLE in tracking and getting my head around
URLConf.

this extends django manage.py with a function called show_urls

after you have installed django-command-extensions, all you
have to do is type

python manage.py show_urls

to get a complete 2 column listing of urls and the views they
reference.

http://code.google.com/p/django-command-extensions/

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



Re: How do I correctly format a Querydict derived list in a url?

2009-01-31 Thread NoviceSortOf

> > > myurl.com/activities/[u'ireland',
> > > u'nireland']/: what I really want
> > > is:
>
> > > /activities/ireland-nireland/
>


I'm not sure if any of this is the 'correct' way but it likely
will work.

Try a combination of python's eval() and str()
function to convert/maninuplate the location_filter
object into a string and format into the string you want.

As well it seems you should be able to pull the elements out
of the location_filter using something like location_filter[1]
and location_filter[2] and then format the string to your
requirements.

Also note there is a django function smart_str() that might
help with working with the unicode formating.

I've not tested this exactly but something like this, in
theory

from django.utils.encoding import smart_str
location_filterAscii = smart_str(location_filter,encoding='utf-8')

Or you can simply do something like mystring.replace("u,","") and
other
python string manipulators to get the string like you want it.

Otherwise it seems this is python string manipulation stuff
you can workout on the command line, using str() and/or eval(),
and .replace.


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



Send_mail usage on development server.

2009-02-23 Thread NoviceSortOf

Note: Ubuntu Hardy development server.

I've having problems getting Send_mail to work on my development
server.
It works fine on the production server but when I attempt to send on
the development server I get the following error.

*   /usr/lib/python2.5/smtplib.py in connect, line 296
 - 2 service not known

Whats confusing for me *

* Is  Django is expecting me to have a SMTP server on my development
server?
 or
* Can I via settings.py make these email send requests go through my
production server.
 or
* Is there anyway to make a dummy send_mail simply save the contents
of the messages
  locally to record what information is going into the forms somehow,
as I'm not sure if  n
 need SMTP on my development server or not.

Please advise


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

2009-02-24 Thread NoviceSortOf


Thanks for these solutions, I didn't realize Email-host could be used
for any external email server, although unwittingly I may
of tried it earlier and had authentication problems.

The python dummy email server solution you point to...
"python -m smtpd -n -c DebuggingServer localhost:1025" also looks like
very good way to go.

In the meantime, though I installed postfix, and mailx configured
simple to 'Local' mode, then placed an  if settings.EMAIL_HOST ==
"localhost" condition before send_mail() to allow for
someb...@localhost type address.

This method collects all the test mail locally accessible via command
line mail or by opening the stored mail file.

ie. registration.models

 if settings.EMAIL_HOST == 'localhost' :
outaddress = '[localuserna...@localhost'
else:
outaddress = new_user.email

send_mail(subject, message,   settings.DEFAULT_FROM_EMAIL,
[outaddress])

the mail then can be easily seen at /var/mail/[localuser]

The best way though is likely using the external EMAIL_HOST,
I'll give that another try later.



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



Managing over 100 static booleanfield fields Model, Form Class and so on. Profiles process

2009-02-25 Thread NoviceSortOf

We have over 100 Yes/No questions asked in our registration process
These questions are mostly static (requiring minor modification every
5-10 years),
we don't especially need a dynamic data driven solution.

These Yes/No questions are basically the user informing us of their
specific
interests IE. Archeology [ ], Poetry [ ], Art [ ] and so on.

In our legacy client-side application (we are coming from a mailorder
business started
in the 60s) we store these selections in an abbreviated comma
delimited character field ie
Interests = "Arc,Art,Lit". Using a comma-delimited char field in this
situation provides elegance on the data side, but of course we have to
parse the field coming and going in order to make it usable also
linking it to table that provides more human readable labels for the
abbreviations.

I'm considering simply adding the 190 odd boolean fields to accomplish
this in profiles.models and the subsequent class needed in
profiles.views to add presentable labels --- but am wondering if more
of a data driven method may exist somewhere to
accomplish this, perhaps using a comma delimited char field?

Or how are such large amounts of yes/no boolean questions made
manageable in Django?

Any suggestion 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
-~--~~~~--~~--~--~---



Re: Managing over 100 static booleanfield fields Model, Form Class and so on. Profiles process

2009-02-25 Thread NoviceSortOf


This is what we have been doing for over 10 years now via the
internet, and over 20 years via mail and telephone... its a management
requirement that will not change. The questions are broken into
sections easy to navigate on the page, the 'questions' in this
instance is simply having them check box their particular interests
which appear grouped to category. I'm curious if Django innately has a
way of dealing with such scenarios.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Managing over 100 static booleanfield fields Model, Form Class and so on. Profiles process

2009-02-25 Thread NoviceSortOf

Briel, I see the userfriendlyness or even consideration in what
you are saying, looking at the specs, actually users
checkboxing us their interests is an optional part of
registration process, we still we need to do it somehow.

Gordy, I see the logic in what you are saying, although unclear
on how to get the class Interest into a form, listing all of
the rows as Boolean checkboxes, any hints on this 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
-~--~~~~--~~--~--~---



Different Database object behavior on Production and Development servers.

2009-03-09 Thread NoviceSortOf


On the command line I'm unable to get a coherent return on my data
object filters or fetches,

Instead of getting any detail I get a dictionary with nothing but the
words UserProfile,
UserProfile object where Field name and value should be.

ie.

>>>g = UserProfile.objects.filter(email = "dljonsson2...@gmail.com")
 [, ]

instead of something like

>>>g = UserProfile.objects.filter(email = "dljonsson2...@gmail.com")
[username : DLJ99, email : "dljonsson2...@gmail.com]

other tables as well in the database have the same behavior, others do
not.

my production server does not seem to have a problem with this, but
development server does. i've double checked model and postgres sql
server stuctures.

Any clues why my development server fetches and filters will not
return coherent
data?




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Different Database object behavior on Production and Development servers.

2009-03-09 Thread NoviceSortOf


Ramiro: You put me onto something, the only model that returns
coherent data on the command line has str defined for model

ie.
class Book(models.Model):

title = models.CharField(max_length=100)

authors = models.ManyToManyField(Author)

publisher = models.ForeignKey(Publisher)

def __str__(self):

return '%s %s' % (self.author,self.title)

The other model classes do not have such a method assigned.

I'll double check production server and development server both
but it seems the __str__ method or unicode method you mentioned
(or lack of) could very well be the problem.

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: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf


It's clear now that __str__(self) or __unicode__
return a usable string to the view.

But this does not on the surface appear to be a
workable instance of the model itself,
that would return fields that I can work with in the template...and/or
i haven't figured how to get a handle on it.

ie...
to list titles by Stevenson and checkbox titles to be borrowed.
...which in the browser I'd hope would present something like
___
...
[ ] Stevenson Collected Works
[ ] Stevenson Treasure Island
[ ] Stevenson Wild West Stories
...
[Submit]

here is the code i'm trying...
__
# models.py
class Titles(models.Model):

author = models.CharField(max_length=100)

title  = models.CharField(max_length=254)

select = models.BooleanField()

def __unicode__(self):
return u'%s = %s' % (self.author, self.title)

# views.py
def checkout_book_view(request)
from books.models import Titles

titles_list =Titles.objects.filter(author="Stevenson")

template_Name='checkoutbook.htm'
template_Context = Context( { 'titles_list': titles_list })

   return render_to_response(template_Name,template_Context)

# then in template checkoutbook.html list as
{% for titles_list in titles_list %}
{{ title.select }}
{{ title.author }}
{{ title.title  }}
{% endfor %}

with unicode though all i'm able to get is the single string defined
by def ___unicode___ and no check box. i'm suprised
that the query set or list is not able to store more fields.




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf


It's clear now that __str__(self) or __unicode__
return a usable string to the view.

But this does not on the surface appear to be a
workable instance of the model itself,
that would return fields that I can work with in the template...and/or
i haven't figured how to get a handle on it.

ie...
to list titles by Stevenson and checkbox titles to be borrowed.
...which in the browser I'd hope would present something like
___
...
[ ] Stevenson Collected Works
[ ] Stevenson Treasure Island
[ ] Stevenson Wild West Stories
...
[Submit]

here is the code i'm trying...
__
# models.py
class Titles(models.Model):

author = models.CharField(max_length=100)

title  = models.CharField(max_length=254)

select = models.BooleanField()

def __unicode__(self):
return u'%s = %s' % (self.author, self.title)

# views.py
def checkout_book_view(request)
from books.models import Titles

titles_list =Titles.objects.filter(author="Stevenson")

template_Name='checkoutbook.htm'
template_Context = Context( { 'titles_list': titles_list })

   return render_to_response(template_Name,template_Context)

# then in template checkoutbook.html list as
{% for titles_list in titles_list %}
{{ title.select }}
{{ title.author }}
{{ title.title  }}
{% endfor %}

with unicode though all i'm able to get is the single string defined
by def ___unicode___ and no check box. i'm suprised
that the query set or list is not able to store more fields.




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf

Thanks Malcom,

I re-read the links you sent along on forms and formsets.

I'm now working with a form but instead of
___
> > [ ] Stevenson Collected Works
> > [ ] Stevenson Treasure Island
> > [ ] Stevenson Wild West Stories
> > [Submit]

I get  a blank instance of the model reflected in the browser. rather
than a list of books...ie
___
Author : []
Title  : []
Select : [ ]
[Submit]

I've tried working with formsets but
{% for field in forms %}
returns blanks

and when I try changing it to
{% for field in formsets %}
i get an error message saying formset is not iterable

What am I missing?

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



Getting form and formsets to work with templates

2009-03-10 Thread NoviceSortOf


Glad to report taking a closer look at the code and documentation and
a few minor edits of the code --now both single model instance and
formset iterable html display are working.

I did notice when looping with formset my html syntax had to be
changed from "field" to "form" and from "form" to "formset.forms"
ie. with Formsets {% for form in formset.forms %}
with Form {% for field in form %}

The remaining problem I have is getting formset.author and
formset.title not to appear as editable fields

ie.
{{ form.select }}{{ form.author }}{{ form.title }}
returns the checkbox as defined in view.py but
author and title appear in editable character fields like...
 [ ] [Stevenson  ] [Collected Works]

How can I simply display the values of the fields and not make them
editable?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf

> and when I try changing it to
> {% for field in formsets %}
> i get an error message saying formset is not iterable

I was able to get closer the results I want by simply
changing the html template from

> {% for field in forms %}
to
{% for form in formset.forms %}
{{ form.selected }}{{ form.author }}{{ form.title }} 
{% endfor %}

Now though the Author and Title field appear as editable,
is there anyway of getting these values to simply appear
as text or as some other kind of read only display?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Different Database object behavior on Production and Development servers.

2009-03-10 Thread NoviceSortOf

Alex:

I tried another custom widget method earlier today
without any effect, then I tried yours as outlined in
your blog, there are no errors but there is no change
in how the field is displayed.

It makes me wonder if there is another step involved (CSS?) with this,
or if there is something I must do on the template
to get the custom widget method to work?

Any pointers 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
-~--~~~~--~~--~--~---



Do fields in html templates have to be displayed in {% for loops?

2009-03-12 Thread NoviceSortOf


In my html template i have something like

{% for field in form %}
{{ field.label_tag }}
{{ field }}
{% endfor %}

Which loops and displays the field name and field value in the form.

On smaller forms, I would prefer to do this manually
 w/o the loop by saying something like.
...
{{ form.id_first_name.label_tag }} {{ field }}
{{ form.id_last_name.label_tag }}  {{ field }}
...

I would like to able to do this so I can have HTML control over
placement
of the fields on the page.

I've tried various methods either
I don't have the queryset syntax right or perhaps it isn't possible to
display
label_tags and value outside of looping through the queryset?

Please advise

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



Do fields in html templates have to be displayed in {% for loops?

2009-03-12 Thread NoviceSortOf


In my html template i have something like

{% for field in form %}
{{ field.label_tag }}
{{ field }}
{% endfor %}

Which loops and displays the field name and field value in the form.

On smaller forms, I would prefer to do this manually
 w/o the loop by saying something like.
...
{{ form.id_first_name.label_tag }} {{ field }}
{{ form.id_last_name.label_tag }}  {{ field }}
...

I would like to able to do this so I can have HTML control over
placement
of the fields on the page.

I've tried various methods either
I don't have the queryset syntax right or perhaps it isn't possible to
display
label_tags and value outside of looping through the queryset?

Please advise

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



Do fields in html templates have to be displayed in {% for loops?

2009-03-12 Thread NoviceSortOf


In my html template i have something like

{% for field in form %}
{{ field.label_tag }}
{{ field }}
{% endfor %}

Which loops and displays the field name and field value in the form.

On smaller forms, I would prefer to do this manually
 w/o the loop by saying something like.
...
{{ form.id_first_name.label_tag }} {{ field }}
{{ form.id_last_name.label_tag }}  {{ field }}
...

I would like to able to do this so I can have HTML control over
placement
of the fields on the page.

I've tried various methods either
I don't have the queryset syntax right or perhaps it isn't possible to
display
label_tags and value outside of looping through the queryset?

Please advise

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



Do fields in html templates have to be displayed in {% for loops?

2009-03-12 Thread NoviceSortOf


In my html template i have something like

{% for field in form %}
{{ field.label_tag }}
{{ field }}
{% endfor %}

Which loops and displays the field name and field value in the form.

On smaller forms, I would prefer to do this manually
 w/o the loop by saying something like.
...
{{ form.id_first_name.label_tag }} {{ field }}
{{ form.id_last_name.label_tag }}  {{ field }}
...

I would like to able to do this so I can have HTML control over
placement
of the fields on the page.

I've tried various methods either
I don't have the queryset syntax right or perhaps it isn't possible to
display
label_tags and value outside of looping through the queryset?

Please advise

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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 say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread NoviceSortOf


I just want to say Hello Mary in my HTML code pulling Mary's username
from the request.data.

I've dug through the documentation and through this group, but am
still baffled by
what seems the inability of Django to allow someone to display a value
in some format
other than an input variable of a form.

For instance if the users name is "Mary", and Mary has logged in...

in view.py then
...
thisusername = request.user.username
data = {'thisusername':username,}
form = form_class(data)


now in the hello.html how do you say Hello Mary?

when I try {{ form.thisusername }}   - i get an input field

when i try coding html like


- i get a writable input field

when i try 

- i get a blank input / no value field

How does Django enable the ability to pass variables to a Form or a
Template whose purpose is only to be displayed?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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 say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread NoviceSortOf


I just want to say Hello Mary in my HTML code pulling Mary's username
from the request.data.

I've dug through the documentation and through this group, but am
still baffled by
what seems the inability of Django to allow someone to display a value
in some format
other than an input variable of a form.

For instance if the users name is "Mary", and Mary has logged in...

in view.py then
...
thisusername = request.user.username
data = {'thisusername':username,}
form = form_class(data)


now in the hello.html how do you say Hello Mary?

when I try {{ form.thisusername }}   - i get an input field

when i try coding html like


- i get a writable input field

when i try 

- i get a blank input / no value field

How does Django enable the ability to pass variables to a Form or a
Template whose purpose is only to be displayed?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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 say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread NoviceSortOf

Thanks for your responses, they have helped.

I've read the documentation many times, and only resort to groups
after re-reading what I can find in the docs, testing various logical
solutions, digging through groups and finally confering with a 3rd
party book I've here on Django. If all else fails,
then I post to groups.

So that is why I'm puzzled when {{ var }} does not present var on my
form.

As mentioned above in views.py I'm passing data to the form_class in
this example I'm using str to convert value to string.

in view.py then
...
thisusername = str(request.user.username)
data = {'thisusername':username,}
form = form_class(data)

Now it seems form_class() would be adding the data to
itself with form_class(data) but it isn't.

Instead I have to add the context to the render_to_response
despite the fact that this data has been added to form
earlier.

ie.
return render_to_response(template_name, { 'form': form},
  context_instance=context)

will either not display the item, or force it to be viewed
only as a corresponding writable field as defined in forms.py
or model.py.

but loading it directly to render_to_response works...

return render_to_response(template_name, { 'form': form,
'thisusername':username},
context_instance=context)

So perhaps a better question would be is

in view.py...
---
thisusername = str(request.user.username)
data = {'thisusername':username,}
form = form_class(data)

Why is it form_class(data) does not accept the data
as declared and enable it to presented it in
templates in any other form than a writable field
 --  when render_to_response allows the data to be
 presented as a string?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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 say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-17 Thread NoviceSortOf

Looking at the django document
ref-forms-api Brian mentioned above from
the python command line its clearly explicit
that data passed as form = FormClass(data)
only creates input fields. I get that but
what I don't get is why the same value passed in render_to_response is
passable as a string. (I hope that makes sense)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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 say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-17 Thread NoviceSortOf


Thanks everybody, the discussion has been very helpful.

I've double checked my code, and have found
passing the variable to render_to_response has different behaviour
depending on how if the data is passed as data via form_class(data) or
if passed directly in render_to_response.

ie. in views.py
* To present a write-able value in an input  field as {{ x }} in
template.html

x = str(request.user)
y = "Hello"
data = {'x':x, 'y':y }
form = form_class(data)
render_to_response(template_name,
  { 'form': form })
-
* The following passes a
  displayable (read-able only)
  string as {{ x }} in template.html

x = str(request.user)
y = "Hello"
data = { 'y':y }
form = form_class(data)
render_to_response(template_name,
  { 'form': form,
 'x':x })
-

Both instances simply represent the variable as {{ x }} in the html
yet offer considerably different behavior. I'm not sure if this
constitutes a bug, but it certainly maybe a gotcha. As well I wonder
how many people who have also posted notes on wanting read only/
readonly/read-only fields in forms are also stumped on how
render_to_response behaves in this seemingly logic defying scenario.


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



Using

2009-03-18 Thread NoviceSortOf

We have a web form where the enduser clicks on a link and
is moved to different parts of the page.

With the previous 3 generations of the site, we simply did something
 like the following .

...in html to mark the spot


...in html to jump to the spot.
< href="/mypage#top_of_page">

Now with django when we click on the link re-posts the form, and then
jumps to the anchor - loosing any previous data entered into the form.

What options are their for doing this sort of page navigation linkage
on the same page in Django without reposting the page and loosing the
content of data fields that have already been filled in?

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



Re: Using

2009-03-18 Thread NoviceSortOf

Thanks for the answer...

Looking closer and testing direct on the URL Navigation bar using cut
and paste figured out the following

A slash "/" between mypage/#top makes all the difference.

* this will reload the page, and go to the anchor.
http://127.0.0.1:8000/myproj/mypage#top

*this will just jump to the  anchor...
http://127.0.0.1:8000/myproj/mypage/#top


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



Is there a Country select feature in Local Flavors forms addon?

2009-03-24 Thread NoviceSortOf


I'm looking at using the USStateSelect from from
django.contrib.localflavor.us.forms, I'm curious
though if there an comparable CountrySelect
object anywhere.

Please advise.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Is there a Country select feature in Local Flavors forms addon?

2009-03-25 Thread NoviceSortOf


What I've done in this case is rather than using local flavor
is create a file called mysite.myproject.choices.py which
includes country, state and all other questions in the form.
Its a major improvement and cleanup on the html to say
the least. Putting the choices in a separate .py file
is also keeps our forms.py and models.py elegant.

I don't need the other localflavor options because in our
form they can answer Non-USA as state and simply type
in their provice/state if other than USA.

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



Controlling html display of Charfield length on forms...(newforms?)

2009-03-26 Thread NoviceSortOf


It would seem natural that there would be a length or size parameter
on something in forms and/or models Charfield to control the html
display of the field length.

ie.
firstname = forms.CharField(max_length=20, size = 4)

I've found this hack discussed to the fields.py [link below] but it
dates back a few years and I was curious if there is any update on how
the display of html input field's is now handled by Django.

http://groups.google.com/group/django-users/browse_frm/thread/4f6e2e0c936dcca5/cea43c5582dda436?hl=en&lnk=gst&q=fields.py+length#cea43c5582dda436
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Mysterious "=32" for all strings extracted from list showing up via send_mail

2009-03-26 Thread NoviceSortOf


My objective is to send a clean list of field names and values via
email
after the completion of a form in Django.

When formating an email message after extracting a list of field names
and values from a list i get a string that prints something like this.

$print(message_str):
...
name="Bill Jones"
street="Baker St."
zipcode="9"...

When I send this string as message parameter with Send_mail it arrives
looking like this in the body of the email
...
name=3D"Bill Jones"
street=3D"Baker St."
zipcode=3D"9"...

I'm curious where between the string being readable without the 3D via
the Django debugger via Send_mail and into the arriving mail
where the 3D might be interjected into the string.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Mysterious "=32" for all strings extracted from list showing up via send_mail

2009-04-02 Thread NoviceSortOf


Thanks that explains it fully
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Controlling html display of Charfield length on forms...(newforms?)

2009-04-02 Thread NoviceSortOf


text = forms.CharField(label="text", max_length=10,
  widget=forms.TextInput(
attrs={'size':'10', 'class':'inputText'}))

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



Problem with in long text fields in templates

2009-04-20 Thread NoviceSortOf

I've a template that displays descriptions of books.

The descriptions are long text fields usually containing 1-3
paragraphs of text.

Inside the text description during data entry  tags are placed to
indicate line breaks.

When attempt to using {{ book.description }} in the template, it
outputs all the  tags onto the screen,
when what we want is actual line breaks.

I've attempted as well using {{ book.description|escape }} but that
yields the same result.

Obviously I'm missing part of the concept involved with displaying
long text fields with embeded html via django .

Can someone please give me a clue as to how to make this work or where
to find information to make this work.


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



Re: Problem with in long text fields in templates

2009-04-20 Thread NoviceSortOf

By digging around here in this group I found
an answer in using 

{{ book.description|safe }}

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



Trouble Getting a distinct query set.

2009-04-21 Thread NoviceSortOf

I'm attempting to get a unique list from a django sql query using the
distinct() function, but it does not seem to filter
the redundancies..

For example

I do a query for Moby Dick and it returns the query set
named results1 as...

qset= (Q(title__icontains='MOBY DICK'))
results1 = Titles.objects.filter(qset).distinct()

results1 = [, , , , , ]

Even though I'm using the distinct function why does this return a
list with redundancies?

Is there any other way I can clear the redunencies from
the results?

Any suggestions 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
-~--~~~~--~~--~--~---



Is there a bug in queryset distinct() filtration in Postgre SQL?

2009-04-21 Thread NoviceSortOf

I've tried various permuations of filters and approaches in
attempting to get unique/distinct results on a django query
with postgres data to no avail. Using distinct() has no effect
on queries in the following examples...

qset= (Q(title__icontains='MOBY DICK'))
results1 = books.objects.filter(qset).distinct()

I've also tried the following where ItemNo is an integer.

X = books.objects.order_by('ItemNo').filter(qset).distinct('ItemNo')

Y = X.order_by('ItemNo').distinct('ItemNo')

.distinct() in the above instances has no effect, i get
a list of books with the same author, title, itemno. Even
though they are different editions and reflected in the data
by separate records its not possible to simply get a
preliminary distinct list.

I'm curious if there is another means of getting django data query to
return a distinct list, or if somehow I'm using distinct incorrectly?

Also is there anyway to see the verbose/verbatum SQL these django
queries are generating?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: Is there a bug in queryset distinct() filtration in Postgre SQL?

2009-04-27 Thread NoviceSortOf


Thanks for the as_sql() function as can now can
see the SQL detail. Which reveals a problem in
getting DISTINCT to draw from a fields or fields that can in fact
return the unique result of the query. Perhaps it is my usage
of the function so I'm listing an examble
below.

To further simplify my example and testing I'm  using an internal
product number that in this instance refers to all editions of the
book Moby Dick by Herman Melville.

qset = (Q(editionid__contains=q_bookid))

results = Titles.objects.filter(qset).order_by().distinct()
assert False, resultsa.query.as_sql()

Here is the SQL it generates results...

('SELECT DISTINCT "books_titles"."id", "books_titles"."keywords",
"books_titles"."editionid", "books_titles"."author",
"books_titles"."title", "books_titles"."price",
"books_titles"."bookid" FROM "books_titles" WHERE
"books_titles"."author"::text LIKE %s ', (u'%842838%',))

Now with the above if I read correctly the DISTINCT is being placed on
book_titles.id
which of course will always be unique and
always return every instance, which does not  return a unique list.

So for output I get something like...

EditionId BookID AuthorTitle
= == = =
2001  200Melville  Moby does Captain Bly
2002  200Melville  Moby does Captain Bly
2004  200Melville  Moby does Captain Bly

When in fact all I need for the seeding the
initial search results is

EditionId BookID AuthorTitle
= == = =
2001  200Melville  Moby does Captain Bly

At least now though the SQL is explicit
and I can perhaps dig a bit into the code
to see how it works, but if anyone can offer
any further insights it would be of great
help.

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



Re: Is there a bug in queryset distinct() filtration in Postgre SQL?

2009-04-27 Thread NoviceSortOf

Thanks Malcom...

Simply adding values() to the query with author and title to the
search worked perfectly in limiting the SQL DISTINCT criteria to the
relevant fields,

Using...

results = Titles.objects.values('author','title').filter(qset).order_by
().distinct()

Django provides this elegant and functioning SQL

results.query.as_sql()

('SELECT DISTINCT "books_titles"."author", "books_titles"."title" FROM
"books_titles" WHERE "books_titles"."copyid"::text LIKE %s ',
(u'%842838%',))


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

2009-05-09 Thread NoviceSortOf


I'm not the world's leading expert -- but today I've
solved the problem inside of my current python
shell using os.environ.keys()

I'll attempt to outline the basics, ">>>" indicates what
i typed on the python shell command line
"$" indicates what echoes back

>>>import os

# now to see what environment keys already exist.
>>>print os.environ.keys()
$ ['LOGNAME', 'USER', 'HOME', 'PATH',...]

# now to see whats in these environ. keys/vars
>>> print os.environ["HOME"] ## for example.
$/home/myhomefolder

# in my case the following was blank raising a  nasty key error in
apocalyptic alarming red text ending with
>>>os.environ["DJANGO_SETTINGS_MODULE"]
$..."raise KeyError(key)"

# so had to set it to get moving using
# first i verified i was in my projects path
>>>os.getcwd()
$/home/myfolder/myproject'

then I issued
>>>os.environ["DJANGO_SETTINGS_MODULE"]="settings"

remember to change directories in the shell use something like.
>>>os.chdir("/home/myproject")

i hope that helps, what i'm doing is creating a *.py file I call it
simply called mydevelsets.py for loading this sort of stuff in the
shell before I start, i call it from the command line using
>>>execfile('mydevelsets.py')

i hope that helps.

# from mydevelsets.py
import os

## WTH is the current work directory anyhow
print os.getcwd()

os.chdir("/home/myproject") ## change to project directory
print os.getcwd()## I'm from Missouri - show me!

# Set the var!
os.environ["DJANGO_SETTINGS_MODULE"]="settings"

## I'm not really from Missouri - but show me anyhow!
print os.environ["DJANGO_SETTINGS_MODULE"]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: mymodel.save() does not work in django but works in python shell

2009-05-11 Thread NoviceSortOf


An observation I've made it that django does update the related
sequence_id table of the table but does not add a row to the table.

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



mymodel.save() does not work django view but works in python shell

2009-05-11 Thread NoviceSortOf


.save() is not working for me either with models or with forms in
django.

I'll start with a simple example, on a single non related table.

from views.py

def testit():
from myproject.models import NewCust
p1 = NewCust()  ## Create blank instance
p1.zipcode = '222' ## Load something into it.
p1.last_name = 'Smith'
p1.save()  ## Save it

In Django this does not work.

Now from the Python command line
it works like clockwork.

>>>from myproject.models import NewCust
>>>p1 = NewCust()  ## Create blank instance
>>>p1.zipcode = '222' ## Load something into it.
>>>p1.last_name = 'Smith'
>>>p1.save()  ## Save it
...creates a record every time...

My attempts to get this to work have included deleting
NewCust from my PostGres SQL tables and revalidating
and recreating them via manage.py to make sure their
is not problem in the table.

I'm baffled why this simple data operation as outlined in
Django Chapter 5 - Interacting with a Database does not
work in this case.

Any clues 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
-~--~~~~--~~--~--~---



Re: mymodel.save() does not work in django but works in python shell

2009-05-11 Thread NoviceSortOf


Thanks for your reply, I'm thinking and working outloud on
the answers that follow, I've a solution sort of but remain mystified
as to why and how it works.

> How are you deciding it's not working?

via pgAdminIII where I can see the sequence table
being incremented + 1 on every django save but
no rows added to table mytable

>Are you seeing errors?

No errors on the surface it looks like it working but
no rows are being added.

I can refresh and reboot and still see no rows being
added to Table mytable, even though Sequences id table
gets incremented.

I've also added an
assert False, p1.id
to the routine in question, and can see it is adding an id to the
sequence table as corroborated in the
p1.id resulting from p1.save()...

>>>Does the object have a pk assigned after you call save()?  

Yes it has a pk assigned after the save reflecting it is infact
incrementing ids.

>>>If yes, have you tried > adding code after the save() to retrieve the object 
>>>by pk?

p2 = mytable.objects.get(id=p1.id)

Returns the object as if it is saved by I see nothing in the table,
python command line though issued from the same folder,
using the same settings does though add a row.

>Are you perhaps  querying for the save() working using a >transaction that is 
>isolated?

I'm not sure if I completely understand this question this
though is an -- isolated function defined as "testit" in views
pointed to by url.py. There is no code before or after this
sample, it is not nested.

I'm sorry I don't understand exactly what you are saying in this
question...this code though has been stripped down to as basic
as possible to though to determine why django does not
save when python command line saves to the table.

> This is very basic fundamental function, it is unlikely to be badly broken.  
> It's far more likely that what you are doing to check that it is working is 
> what is broken.

I hear what you are saying, pgAdminIII though has been accurate for
all other functions regarding seeing what is in the database via
django and python over the last 5 months, including ; additions to
registration table and profile entries, adding tables via manage.py
and about ever other function I can imagine.

I'm baffled why my own attempts to add data to the tables is not
working and/or why is the data saved via save() in django is
disappearing when save() in python shell save() works every time.

Now get this -- if I add a 'return' to the end of the function it adds
the rows -- why is this?

If I insert an assert False the functions sort of behave like they are
working returning an object for the new pk id but incrementing the seq
tables, but not loading the data into postgresql.

any idea why this is?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: mymodel.save() does not work django view but works in python shell

2009-05-11 Thread NoviceSortOf

> Michael

I appreciate your answer...

I omited in my code example was the assert False that was being used
to debug the problem, so intuitively you were right something was
wrong with the code

With the assert False though it was bringing up the debugger and I
could view the variables. Without the return statement in the function
data was not being commited to a save visable in Postgres Sql.

> from views.py

> def testit():
>from myproject.models import NewCust
>p1 = NewCust() ## Create blank instance
>p1.zipcode = '222' ## Load something
>p1.last_name = 'Smith'
>p1.save()  ## Save it
># assert False, p1.id
   return ## NOTE: save does not commit
   ## without return on Postgre Sql

If anyone can explain to me why this is, it could help, I've been
using assert False to attempt to debug something that apparently does
not work
if assert False is present.


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

2009-09-29 Thread NoviceSortOf


I think somebody had a module that worked as wrapper for this,
but I can't find it. As well I'd like to use email addresses for
username,
since we have a legacy system with over 6000 entries, we need a way
they can continue using their email addresses somehow.


On Sep 20, 6:24 pm, Brandon Taylor  wrote:
> Hello everyone,
>
> I've implemented a custom backend to use anemailaddressinstead of a
> username. Unfortunately, this prevents me from using the built-in User
> change form within admin.
>
> I'm looking for a way to override the username form field with my own
> field, or at least change the validation on the username field to
> accept anemailaddress.
>
> Does anyone know of a quick way to override the built-in change form
> for Auth.User?
>
> TIA,
> Brandon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, 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: formfield_overrides for Auth.User?

2009-09-29 Thread NoviceSortOf

Perhaps check this link.

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



500.html does not load

2009-10-21 Thread NoviceSortOf


Although I have 500.html in my
site-packages/django/contrib/admin/templates folder 500.html does not
appear when it should, below see my errors (I've included the
traceback items below).

Is there something else I need to configure to get 500.html to load?

Mod_python error: "PythonHandler django.core.handlers.modpython"


Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 222, in handler
return ModPythonHandler()(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 195, in __call__
response = self.get_response(request)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 116, in get_response
return self.handle_uncaught_exception(request, resolver,
sys.exc_info())

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 160, in handle_uncaught_exception
return callback(request, **param_dict)

  File "/usr/lib/python2.3/site-packages/django/views/defaults.py",
line 88, in server_error
t = loader.get_template(template_name) # You need to create a
500.html template.

  File "/usr/lib/python2.3/site-packages/django/template/loader.py",
line 80, in get_template
source, origin = find_template_source(template_name)

  File "/usr/lib/python2.3/site-packages/django/template/loader.py",
line 73, in find_template_source
raise TemplateDoesNotExist, name

TemplateDoesNotExist: 500.html

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



Re: 500.html does not load

2009-10-22 Thread NoviceSortOf

>> Traceback error :  TemplateDoesNotExist: 500.html

Thanks for the note Akonsu, I'm looking at my template settings in
settings.py
on my production server and don't see any anomalies. As well all my
other templates load -- so I'm not sure where else to go to trouble
shoot this.

TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',)

TEMPLATE_DIRS = ("/home/mysite/www/myproject/templates",
 "/usr/lib/python2.3/site-packages/django/contrib/
admin/templates",)

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



HTML Frames and Django Template include

2010-07-06 Thread NoviceSortOf

I would like to use html frames in Django but my initial experiements
with it have not worked out.

* Is there anyway to combine HTML frames into a Django
  template {% include t?

* I definitely need Django Context on the right side of the frame,
  the left side is strictly navigational and of static content.

* Is any of the above feasible with Django and if so what is the
  best way to approach it in the template system?






-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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 record/capture IP address of user/registrant in Django

2010-07-06 Thread NoviceSortOf

I would like to record the IP numbers of persons registering on our
Django driven site. The IP can simply be recorded in the form
generated and sent to us during the registration process, as we have
custom notifiers sent to us whenever somebody registers. But I'm
wondering in the registration process how we can capture the IP
address of the user/registrant?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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 record/capture IP address of user/registrant in Django

2010-07-07 Thread NoviceSortOf

Thanks Thusjanthan...

That certainly will work.

Now request.META['REMOTE_ADDR'] it seems it  would be possible
somehow to add a field to our userprofile or auth_user table such as
last_ip_used and record that customers last IP when using the system.

This makes easier for us to track from the apache access_log where
a logged on customer is actually going.

_Other than modifying the existing logon routine I'm wondering
  if their is someway to make a wrapper to do this.

_Or is there another mechanism or log in Django that logs the activity
of
  users after they log on?





On Jul 6, 11:24 pm, thusjanthan  wrote:
> This would be done in the view that calls the registration page.
> Suppose its like this
>
> def index(request):
>     message = request.META['REMOTE_ADDR']
>     ... send message ...
>
> Basically short of it is the dictionary request.META contains the Key:
> REMOTE_ADDR which contains the ip. You would access it as follows:
> :
>
> request.META['REMOTE_ADDR']
>
> More information on the META dict can be found 
> at:http://docs.djangoproject.com/en/dev/ref/request-response/#django.htt...
>
> Cheers,
> Thusjanthan Kubendranathan
>
> On Jul 6, 2:16 pm, NoviceSortOf  wrote:
>
> > I would like to record the IP numbers of persons registering on our
> > Django driven site. The IP can simply be recorded in the form
> > generated and sent to us during the registration process, as we have
> > custom notifiers sent to us whenever somebody registers. But I'm
> > wondering in the registration process how we can capture the IP
> > address of the user/registrant?

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

2010-10-02 Thread NoviceSortOf
I used to be able to go to the following link and
seach django documents.

http://docs.djangoproject.com/en/dev//search/

>From there I could search anything from 'widgets' to
'login()' and find the related document/page discussion that time.

Now on that page search yields no results irregardless of what
I search for .

Using the search field on
http://docs.djangoproject.com/en/1.2/

Also does not yield any results.

Strange thing is that I can search from www.google.com
django login() and get access to django docs but can't search
django docs from the django website any explanation?

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

2010-10-07 Thread NoviceSortOf

Steve:

Thanks, the problem must be Firefox plugin I'm running because Opera
works just
fine. Thanks for the suggestion.

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



Multiple Check Boxes - Single Choice w/ CheckboxSelectMultiple?

2010-10-09 Thread NoviceSortOf
I'm using the following in a form to allow the user to input choices
on field named frequency.

sub_freq   = forms.ChoiceField(choices=SUB_FREQ,
widget=forms.CheckboxSelectMultiple)

This gives me a list of checkboxes and I check all of the checkboxes

Is there anyway to limit the enduser to only checking one box?
For example

Frequency
[  ] Once a week
[  ] Once a month
[X] Once a year

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



[SOLVED] Re: Multiple Check Boxes - Single Choice w/ CheckboxSelectMultiple?

2010-10-09 Thread NoviceSortOf

Thanks Russ, works like a charm.

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

2010-02-19 Thread NoviceSortOf
As a newbie of sorts I started by trying out both Web2Py and Django at
the same time.
I found Web2Py to somehow be more elegant, and in fact liked the
coding style in the
source better that what I found in Django, or can say at least I
preferred the structure
and format of the code I saw.

The documentation at the time for both frameworks at the time was not
that hot.

There was the first edition Django book which was outdated and very
frustrating
to work with while Django was moving to another revision and there was
not a
Web2Py book out yet.

But one thing Django had going for it was more books about it on the
horizion,
Addison Wesley's Python Web Development with Django was published
while I was in
the early stages of comparing Web2Py and Django and I bought it as
soon as it was published.
That book provided the needed clarity and overview I needed to
continue.

Also where I got cold feet with Web2Py was when it was time to apply
the framework to
a project with a legacy. The project twice before had been refactored/
ported to other platforms and
frameworks. We had problems in the past with products that fell out of
support or were
hard to outsource expertise in. So in the end going with Django was
more attractive at the
bargain table with the non-programming persons involved with this
project because of its
larger mind-share, market-share. There was a need to error on the side
of caution.  If
we would of had a senior Python programmer in-house perhaps the
decision would
of been different.

In retrospect its impossible to say if the gotcha's would been greater
with Django than Web2py.
Anyhow the future though I still am keeping Web2Py in mind. In my
opinion frameworks
should be considered on a project by project basis and Web2Py could be
better than Django
in some situations.

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

2010-02-19 Thread NoviceSortOf
As a newbie of sorts I started by trying out both Web2Py and Django at
the same time. I found Web2Py to somehow be more elegant, and in fact
liked the coding style in the source better that what I found in
Django, or can say at least I preferred the structure and format of
the code I saw.

The documentation at the time for both frameworks at the time was not
that hot.

There was the first edition Django book which was outdated and very
frustrating to work with while Django was moving to another revision
and there was not a Web2Py book out yet.

But one thing Django had going for it was more books about it on the
horizion, Addison Wesley's Python Web Development with Django was
published while I was in the early stages of comparing Web2Py and
Django and I bought it as soon as it was published. That book provided
the needed clarity and overview I needed to continue.

Also where I got cold feet with Web2Py was when it was time to apply
the framework to  a project with a legacy. The project twice before
had been refactored/ ported to other platforms and  frameworks. We had
problems in the past with products that fell out of  support or were
hard to outsource expertise in. So in the end going with Django was
more attractive at the bargain table with the non-programming persons
involved with this project because of its larger mind-share, market-
share. There was a need to error on the side of caution.

If  we would of had a senior Python programmer in-house perhaps the
decision would of been different.

In retrospect its impossible to say if the gotcha's would been greater
with Django than Web2py. Anyhow the future though
I still am keeping Web2Py in mind.

In my opinion frameworks should be considered on a project by project
basis and Web2Py could be better than Django in some situations.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, 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 projects on the back of a base URL and having issues with the homepage

2010-12-15 Thread NoviceSortOf
On Dec 15, 8:08 am, mongoose  wrote:
> > I'm trying to run projects on the back of it. For 
> > examplehttp://baseurl.com/mongoose/
> > The projects run but the URL don't work properly because they all
> > reference the base url. So for 'About Me' page it points 
> > tohttp://baseurl.com/aboutinsteadofhttp://baseurl.com/mongoose/about
>
> > Is this something i need to change in django or apache? Is what I'm
> > trying to do even possible?

I wrestled with something like this - as we needed a static homepage
based on a django backend for one site.

Per my recollection what I did was.

* Apache httpd.conf required a location match adjustment something
like.


  SetHandler None


* My url.py file needed this line
  (r'^$', direct_to_template,{'template': 'index.html'}),

* As well I landed up having to put the index.html into both
  full static form in the .com root as well in the django template
folder.
  This was neccesary so people could load into the site as
  "www.somewhere.com"
   and while once in the django backend
  "www.somewhere.com/index.html" would load for further
   navigating.

I hope that makes sense, there was a downside to this in that
our web provider Verio's site management front end does not work
with us resetting the SetHandler in the root. In any case
most management of this site is done on the command line level.

Not a perfect solution but one that works, I'm open for other
suggestions.


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



Controlling File Downloads.

2010-12-15 Thread NoviceSortOf

What is the best way to allow authorized downloads
to specific users in Django.

We have 2 possible scenarios that could work for us.

1. A download directory where any user can download any
   file in the folder.

or

2. Granting specific rights to specific users to download a specific
file
or set of files.

Any suggestions?

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



query fast on command line - slow via url

2010-12-19 Thread NoviceSortOf
I'm trying to determine why our search queries return so slow.

We are not doing anything fancy in our searches, simply searching
for author, or title in a table of about 6000 books.

http://www.rareorientalbooks.com/searchadv/

On the command line using the exact code in the views.py everything
returns instantly.

When accessing the same code via url browser access all searches take
a minimum of 10 seconds whether it returning 10 or 500 titles.

__If via the command line the queries return instantly

* am I right in thinking the bottleneck is somewhere else in the
  process?

* where might that bottleneck be and how can i streamline it?

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



Is it possible have Django registration and content databases on 2 different servers?

2018-01-12 Thread NoviceSortOf


Is it possible have Django registration and content databases on 2 
different servers?

I would like to decouple the registration from the content management 
system, and am wondering
if its possible to place them on 2 different servers. What caveats, 
guidelines and methods
are available for such an approach?

Please advise 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38fbd7d3-0d57-46f1-a456-da2e196b6cf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django and wsgiref simple_server.py line 33

2016-11-30 Thread NoviceSortOf

REF: /usr/lib64/python2.7/wsgiref/simple_server.py", line 33,

On a fresh install of Python 2.7 and Django 1.6.12 attempting to resolve 
the following error.

When running... 
 python manage.py runserver 0.0.0.0:8000

And then loading a page on a browser I get the following.


  File "/usr/lib64/python2.7/wsgiref/simple_server.py", line 33, in close
   self.status.split(' ',1)[0], self.bytes_sent
   AttributeError: 'NoneType' object has no attribute 'split'


I've googled and read entries in this group but can find no suggestions 
that work. 

Please advise 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/89fb52b4-9828-4922-a666-f9db8ff9e849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


wsgiref - When does the complexity of question require posting to the Developers or other forums?

2016-12-01 Thread NoviceSortOf


Hi All,

After hours of looking for solutions, here on Stackoverflow, GitHub, Django 
site and other forums,
and seeing that at least 2 other posts related to what per web chatter 
appears to be a known
bug in Django and the WSGI package, I'm wondering where to turn for useful 
advice
regarding what appears to be a common problem without a common answer.

Below is detail of a wsgiref issue that gets considerable discussion online 
with
no answer to the question being posted here or elsewhere.

* Should I attempt posting this question in the Developers Conf?
* Are there other forums that might be of help?

Please advise 



Details of well known Wsgiref bug/issue follow.

***
After porting my project to the new development area...
When running... 
 python manage.py runserver 0.0.0.0:8000

And then loading a page on a browser I get the following.


  File "/usr/lib64/python2.7/wsgiref/simple_server.py", line 33, in close
   self.status.split(' ',1)[0], self.bytes_sent
   AttributeError: 'NoneType' object has no attribute 'split'


This problem points to the wsgi component of the install packages.

Researching the web various solutions are posted, including ...
--
* Commenting out line 33 in simple_server.py and see if any missing
   packages are reported.
   (I've tried this and no packages are reported as missing)

REF.:  https://groups.google.com/forum/#!topic/django-users/Cps4kHh0_-0
---
---
* A Django bug report, with code that does not match the version I currently
  am using. It recommends modifications to file  
  django/core/handlers /exception.py 
  which does not exist on the release currently installed.

REF.: 
https://github.com/django/django/commit/742ea51413b3aab07c6afbfd1d52c1908ffcb510

* A Django modification that makes perfect sense and partially matches the 
revision of django/core/handlers/base.py on my installed system.

REF.: 
https://github.com/django/django/commit/2f615b10e6330d27dccbd770a4628200044acf70
-

Still though I continue to get 'NoneType' object has no attribute 'render' 
or
other errors related to NoneType assigned as NoneType object when it should
be a request response object.

*** What to do?

* This appears to be a bug noted in Django, Github and Stackoverflow 
communities,
  with Wsgi related to various versions of Django and Python 
  
  _Is there any logical way of resolving the NonType error, by settings.py 
or other
   Django config options?
  
  _Would placing my app as the home page on this development server rather 
than 
   relying on the python manage.py runserver possibly resolve this problem?
  
  _Is there an alternative to Wsgi that would possibly eliminate the 
problem?
  

Any ideas or suggestions appreciated.

  
  

  


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4be17192-d031-4692-85fe-2ef3a0913e72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: wsgiref - When does the complexity of question require posting to the Developers or other forums?

2016-12-02 Thread NoviceSortOf
Thanks for the reply.

I agree the probability of this being a bug in Django is improbable still I 
found git hub django 
bug descriptions/discussions which URLs are listed in previous posts. Both 
of those URLs
listed patches to fix the situation, not directly in Django but in the 
WsgiRef component. 
https://github.com/django/django/commit/2f615b10e6330d27dccbd770a4628200044acf70
https://github.com/django/django/commit/742ea51413b3aab07c6afbfd1d52c1908ffcb510

I naturally referred to them being as could not find after search of the 
internet or this forum any further info.

It would be better if traceback pointed to my code but instead Traceback 
now points to 
/usr/lib/python2.7/site-packages/django/core/handlers/base.py
with the same attribute error. 'NoneType' object has no attribute 'render'.
(SEE Traceback below)

With so much of this troubleshooting being in finding the right question. 
* Would issue perhaps be limited to Django’s built-in development server?
* Would using a difference Web Interface Gateway solution solve the problem?

Details follow...

Please advise  


I type on the Linux server command line
# python manage.py runserver 0.0.0.0:8000
then point my browser to...
http://[MyDevelopmentServerIP]:8000/

And get the following response.

1 <http://dpaste.com/3AKE6QZ#line-1> 2 <http://dpaste.com/3AKE6QZ#line-2> 3 
<http://dpaste.com/3AKE6QZ#line-3> 4 <http://dpaste.com/3AKE6QZ#line-4> 5 
<http://dpaste.com/3AKE6QZ#line-5> 6 <http://dpaste.com/3AKE6QZ#line-6> 7 
<http://dpaste.com/3AKE6QZ#line-7> 8 <http://dpaste.com/3AKE6QZ#line-8> 9 
<http://dpaste.com/3AKE6QZ#line-9>10 <http://dpaste.com/3AKE6QZ#line-10>11 
<http://dpaste.com/3AKE6QZ#line-11>12 <http://dpaste.com/3AKE6QZ#line-12>13 
<http://dpaste.com/3AKE6QZ#line-13>14 <http://dpaste.com/3AKE6QZ#line-14>15 
<http://dpaste.com/3AKE6QZ#line-15>16 <http://dpaste.com/3AKE6QZ#line-16>17 
<http://dpaste.com/3AKE6QZ#line-17>18 <http://dpaste.com/3AKE6QZ#line-18>19 
<http://dpaste.com/3AKE6QZ#line-19>20 <http://dpaste.com/3AKE6QZ#line-20>21 
<http://dpaste.com/3AKE6QZ#line-21>22 <http://dpaste.com/3AKE6QZ#line-22>23 
<http://dpaste.com/3AKE6QZ#line-23>24 <http://dpaste.com/3AKE6QZ#line-24>25 
<http://dpaste.com/3AKE6QZ#line-25>26 <http://dpaste.com/3AKE6QZ#line-26>27 
<http://dpaste.com/3AKE6QZ#line-27>28 <http://dpaste.com/3AKE6QZ#line-28>29 
<http://dpaste.com/3AKE6QZ#line-29>30 <http://dpaste.com/3AKE6QZ#line-30>31 
<http://dpaste.com/3AKE6QZ#line-31>32 <http://dpaste.com/3AKE6QZ#line-32>33 
<http://dpaste.com/3AKE6QZ#line-33>34 <http://dpaste.com/3AKE6QZ#line-34>35 
<http://dpaste.com/3AKE6QZ#line-35>36 <http://dpaste.com/3AKE6QZ#line-36>37 
<http://dpaste.com/3AKE6QZ#line-37>38 <http://dpaste.com/3AKE6QZ#line-38>39 
<http://dpaste.com/3AKE6QZ#line-39>

Environment:Request Method: GETRequest URL: http://MyServer:8000/Django 
Version: 1.6.12Python Version: 2.7.5Installed 
Applications:('django.contrib.auth', 'django.contrib.contenttypes', 
'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 
'django.contrib.humanize', 'django.contrib.redirects', 'bookstor.books', 
'bookstor.registration', 'bookstor.profiles', 'django_extensions', 
'django.contrib.admin', 'bookstor.cart')Installed 
Middleware:('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.common.CommonMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.middleware.transaction.TransactionMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'django.contrib.redirects.middleware.RedirectFallbackMiddleware')Traceback:File 
"/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 
 94. response = response.render()Exception Type: AttributeError 
at /Exception Value: 'NoneType' object has no attribute 'render'




On Thursday, December 1, 2016 at 7:28:48 PM UTC+1, Daniel Roseman wrote:
>
> On Thursday, 1 December 2016 13:16:07 UTC, NoviceSortOf wrote:
>>
>>
>>
>> Hi All,
>>
>> After hours of looking for solutions, here on Stackoverflow, GitHub, 
>> Django site and other forums,
>> and seeing that at least 2 other posts related to what per web chatter 
>> appears to be a known
>> bug in Django and the WSGI package, I'm wondering where to turn for 
>> useful advice
>> regarding what appears to b

Re: wsgiref - When does the complexity of question require posting to the Developers or other forums?

2016-12-02 Thread NoviceSortOf
...Thanks everyone for the above discussion -- some progress today has been 
noted...

To answer Matt's question...

The variable at the root of the error appears to be -- response.
as found in /usr/lib/python2.7/site-packages/django/core/handlers/base.py 
line 89

response is assigned as "None" in the code, before being passed to the 
middleware method.

The patch I found on github recommended adding these lines to base.py at 
line 94.
#response = response.render()
#response_is_rendered = True
Now mysteriously enough when commenting those lines out.
and loading devel server URL via port 8000...
I get a TemplateDoesNotExist at / index.html.

NOW ! -- That is an issue I can far more easily debug. 

Also I've found out in the last half hour with the development server 
issuing...

# python -Wall manage.py runserver 0.0.0.0:8000

provides more granular details regarding depreciated components, a big help.

Thanks Matt & Daniel, 

While I'm not completely out of the woods yet with this port/upgrade at 
least I'm moving towards someplace 
where traceback is pointing more and more to 'my' code, which if I coded it 
I can more easily update/mod/fix.

Otherwise if anyone can point me to information, guides, blogs on porting 
from 1.1 to 1.6 please let me know. I've already reviewed the depreciation 
memos on the Django site from 1.1 to 1.6, and made note of relevant 
changes, but further materials could help.

Thanks 


On Friday, December 2, 2016 at 6:05:52 PM UTC+1, Matthew Pava wrote:
>
> For what it’s worth, I do get this error sometimes when I am running the 
> development server, even in Python 3.5 and Django 1.10.  But because it’s 
> the development server, I simply disregard it.
>
> I typically only get this message when I am running several AJAX calls 
> very close together.  (e.g. When I am filling out an autocomplete that 
> queries the server after every key press.)
>
>  
>
> Seeing the error message, though, I wonder if it would be so hard to 
> simply check if self.status is None before executing the command.
>
>  
>
>
> 
>
>   File "/usr/lib64/python2.7/wsgiref/simple_server.py", line 33, in close
>
>self.status.split(' ',1)[0], self.bytes_sent
>
>AttributeError: 'NoneType' object has no attribute 'split'
>
>
> ****
>
>  
>
>  
>
>  
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *NoviceSortOf
> *Sent:* Friday, December 2, 2016 10:58 AM
> *To:* Django users
> *Subject:* Re: wsgiref - When does the complexity of question require 
> posting to the Developers or other forums?
>
>  
>
> Thanks for the reply.
>
> I agree the probability of this being a bug in Django is improbable still 
> I found git hub django 
>
> bug descriptions/discussions which URLs are listed in previous posts. Both 
> of those URLs
>
> listed patches to fix the situation, not directly in Django but in the 
> WsgiRef component. 
>
> https://github.com/django/django/commit/2f615b10e6330d27dccbd770a4628200044acf70
>
> https://github.com/django/django/commit/742ea51413b3aab07c6afbfd1d52c1908ffcb510
>
> I naturally referred to them being as could not find after search of the 
> internet or this forum any further info.
>
>
> It would be better if traceback pointed to my code but instead Traceback 
> now points to 
>
> /usr/lib/python2.7/site-packages/django/core/handlers/base.py
>
> with the same attribute error. 'NoneType' object has no attribute 'render'.
> (SEE Traceback below)
>
> With so much of this troubleshooting being in finding the right question. 
>
> * Would issue perhaps be limited to Django’s built-in development server?
>
> * Would using a difference Web Interface Gateway solution solve the 
> problem?
>
> Details follow...
>
> Please advise  
>
>
> I type on the Linux server command line
> # python manage.py runserver 0.0.0.0:8000
>
> then point my browser to...
> http://[MyDevelopmentServerIP]:8000/
>
> And get the following response.
>
>  
>
> 1 <http://dpaste.com/3AKE6QZ#line-1>
>
>  2 <http://dpaste.com/3AKE6QZ#line-2>
>
>  3 <http://dpaste.com/3AKE6QZ#line-3>
>
>  4 <http://dpaste.com/3AKE6QZ#line-4>
>
> * 5* <http://dpaste.com/3AKE6QZ#line-5>
>
>  6 <http://dpaste.com/3AKE6QZ#line-6>
>
>  7 <http://dpaste.com/3AKE6QZ#line-7>
>
>  8 <http://dpaste.com/3AKE6QZ#line-8>
>
>  9 <ht

  1   2   >