URL_VALIDATOR_USER_AGENT

2012-11-25 Thread Alex Strickland

Hi

According to :

https://docs.djangoproject.com/en/dev/ref/settings/

URL_VALIDATOR_USER_AGENT

is deprecated in 1.5. But it's actually been removed. Is that worth a 
bug report?


--
Regards
Alex

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



Re: Django MongoDB

2012-11-25 Thread yati sagade
Hi. I've used django-nonrel for interfacing with the Google datastore on
appengine and I use mongoengine for the rest. I guess mongoengine is the
recommended way to work with mongodb on django. I've set up a small
example, a Twitter clone that uses mongoengine. The app can be deployed on
OpenShift, but the source should give you a clear view of what's going on.
Check it out 
here.
The app is called twtapp. Look into settings.py to see how the mongodb
connection is established there. Then take a took at twtapp/documents.py to
see how to define documents (these are the mongodb equivalents of
"models"). Then hack around to see how it all works. You can also deploy
this app on openshift  to see it running
in the cloud.  It really is very simple :)

Regards


On Sun, Nov 25, 2012 at 10:14 PM, Carlos Aguilar wrote:

> You know which mongoengine and django-nonrel are 2 different libraries for
> mongodb???
>
> Please select one and use it, but not both.
>
> Best Regards
>
> --
> Carlos Aguilar
> Consultor Hardware y Software
> DWD
> http://www.dwdandsolutions.com
> http://www.houseofsysadmin.com
> Cel: +50378735118
> USA: (301) 337-8541
>
>  --
> 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.
>



-- 
Yati Sagade

Software Engineer at mquotient 


Twitter: @yati_itay  | Github:
yati-sagade

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869

-- 
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: overwrite field value in subclasses

2012-11-25 Thread Peter of the Norse
Foo.myfield is 0, but when you created a new models.Field object in the 
abstract class, it did some deep magic. There’s also Foo._meta.fields which has 
the old myfield in it. The only thing you can do is create a new myfield with 
default=0 and editable=False.

On Nov 23, 2012, at 8:40 AM, Emmanuel Jannetti wrote:

> Hi all,
> 
> One piece of my model is as follow :
> 
> class UpperAbstract(models.Model):
>   CHOICE_A = 0
>   CHOICE_B = 1
>   CHOICE_C = 2
>   myfield = 
> models.PositiveSmallIntegerField(choices=((CHOICE_A,'A'),(CHOICE_B,"B"),(CHOICE_C,"C")),blank=False)
>   class Meta:
>   abstract = True
> 
> class Foo(UpperAbstract):
>   myfield = UpperAbstract.CHOICE_A
> 
> 
> 
> I am expecting any instance of Foo being created, to have 'myfield' always 
> and "automatically" set to UpperAbstract.CHOICE_A
> In my test the created object as null value and saving it is refused on 
> IntegrityError because 'myfield' cannot be None
> 
> thank in advance for any help.
> regards
> 
> manu
> 

Peter of the Norse
rahmc...@radio1190.org



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



Re: Django ORM

2012-11-25 Thread Russell Keith-Magee
On Sun, Nov 25, 2012 at 10:51 PM, Alexandra Paredes <05-38...@usb.ve> wrote:

> Hi Russ,
>
> Thanks for the response, well we're thinking in modifying Django ORM to
> add some requeriments we consider important on databases. And specially if
> you already have the DB already build and want to import it to build the
> model part of the app. We're studying the code and we wonder if we can ask
> questions or received some kind of support when working with the ORM itself,
>
>
Feel free to ask; however, keep in mind that Django is a volunteer project,
and while we'll try to answer questions, there's no guarantee that you'll
always be able get an answer (or get an answer in a timely fashion).

If you do want to ask questions about adding new features to the ORM or
database backends (rather than just general 'how does it work' questions),
you'll be better served asking on the django-developers mailing list --
that's a list focussed on the development of Django itself.

