python inspectdb got "The error was: function unnest(smallint[]) does not exist"

2018-06-20 Thread weiwei . hsieh
I use Amazon Redshift database and Django 2.0.6.   My redshift database 
settings is as below:

DATABASES = {

'default': {

'NAME': 'my_db_name',

'ENGINE': 'django.db.backends.postgresql_psycopg2',

'USER': 'my_username',

'PASSWORD': 'my_password',

'HOST': 'my_hostname',

'PORT': 5439,

},

}


When I run "python3 manage.py inspectdb", I got below error messages:


# Unable to inspect table 'eld_messages'

# The error was: function unnest(smallint[]) does not exist

HINT:  No function matches the given name and argument types. You may need 
to add explicit type casts.

-- 
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/c80569a6-2beb-4cbd-ad71-ed8470c645c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django simple captcha issue

2010-07-01 Thread weiwei
Hi all,

I am using django-simple-captcha, it works fine on my dev environment
(windows). But after i deployed to linux server, all other views/pages
are working fine. But  when i request  /captcha/image/{{imagekey}}/ i
got server internal error 500.

Something I missed to configure?

Thanks a lot

-- 
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 queryset issue

2010-05-27 Thread weiwei
Hi all,
Here is my question details
http://stackoverflow.com/questions/2915880/django-objects-all-method-...
this is driving me crazy, after a save(), i can see the new data in
mysal db, but i cannot get new data from queryset.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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 activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread weiwei
Thanks a lot, i did miss to pass

context_instance=RequestContext(request) in

my view code

def access(request):
return
render_to_response('tool.html',context_instance=RequestContext(request))

after I added "context_instance=RequestContext(request)"

It is working now like a charm!

Thanks again!


On Feb 4, 11:54 am, Karen Tracey <kmtra...@gmail.com> wrote:
> On Thu, Feb 4, 2010 at 2:39 PM, weiwei <online.service@gmail.com> wrote:
> > Thanks..
>
> > Here is my code
>
> You repeated the code for the template tag and the context processors
> setting; that's not what I asked for.
>
> I still don't see the code for the view that renders the template that
> includes the template tag you are working with.  That is the code that must
> specify a RequestContext if you want to access the variables set by the
> request context processor in your template tag. The context processor won't
> set variables in a plain Context, the view code (or whatever code is
> supplying the context for the template render) must specify a
> RequestContext. See for example 'some_view' under:
>
> http://docs.djangoproject.com/en/dev/ref/templates/api/#id1
>
> 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-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 activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread weiwei
Thanks..

Here is my code

from django import template
from django.template import RequestContext

register = template.Library()


@register.inclusion_tag('userinfo.html',takes_context = True)
def userinfo(context):
request = context['request']
address = request.session['address']
return {'address':address}

 and request = context['request'] causing problem, seems context
doesn't have a key 'request'


And i do have

TEMPLATE_CONTEXT_PROCESSORS =(
"django.core.context_processors.request",
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
)

in settings.py
On Feb 4, 11:17 am, Karen Tracey <kmtra...@gmail.com> wrote:
> On Thu, Feb 4, 2010 at 1:41 PM, weiwei <online.service@gmail.com> wrote:
> > "DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST
> > If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every
> > RequestContext will contain a variable request, which is the current
> > HttpRequest. Note that this processor is not enabled by default;
> > you'll have to activate it. " from this page
>
> >http://docs.djangoproject.com/en/dev/ref/templates/api/
>
> > But i didn't find how to activate it
>
> You activate it by including it in TEMPLATE_CONTEXT_PROCESSORS in
> settings.py.  That is all you have to do.
>
> > Here is my question
>
> >http://stackoverflow.com/questions/2160261/access-request-in-django-c...
>
> > after i followed the answer i still got errors
>
> I do not see where you show the view code in that question. Possibly you are
> not using a RequestContext to render the template?
>
> 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-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 activate DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST

2010-02-04 Thread weiwei
"DJANGO.CORE.CONTEXT_PROCESSORS.REQUEST
If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every
RequestContext will contain a variable request, which is the current
HttpRequest. Note that this processor is not enabled by default;
you'll have to activate it. " from this page

http://docs.djangoproject.com/en/dev/ref/templates/api/

But i didn't find how to activate it

Here is my question

http://stackoverflow.com/questions/2160261/access-request-in-django-custom-template-tags

after i followed the answer i still got errors