I'm also intrigued as to the features that you think are important and are
missing. Some features are missing due to a lack of interest from the
community (or, at least, a lack of volunteers willing to build the
feature); however, there are also some features that have been specifically
rejected at a design level. Before you embark on a massive project, it
would be worthwhile to validate that your high-level goals will be looked
upon favourably by the core team.

Yours,
Russ Magee %-)

-- 
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: I install v1.5 Django, and run a my first site, then have an error: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte. I use Sublime editor.

2012-11-25 Thread Sergiy Khohlov
check databse setting. look like your database uses non utf8 encoding

2012/11/25 Julien Phalip :
> Hi,
>
> Can you please post the entire traceback?
>
> Thanks!
>
> Julien
>
>
> On Sunday, November 25, 2012 4:03:11 PM UTC+1, 名宏贾 wrote:
>>
>>  I don't know why, editer have default utf-8 setting.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IO1GwuMHLXQJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



Re: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Sergiy Khohlov
Check this one :

https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATE_CONTEXT_PROCESSORS


2012/11/25 Luisa Beck :
> Also, I get the following error message when rendering the page with my
> local server:
>
> TemplateSyntaxError at /polls/
>
> Could not parse the remainder: 'http://poll.id/;>poll.id' from
> 'http://poll.id/;>poll.id'
>
>
> On Sunday, November 25, 2012 8:34:26 AM UTC-5, Luisa Beck wrote:
>>
>> Mm, I don't have a TEMPLATE_CONTEXT_PROCESSORS section in the setting.py
>> section.
>> The setting.py file in my version of Django only includes TEMPLATE_DEBUG,
>> TEMPLATE_LOADERS and TEMPLATE_DIRS.
>>
>> Could you specify what you mean? Thank you.
>>
>> On Sunday, November 25, 2012 8:16:00 AM UTC-5, Sergiy Khohlov wrote:
>>>
>>> looks like you have a problem with template processor
>>> could you please check setting.py section  TEMPLATE_CONTEXT_PROCESSORS
>>>
>>> 2012/11/25 Luisa Beck :
>>> > Thank you Xavier and Sergiy for your responses.
>>> >
>>> > To clarify: I put the following code (see below) into my index.html
>>> > file and
>>> > got a page displaying the code (rather than a list) when I rendered it
>>> > in my
>>> > browser by my local server:
>>> >
>>> > Could the problem have to do with my file system? I created a directory
>>> > called 'templates' in the inner 'mysites' folder and created another
>>> > directory within that called 'polls'. That's where I put the index.html
>>> > file. And I also edited TEMPLATE_DIRS in my settings.py to tell Django
>>> > the
>>> > absolute path to index.html.
>>> >
>>> > Any more thoughts about this? Thank you!
>>> >
>>> >
>>> > 
>>> >
>>> > Test
>>> >
>>> >
>>> > 
>>> >
>>> > {% if latest_poll_list %}
>>> >
>>> > 
>>> >
>>> > {% for poll in latest_poll_list %}
>>> >
>>> > {{ poll.question
>>> > }}
>>> >
>>> > {% endfor %}
>>> >
>>> > 
>>> >
>>> > {% else %}
>>> >
>>> > No polls are available.
>>> >
>>> > {% endif %}
>>> >
>>> >
>>> > 
>>> >
>>> > 
>>> >
>>> >
>>> >
>>> >
>>> > On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote:
>>> >>
>>> >> Near too.
>>> >>
>>> >>  simple example of your fitst template:
>>> >> http://www.djangobook.com/en/2.0/chapter04.html
>>> >>
>>> >>  remove all   after  to  and place your code inside
>>> >> this
>>> >>
>>> >> 2012/11/25 Luisa Beck :
>>> >> > I'm in the process of going through the Django tutorials.
>>> >> > I'm having trouble with loading the index.html file into the
>>> >> > browser. I
>>> >> > don't see a bulleted-list containing the "What's up" poll from
>>> >> > Tutorial
>>> >> > 1.
>>> >> > Instead, I'm simply seeing the code that I pasted from green box
>>> >> > (see
>>> >> > middle
>>> >> > of the page in the tutorial- I've also pasted it below).
>>> >> > The tutorial says "put the following code in that template". Does it
>>> >> > mean
>>> >> > that the code is supposed to go into the index.html file that I
>>> >> > created?
>>> >> >
>>> >> > Thanks!
>>> >> >
>>> >> > {% if latest_poll_list %}
>>> >> > 
>>> >> > {% for poll in latest_poll_list %}
>>> >> > {{ poll.question
>>> >> > }}
>>> >> > {% endfor %}
>>> >> > 
>>> >> > {% else %}
>>> >> > No polls are available.
>>> >> > {% endif %}
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google
>>> >> > Groups
>>> >> > "Django users" group.
>>> >> > To view this discussion on the web visit
>>> >> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ.
>>> >> > To post to this group, send email to django...@googlegroups.com.
>>> >> > To unsubscribe from this group, send email to
>>> >> > django-users...@googlegroups.com.
>>> >> > For more options, visit this group at
>>> >> > http://groups.google.com/group/django-users?hl=en.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "Django users" group.
>>> > To view this discussion on the web visit
>>> > https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ.
>>> >
>>> > To post to this group, send email to django...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > django-users...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-0o7jEx-H-4J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to 

Re: Comment user field

2012-11-25 Thread Lachlan Musicman
On Friday, November 23, 2012, Lachlan Musicman wrote:

> It should be obvious, but I can't quite grok how to set the comment
> user to request.user in the comments/form.html
>
> I have a copy of comments/form.html in my templates folder in which
> I've removed the email and the url fields, but now I want to either
> set the default and auto fill to the user name or just to hide the
> field but to put the user name in the POST data.
>

Don't mind me.

For future reference:

Copied blatantly from base.html, added this field to the form.html


and removed the URL, email and name fields from the if field.errors part of
the loop.

cheers
L.


-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

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



Re: Django MongoDB

2012-11-25 Thread Carlos Aguilar
You know which mongoengine and django-nonrel are 2 different libraries for
mongodb???

Please select one and use it, but not both.

Best Regards

-- 
Carlos Aguilar
Consultor Hardware y Software
DWD
http://www.dwdandsolutions.com
http://www.houseofsysadmin.com
Cel: +50378735118
USA: (301) 337-8541

-- 
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: I install v1.5 Django, and run a my first site, then have an error: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte. I use Sublime editor.

2012-11-25 Thread Julien Phalip
Hi,

Can you please post the entire traceback?

Thanks!

Julien

On Sunday, November 25, 2012 4:03:11 PM UTC+1, 名宏贾 wrote:
>
>  I don't know why, editer have default utf-8 setting.

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



Django MongoDB

2012-11-25 Thread Victor Manuel Quiñones Victor
Hi guys


I'm having problems settings Django 1.4 with MongoDB. I already have
installed
MongoEngine and Django-nonrel from git repos, but still with problem.
I read somewhere that Django 1.4 it is not full compatible with MongoDB yet?

Error Message:

 File
"/usr/local/lib/python2.7/dist-packages/django_mongodb_engine/__init__.py",
line 13, in 
settings.INSTALLED_APPS.insert(0, 'django_mongodb_engine')
AttributeError: 'tuple' object has no attribute 'insert'

Any help?

Thank you all.

Victor


-- 
Quiñones Victor Manuel
Tel: +54 0362 15 4 880839
Resistencia - 3500
Argentina

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



I install v1.5 Django, and run a my first site, then have an error: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte. I use Sublime editor.

2012-11-25 Thread 名宏贾
 I don't know why, editer have default utf-8 setting.

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



Re: Django ORM

2012-11-25 Thread Alexandra Paredes
Hi Russ, 

Thanks for the response, well we're thinking in modifying Django ORM to add 
some requeriments we consider important on databases. And specially if you 
already have the DB already build and want to import it to build the model 
part of the app. We're studying the code and we wonder if we can ask 
questions or received some kind of support when working with the ORM itself,

Thanks again

El miércoles, 21 de noviembre de 2012 19:35:13 UTC-4:30, Russell 
Keith-Magee escribió:
>
>
> On Thu, Nov 22, 2012 at 7:34 AM, Alexandra Paredes 
> <05-3...@usb.ve
> > wrote:
>
>> Good afternoon,
>>
>> I'm an student of Computer Engineering from Simón Bolívar University, in 
>> Caracas Venezuela. I'm working with a friend on a thesis about ORM and 
>> their "respectfulness" on databases.For a better understanding of Django 
>> ORM,  we tried to read the code itself as subject by Russ Magee on an 
>> email, but know we're wondering what would it be the consequences of not 
>> working with Django ORM, What features of the framework may be affected. 
>>
>> The only things that will be affected are things that need to access the 
> database. Anything else -- request handling, form handling, caching, 
> sending mail, and so on -- will continue to work fine. I've even heard of 
> people using Django's requests and views, but using SQLAlchemy or NoSQL 
> libraries for data store access.
>
> The side effect of this will be that you lose the benefits of the most of 
> the ecosystem of Django apps -- for example, you won't even be able to use 
> the contrib auth or admin apps unless you're using the ORM -- but that's 
> just because they need to store and/or access data in a database. Django's 
> ORM provides a common language for data access that 3rd party apps can rely 
> on; if you're not going to use that common language, you're going to need 
> to build a lot on your own.
>
> So - the short version -- the ORM is only used to access and modify data 
> in a database. As long as you're not doing that, you don't need to use the 
> ORM. However, most websites will be accessing a data store at some time, in 
> practice, this is a pretty big limitation.
>
> Yours,
> Russ Magee %-)
>

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