TemplateSyntaxError at / Caught an exception while rendering:
'request' Original Traceback (most recent call last): File "C:
\Python25\lib\site-packages\django\template\debug.py", line 71, in
render_node result = node.render(context) File "C:\Python25\lib\site-
packages\django\template__init__.py", line 936, in render dict =
func(*args) File "c:\...\myapp_extras.py", line 7, in login request =
context['request'] File "C:\Python25\lib\site-packages\django\template
\context.py", line 44, in getitem raise KeyError(key) KeyError:
'request'

tho code causing problem is

request = context['request']




Thanks for any 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-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.



dump utf8 data from database

2010-01-25 Thread Weiwei
Hi all,

is there a easy way to dump utf8 data from database?

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-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 fuzzy string translation not showing up

2009-09-04 Thread weiwei



1)why sometimes i got 'fuzzy' item in django.po language file .
Actually i have checked in my project the 'fuzzy' string item is
totally unique.

#: .\users\views.py:81 .\users\views.py:101
#, fuzzy
msgid "username or email"
msgstr "9988"

2) It is ok to be fuzzy but my translation of fuzzy item not showing
up on the page , only English version shows up. It is totally odd.

Thanks for any 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: ImportError No module named myapp.views.hometest

2009-08-31 Thread weiwei

forgot to mention i am using django1.1

On Aug 31, 5:35 pm, weiwei <online.service@gmail.com> wrote:
> backgroud information:
> server: fedora11
> web server : apache 2.2 + mod_wsgi2.5
>
> my project location
> '/usr/local/django/myproject'
> '/usr/local/django/myproject/myapp'
>
> in the django.wsgi i have
>
> ---
> sys.path.append('/usr/local/django')
> sys.path.append('/usr/local/django/myproject')
> -
>
> In the debug information i already saw python path '[/usr/local/
> django]'
>
> And i have everything under /usr/local/django readable an
> executable .
>
> i still got this error.  Something else i need to check?
>
> Thanks for any 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
-~--~~~~--~~--~--~---



ImportError No module named myapp.views.hometest

2009-08-31 Thread weiwei

backgroud information:
server: fedora11
web server : apache 2.2 + mod_wsgi2.5

my project location
'/usr/local/django/myproject'
'/usr/local/django/myproject/myapp'

in the django.wsgi i have

---
sys.path.append('/usr/local/django')
sys.path.append('/usr/local/django/myproject')
-

In the debug information i already saw python path '[/usr/local/
django]'

And i have everything under /usr/local/django readable an
executable .

i still got this error.  Something else i need to check?


Thanks for any 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: quick question: how to have *.domainname.com url in django

2009-07-31 Thread weiwei

Could you please expand  the process " send all those names to the
same Django instance" a little bit more detailed?


Thanks


On Jul 31, 7:17 am, Javier Guerra <jav...@guerrag.com> wrote:
> On Fri, Jul 31, 2009 at 12:26 AM, weiwei<online.service@gmail.com> wrote:
> > thanks, i was thinking to have each user have a url 
> > ashttp://username.domain.com/
>
> after you manage to configure your frontend server (apache, lightttpd,
> nginx, whatever) to send all those names to the same Django instance,
> i'd just write a middleware that picks the name from the original URL
> and stores it (or maybe the whole User object) in the request.
>
> --
> Javier
--~--~-~--~~~---~--~~
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: quick question: how to have *.domainname.com url in django

2009-07-30 Thread weiwei

thanks, i was thinking to have each user have a url as 
http://username.domain.com/

like http://hiphopo.posterous.com/





On Jul 30, 10:20 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> On Jul 31, 3:09 pm, weiwei <online.service@gmail.com> wrote:
>
> > Hello all,
>
> > I know there are lots of example for how to sethttp://domainname.com/*
> > url. But how to have http://*.domainname.com   url in django?
>
> Really depends on what you are trying to achieve and how you are
> hosting Django.
>
> Apache provides a way of having wild card alias for hostnames and so
> possible to direct requests for multiple domains to same Django
> instance.
>
> Is that all you are concerned about, or is what you really want to
> know is how then to access the host name from Django handlers so as to
> act on it, or how to have different host names automatically delegated
> to different handlers inside same Django instance.
>
> Graham
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



quick question: how to have *.domainname.com url in django

2009-07-30 Thread weiwei

Hello all,

I know there are lots of example for how to set http://domainname.com/*
url. But how to have http://*.domainname.com   url in django?


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