Django-oscar Add to basket issue

2012-11-25 Thread Aswathy Raju

   Hi All,

   I am trying to integrate an ecommerce section  to my project using 
"Django - Oscar" .Here when I try to add a product to my  
   basket I got following error ..


AttributeError at /store/basket/add/

'WSGIRequest' object has no attribute 'basket'

 Request Method: POST

 Request URL: http://localhost:8000/store/basket/add/

 Django Version: 1.4.2

 Exception Type: AttributeError

 Exception Value: 

'WSGIRequest' object has no attribute 'basket'

 Exception Location: /myProject/apps/myecommerce/basket/views.py in 
get_form_kwargs, line 160

 Python Executable: /usr/bin/python

 Python Version: 2.7.3




 Please help me to solve this issue ..


Thanks,


















































-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ZT1nE2vLk9UJ.
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.



Postgres pgadmin3 & pgpass permissioning question

2012-11-25 Thread Andrew Taylor
Hi all,

Tenuous Django link but thought no one would mind if I asked the following:

Can I bypass the need for password entry in pgadmin3 by changing/locating a 
.pgpass files instead of modifying pg_hba.conf to 'trust'? pg_hba.conf 
currently set at md5 for everything.

1. I can merrily connect to the postgres server on my local ubuntu machine 
as user postgres in bash by "su postgres" then "psql". 
2. But if I want to be able to use pgadmin 3 GUI without entering a 
password I need to do this as my user, andyt and this doesn't work (I did 
chmod 600 this file to give rw access to one owner only). This feels like a 
permissioning issue but with that chmod 600 restriction on pgpass I'm not 
sure how to progress.

I have been messing around with strace trying to figure out the location of 
pgpass which is being sought out when I run psql/pgadmin3 but the results 
are inconclusive. They both (now)seem to be looking in the andyt home 
directory. Not sure if this was the case earlier, sorry! I was earlier 
placing .pgpass here there and everythwhere, but in particular 
/var/lib/postresql.

Grateful for any guidance,

Regards,

Andy

*Key file contents:*

*1 pg_hba.conf:*

local   all postgresmd5
# local   all postgrestrust

# TYPE  DATABASEUSERADDRESS METHOD

# "local" is for Unix domain socket connections only
local   all all md5
# local   all all trust
local django_db django_dev md5
# local   django_db   django_dev  trust
# IPv4 local connections:
hostall all 127.0.0.1/32md5
# hostall all 127.0.0.1/32trust
# IPv6 local connections:
hostall all ::1/128 md5
# hostall all ::1/128 trust

*2 ,pgpass*
127.0.0.1:5432:*:postgres:Passowrd@
:5432:*:django_dev:Password@




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WrCXCoEpc7kJ.
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 config my django project to use tastypie and mongoengine

2012-11-25 Thread Chanh Le
In the settings.py
import mongoengine
mongoengine.connect('cooking')
AUTHENTICATION_BACKENDS = (
'mongoengine.django.auth.MongoEngineBackend',
)
SESSION_ENGINE = 'mongoengine.django.sessions'


MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',

# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'tastypie',
'tastypie_mongoengine',
'django.contrib.sessions',
'api',
)

But when run syncdb it has error
 django.core.exceptions.ImproperlyConfigured: settings.DATABASES is 
improperly configured. Please supply the ENGINE value.
How to config this correct?

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

# Django settings for socialcooking project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS


import mongoengine
mongoengine.connect('cooking')
AUTHENTICATION_BACKENDS = (
'mongoengine.django.auth.MongoEngineBackend',
)
SESSION_ENGINE = 'mongoengine.django.sessions'



#DATABASES = {
#'default': {
#'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
#'NAME': '', # Or path to database file if using sqlite3.
#'USER': '', # Not used with sqlite3.
#'PASSWORD': '', # Not used with sqlite3.
#'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
#'PORT': '', # Set to empty string for default. Not used with sqlite3.
#}
#}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/;, "http://example.com/media/;
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/;
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '@b$#)$w^6d8ogxdih@i2gwubv5$im)!dl@^y7w50w1x3==7!p'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',

Django Oscar "Add to basket" issue

2012-11-25 Thread Aswathy Raju

 Hi All,

 I am trying to integrate ecommerce section  to my project using Django 
Osacr . When I try to add one product to my basket I got this error

AttributeError at /store/basket/add/

'WSGIRequest' object has no attribute 'basket'

Request Method: POST  Request URL: http://localhost:8000/store/basket/add/  
Django 
Version: 1.4.2  Exception Type: AttributeError  Exception Value: 

'WSGIRequest' object has no attribute 'basket'

 Exception Location: /myProject/apps/myecommerce/basket/views.py in 
get_form_kwargs, line 160  Python Executable: /usr/bin/python  Python 
Version: 2.7.3  Python Path: 

['/usr/local/lib/python2.7/dist-packages/requests/packages',




Please help me to solve this issue..

Thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uoQwaiw-5P0J.
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: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Luisa Beck
Also, I get the following error message when rendering the page with my 
local server:

TemplateSyntaxError at /polls/

Could not parse the remainder: 'http://poll.id/;>poll.id' from 'http://poll.id/;>poll.id'


On Sunday, November 25, 2012 8:34:26 AM UTC-5, Luisa Beck wrote:
>
> Mm, I don't have a TEMPLATE_CONTEXT_PROCESSORS section in the setting.py 
> section. 
> The setting.py file in my version of Django only includes TEMPLATE_DEBUG, 
> TEMPLATE_LOADERS and TEMPLATE_DIRS. 
>
> Could you specify what you mean? Thank you. 
>
> On Sunday, November 25, 2012 8:16:00 AM UTC-5, Sergiy Khohlov wrote:
>>
>> looks like you have a problem with template processor 
>> could you please check setting.py section  TEMPLATE_CONTEXT_PROCESSORS 
>>
>> 2012/11/25 Luisa Beck : 
>> > Thank you Xavier and Sergiy for your responses. 
>> > 
>> > To clarify: I put the following code (see below) into my index.html 
>> file and 
>> > got a page displaying the code (rather than a list) when I rendered it 
>> in my 
>> > browser by my local server: 
>> > 
>> > Could the problem have to do with my file system? I created a directory 
>> > called 'templates' in the inner 'mysites' folder and created another 
>> > directory within that called 'polls'. That's where I put the index.html 
>> > file. And I also edited TEMPLATE_DIRS in my settings.py to tell Django 
>> the 
>> > absolute path to index.html. 
>> > 
>> > Any more thoughts about this? Thank you! 
>> > 
>> > 
>> >  
>> > 
>> > Test 
>> > 
>> > 
>> >  
>> > 
>> > {% if latest_poll_list %} 
>> > 
>> >  
>> > 
>> > {% for poll in latest_poll_list %} 
>> > 
>> > {{ poll.question 
>> }} 
>> > 
>> > {% endfor %} 
>> > 
>> >  
>> > 
>> > {% else %} 
>> > 
>> > No polls are available. 
>> > 
>> > {% endif %} 
>> > 
>> > 
>> >  
>> > 
>> >  
>> > 
>> > 
>> > 
>> > 
>> > On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote: 
>> >> 
>> >> Near too. 
>> >> 
>> >>  simple example of your fitst template: 
>> >> http://www.djangobook.com/en/2.0/chapter04.html 
>> >> 
>> >>  remove all   after  to  and place your code inside 
>> this 
>> >> 
>> >> 2012/11/25 Luisa Beck : 
>> >> > I'm in the process of going through the Django tutorials. 
>> >> > I'm having trouble with loading the index.html file into the 
>> browser. I 
>> >> > don't see a bulleted-list containing the "What's up" poll from 
>> Tutorial 
>> >> > 1. 
>> >> > Instead, I'm simply seeing the code that I pasted from green box 
>> (see 
>> >> > middle 
>> >> > of the page in the tutorial- I've also pasted it below). 
>> >> > The tutorial says "put the following code in that template". Does it 
>> >> > mean 
>> >> > that the code is supposed to go into the index.html file that I 
>> created? 
>> >> > 
>> >> > Thanks! 
>> >> > 
>> >> > {% if latest_poll_list %} 
>> >> >  
>> >> > {% for poll in latest_poll_list %} 
>> >> > {{ poll.question 
>> }} 
>> >> > {% endfor %} 
>> >> >  
>> >> > {% else %} 
>> >> > No polls are available. 
>> >> > {% endif %} 
>> >> > 
>> >> > -- 
>> >> > You received this message because you are subscribed to the Google 
>> >> > Groups 
>> >> > "Django users" group. 
>> >> > To view this discussion on the web visit 
>> >> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. 
>> >> > To post to this group, send email to django...@googlegroups.com. 
>> >> > To unsubscribe from this group, send email to 
>> >> > django-users...@googlegroups.com. 
>> >> > For more options, visit this group at 
>> >> > http://groups.google.com/group/django-users?hl=en. 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "Django users" group. 
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ. 
>> > 
>> > To post to this group, send email to django...@googlegroups.com. 
>> > To unsubscribe from this group, send email to 
>> > django-users...@googlegroups.com. 
>> > For more options, visit this group at 
>> > http://groups.google.com/group/django-users?hl=en. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-0o7jEx-H-4J.
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: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Luisa Beck
Mm, I don't have a TEMPLATE_CONTEXT_PROCESSORS section in the setting.py 
section. 
The setting.py file in my version of Django only includes TEMPLATE_DEBUG, 
TEMPLATE_LOADERS and TEMPLATE_DIRS. 

Could you specify what you mean? Thank you. 

On Sunday, November 25, 2012 8:16:00 AM UTC-5, Sergiy Khohlov wrote:
>
> looks like you have a problem with template processor 
> could you please check setting.py section  TEMPLATE_CONTEXT_PROCESSORS 
>
> 2012/11/25 Luisa Beck : 
> > Thank you Xavier and Sergiy for your responses. 
> > 
> > To clarify: I put the following code (see below) into my index.html file 
> and 
> > got a page displaying the code (rather than a list) when I rendered it 
> in my 
> > browser by my local server: 
> > 
> > Could the problem have to do with my file system? I created a directory 
> > called 'templates' in the inner 'mysites' folder and created another 
> > directory within that called 'polls'. That's where I put the index.html 
> > file. And I also edited TEMPLATE_DIRS in my settings.py to tell Django 
> the 
> > absolute path to index.html. 
> > 
> > Any more thoughts about this? Thank you! 
> > 
> > 
> >  
> > 
> > Test 
> > 
> > 
> >  
> > 
> > {% if latest_poll_list %} 
> > 
> >  
> > 
> > {% for poll in latest_poll_list %} 
> > 
> > {{ poll.question 
> }} 
> > 
> > {% endfor %} 
> > 
> >  
> > 
> > {% else %} 
> > 
> > No polls are available. 
> > 
> > {% endif %} 
> > 
> > 
> >  
> > 
> >  
> > 
> > 
> > 
> > 
> > On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote: 
> >> 
> >> Near too. 
> >> 
> >>  simple example of your fitst template: 
> >> http://www.djangobook.com/en/2.0/chapter04.html 
> >> 
> >>  remove all   after  to  and place your code inside 
> this 
> >> 
> >> 2012/11/25 Luisa Beck : 
> >> > I'm in the process of going through the Django tutorials. 
> >> > I'm having trouble with loading the index.html file into the browser. 
> I 
> >> > don't see a bulleted-list containing the "What's up" poll from 
> Tutorial 
> >> > 1. 
> >> > Instead, I'm simply seeing the code that I pasted from green box (see 
> >> > middle 
> >> > of the page in the tutorial- I've also pasted it below). 
> >> > The tutorial says "put the following code in that template". Does it 
> >> > mean 
> >> > that the code is supposed to go into the index.html file that I 
> created? 
> >> > 
> >> > Thanks! 
> >> > 
> >> > {% if latest_poll_list %} 
> >> >  
> >> > {% for poll in latest_poll_list %} 
> >> > {{ poll.question 
> }} 
> >> > {% endfor %} 
> >> >  
> >> > {% else %} 
> >> > No polls are available. 
> >> > {% endif %} 
> >> > 
> >> > -- 
> >> > You received this message because you are subscribed to the Google 
> >> > Groups 
> >> > "Django users" group. 
> >> > To view this discussion on the web visit 
> >> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. 
> >> > To post to this group, send email to django...@googlegroups.com. 
> >> > To unsubscribe from this group, send email to 
> >> > django-users...@googlegroups.com. 
> >> > For more options, visit this group at 
> >> > http://groups.google.com/group/django-users?hl=en. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ. 
> > 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/UTLN4SU6L6sJ.
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: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Sergiy Khohlov
looks like you have a problem with template processor
could you please check setting.py section  TEMPLATE_CONTEXT_PROCESSORS

2012/11/25 Luisa Beck :
> Thank you Xavier and Sergiy for your responses.
>
> To clarify: I put the following code (see below) into my index.html file and
> got a page displaying the code (rather than a list) when I rendered it in my
> browser by my local server:
>
> Could the problem have to do with my file system? I created a directory
> called 'templates' in the inner 'mysites' folder and created another
> directory within that called 'polls'. That's where I put the index.html
> file. And I also edited TEMPLATE_DIRS in my settings.py to tell Django the
> absolute path to index.html.
>
> Any more thoughts about this? Thank you!
>
>
> 
>
> Test
>
>
> 
>
> {% if latest_poll_list %}
>
> 
>
> {% for poll in latest_poll_list %}
>
> {{ poll.question }}
>
> {% endfor %}
>
> 
>
> {% else %}
>
> No polls are available.
>
> {% endif %}
>
>
> 
>
> 
>
>
>
>
> On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote:
>>
>> Near too.
>>
>>  simple example of your fitst template:
>> http://www.djangobook.com/en/2.0/chapter04.html
>>
>>  remove all   after  to  and place your code inside this
>>
>> 2012/11/25 Luisa Beck :
>> > I'm in the process of going through the Django tutorials.
>> > I'm having trouble with loading the index.html file into the browser. I
>> > don't see a bulleted-list containing the "What's up" poll from Tutorial
>> > 1.
>> > Instead, I'm simply seeing the code that I pasted from green box (see
>> > middle
>> > of the page in the tutorial- I've also pasted it below).
>> > The tutorial says "put the following code in that template". Does it
>> > mean
>> > that the code is supposed to go into the index.html file that I created?
>> >
>> > Thanks!
>> >
>> > {% if latest_poll_list %}
>> > 
>> > {% for poll in latest_poll_list %}
>> > {{ poll.question }}
>> > {% endfor %}
>> > 
>> > {% else %}
>> > No polls are available.
>> > {% endif %}
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Django users" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ.
>> > To post to this group, send email to django...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



Re: Tutorial Part 3: loading index.html in browser

2012-11-25 Thread Luisa Beck
Thank you Xavier and Sergiy for your responses. 

To clarify: I put the following code (see below) into my index.html file 
and got a page displaying the code (rather than a list) when I rendered it 
in my browser by my local server:

Could the problem have to do with my file system? I created a directory 
called 'templates' in the inner 'mysites' folder and created another 
directory within that called 'polls'. That's where I put the index.html 
file. And I also edited 
TEMPLATE_DIRS
 in 
my settings.py to tell Django the absolute path to index.html. 

Any more thoughts about this? Thank you!




Test




{% if latest_poll_list %}



{% for poll in latest_poll_list %}

{{ poll.question }}

{% endfor %}



{% else %}

No polls are available.

{% endif %}









On Saturday, November 24, 2012 5:48:29 PM UTC-5, Sergiy Khohlov wrote:
>
> Near too. 
>
>  simple example of your fitst template: 
> http://www.djangobook.com/en/2.0/chapter04.html 
>
>  remove all   after  to  and place your code inside this 
>
> 2012/11/25 Luisa Beck : 
> > I'm in the process of going through the Django tutorials. 
> > I'm having trouble with loading the index.html file into the browser. I 
> > don't see a bulleted-list containing the "What's up" poll from Tutorial 
> 1. 
> > Instead, I'm simply seeing the code that I pasted from green box (see 
> middle 
> > of the page in the tutorial- I've also pasted it below). 
> > The tutorial says "put the following code in that template". Does it 
> mean 
> > that the code is supposed to go into the index.html file that I created? 
> > 
> > Thanks! 
> > 
> > {% if latest_poll_list %} 
> >  
> > {% for poll in latest_poll_list %} 
> > {{ poll.question 
> }} 
> > {% endfor %} 
> >  
> > {% else %} 
> > No polls are available. 
> > {% endif %} 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/django-users/-/xwta_28JByIJ. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/vZnRe-IPpLEJ.
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.



Seeking pattern for building URLs with all query parameters intact

2012-11-25 Thread Darren Spruell
I've got a handful of applications that feature paginated object lists
as well as a search dialog allowing users to search for simple object
attributes.

What is the common pattern to use in Django apps to build URI query
strings in view code that can preserve parameters for rendering links
in templates? In my case I'd like to handle the following:

1. User searches for string, passed as GET parameter and application
returns paginated object list the spans multiple pages
2. First page contains links for subsequent pages ('page' parameter in
URI query string) and preserves search string (additional 'search'
parameter in URI query string)

So far I've taken key/value pairs out of request.GET and added them to
the context as more_query_params and passed them in to templates. This
seems a little raw and klugey although it works for the simple cases.
There must be a better way. Currently (from a view that returns
paginated object list:

# Determine other parameters from request, provide to template to craft
# smarter URLs that handle concurrent search + pagination (etc.).
if request.method == 'GET':
more_query_params = ''
for key, value in request.GET.items():
if key != 'page':
more_query_params += '&%s=%s' % (key, value)
return render_to_response('submissionlog_pages.html', {
'submissionlogs': submissionlogs,
'search_form': search_form,
'more_query_params': more_query_params,
}, context_instance=RequestContext(request))

What are better ways to handle this?

-- 
Darren Spruell
phatbuck...@gmail.com

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