Re: AttributeError: cffi library '_constant_time' has no function, constant or global variable named '__spec__'

2019-10-21 Thread Jorge Gimeno
set(_error_files)) > File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line > 124, in iter_modules_and_files > if getattr(module, '__spec__', None) is None: > SystemError: returned a result with an error > set > > > > On Sund

Re: AttributeError: cffi library '_constant_time' has no function, constant or global variable named '__spec__'

2019-10-20 Thread 'Abhishek Sharma' via Django users
a result with an error set On Sunday, October 20, 2019 at 8:27:48 PM UTC+5:30, Abhishek Sharma wrote: > > I'm using Django and while run code getting below error, please help out > on it > > AttributeError: cffi library '_constant_time' has no function, constant or > global

AttributeError: cffi library '_constant_time' has no function, constant or global variable named '__spec__'

2019-10-20 Thread 'Abhishek Sharma' via Django users
I'm using Django and while run code getting below error, please help out on it AttributeError: cffi library '_constant_time' has no function, constant or global variable named '__spec__' -- The information in this e-mail and any attachments is confid

Re: Strange the global variable behavior

2018-01-23 Thread Antonis Christofides
..@gmail.com>> wrote: >> >> Hi there. >> Could someone explain what happens. I had a little project on Python 2.7 and >> decided to move it on 3.6. Everything has gone by perfectly. The project >> works well as before but there is one exception noticed by me:

Re: Strange the global variable behavior

2018-01-23 Thread Costja Covtushenko
move it on 3.6. Everything has gone by perfectly. The project > works well as before but there is one exception noticed by me: the global > statement works not always. The code below doesn't update the global variable > zip_file_name and I can't grasp why. Any suggestions. > >

RE: Strange the global variable behavior

2018-01-23 Thread Matthew Pava
the global variable behavior Hi there. Could someone explain what happens. I had a little project on Python 2.7 and decided to move it on 3.6. Everything has gone by perfectly. The project works well as before but there is one exception noticed by me: the global statement works not always. The

Strange the global variable behavior

2018-01-23 Thread Максим Королёв
e the global variable zip_file_name and I can't grasp why. On Python 2.7 everything worked properly. Any suggestions zip_file_name = '' file_list = [] @permission_required("wb_search.change_wbsearch", login_url='access_denied') @csrf_exempt def input_data

Strange the global variable behavior

2018-01-23 Thread Максим Королёв
e the global variable zip_file_name and I can't grasp why. Any suggestions. zip_file_name = os.path.join(MEDIA_ROOT, 'wb`s.zip') file_list = [] @permission_required("wb_search.change_wbsearch", login_url='access_denied') @csrf_exempt def input_data_form(reque

Re: Global variable

2016-04-19 Thread Gabriel Marcondes
Ciao Luca, Take a look at django's i18n [0], it will spare you a lot of work. [0] https://docs.djangoproject.com/es/1.9/topics/i18n/ On Tue, Apr 19, 2016 at 11:27 AM, 'luca72' via Django users < django-users@googlegroups.com> wrote: > hello my view.py is like this: > > from django.contrib impor

Global variable

2016-04-19 Thread 'luca72' via Django users
hello my view.py is like this: from django.contrib import auth from django.contrib.auth.decorators import login_required from django.db import models from django.core.files.storage import FileSystemStorage #from django.core.servers.basehttp import FileWrapper from django.contrib.auth import authen

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Henry Versemann
le objects > in my response I only want to add the new data field keys to the display > key list once. The flag will be initialized to false at the beginning of > the process which processes all of the responses. So the only way I could > think of to do this would be to setup some kin

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Gergely Polonkai
Hello, I think the source of your frustration is that you started on the wrong track. If you create a global variable here, *all* your users will see the same fields. I guess it’s not really the thing you want. You have several other options here: 1) Add a user setting in the database If you

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Nikolas Stevenson-Molnar
but when I get back multiple objects in my response I only want to add the new data field keys to the display key list once. The flag will be initialized to false at the beginning of the process which processes all of the responses. So the only way I could think of to do this would be to setu

Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Henry Versemann
splay key list once. The flag will be initialized to false at the beginning of the process which processes all of the responses. So the only way I could think of to do this would be to setup some kind of global variable that can be checked and when set to "false" then and only then upd

Re: Global Variable

2014-11-05 Thread Collin Anderson
Hello, You could also try creating an assignment tag something like: {% get_base_url as base_url %} https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#assignment-tags That way you don't need to deal with context_processors. Collin -- You received this message because you are s

Re: Global Variable

2014-11-04 Thread Sudipta Sen
By the way I am using virtual environment and my django version is *1.7.1* -- 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.

Re: Global Variable

2014-11-04 Thread Andreas Kuhne
2014-11-04 14:18 GMT+01:00 Sudipta Sen : > > > -- Forwarded message - > From: Sudipta Sen > Date: Tue Nov 04 2014 at 6:46:17 PM > Subject: Global Variable > To: > > > Hi folks, > > I am very new to django and facing some problems. > > 1.

Fwd: Global Variable

2014-11-04 Thread Sudipta Sen
-- Forwarded message - From: Sudipta Sen Date: Tue Nov 04 2014 at 6:46:17 PM Subject: Global Variable To: Hi folks, I am very new to django and facing some problems. 1. I need a global variable, which I can use throughout the application. Like let's say base_url.

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-31 Thread Tom Evans
On Tue, Jan 22, 2013 at 8:01 PM, Fellipe Henrique wrote: > The problem is, I need to pass this request.user to one form, using a > inlineformset_factory..in these code: > > class PedidoItensForm(ModelForm): > class Meta: > model = ItensPedido > > def __init__(self, *args, **kwargs)

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-23 Thread Tomas Neme
> I don`t understand that.. in my form, I don't have the request, or I have? > > I know I have request in my view, but I need to pass UserProfile to my form, > but inlineformset_factory doesn't accept to pass vUserProfile as parameter, > even I modified __init__ to get this parameter. OK, so you

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-23 Thread Fellipe Henrique
t;>> >>> in your view >>> >>> >>> On Tue, Jan 22, 2013 at 4:49 PM, Mengu wrote: >>> >>>> hi fellipe, >>>> >>>> if you enable auth context processors and pass in RequestContext to >>>> render_to_response you can

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-22 Thread Tomas Neme
your model is named profile) >>> >>> please read more at >>> https://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates >>> >>> >>> >>> On Jan 22, 8:34 pm, Fellipe Henrique wrote: >>> >

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-22 Thread Fellipe Henrique
/dev/topics/auth/default/#authentication-data-in-templates >> >> >> >> On Jan 22, 8:34 pm, Fellipe Henrique wrote: >> > Hello, >> > >> > It's possible, when the user make a login, I set one "global" variable, >> and >> &

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-22 Thread Tomas Neme
/en/dev/topics/auth/default/#authentication-data-in-templates > > > > On Jan 22, 8:34 pm, Fellipe Henrique wrote: > > Hello, > > > > It's possible, when the user make a login, I set one "global" variable, > and > > get this value in my view? >

Re: Can I set a "global" variable after user login, to use in my view?

2013-01-22 Thread Mengu
://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates On Jan 22, 8:34 pm, Fellipe Henrique wrote: > Hello, > > It's possible, when the user make a login, I set one "global" variable, and > get this value in my view? > > My question is becau

Can I set a "global" variable after user login, to use in my view?

2013-01-22 Thread Fellipe Henrique
Hello, It's possible, when the user make a login, I set one "global" variable, and get this value in my view? My question is because I have a inlineformset_factory, and I need to pass a user profile do my view.. but it`s doesn't work. Regards, T.·.F.·.A.·. S+F *Fellip

Re: Dynamic settings variables (dynamic global variable)

2012-02-09 Thread bfrederi
Makes sense. I actually ended up using your example and it worked well as far as I can tell. And you actually explained the importing too, which is where I messed up previously. Also, I made the mistake of putting it in a file that was already importing a bunch of other things, so I got wrapped up

Re: Dynamic settings variables (dynamic global variable)

2012-02-09 Thread Doug Ballance
> Doug, I don't see how the LazyFetch you wrote is much different than > what akaariai shared? Can you explain to me what the difference is? > And I'm not saying that in a condescending way, I'm saying I'm just > not sharp enough on my Python to recognize the difference. Slightly different impleme

Re: Dynamic settings variables (dynamic global variable)

2012-02-09 Thread bfrederi
I tried akaariai's method, but I may have done the importing wrong. It seemed to make apache struggle mightily to the point where it was unusable for some reason. Doug, I don't see how the LazyFetch you wrote is much different than what akaariai shared? Can you explain to me what the difference is

Re: Dynamic settings variables (dynamic global variable)

2012-02-09 Thread bfrederi
Thanks Andy, I didn't know you could use a cache by name. That will be helpful. On Feb 8, 9:22 pm, Andy McKay wrote: > You can define multiple caches: > > https://docs.djangoproject.com/en/1.3/topics/cache/#django-s-cache-fr... > > You could then use a file system cache or your own local memcache

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread Doug Ballance
I made an error when I changed a variable name just before posting. Replace "self._age" with "self._last_updated". -- 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

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread Doug Ballance
A method similar to what Anssi describes is what we use for local caching of data that is too large to comfortably fetch from cache/ parse from file every time we need it. A Doing a lazy fetch with a maximum age like that also helps with load times since it is only fetched when accessed. Of course

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread Andy McKay
You can define multiple caches: https://docs.djangoproject.com/en/1.3/topics/cache/#django-s-cache-framework You could then use a file system cache or your own local memcache. https://docs.djangoproject.com/en/1.3/topics/cache/#filesystem-caching You can then get that cache and access it in you

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread bfrederi
wondering why it might be a good/bad idea to > >make the urllib request in the settings.py. It's data that gets > >changed infrequently, but should update every once in a while, but I'd > >prefer that it stayed in local memory as much as possible, since it > >get

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread Brett Epps
t;make the urllib request in the settings.py. It's data that gets >changed infrequently, but should update every once in a while, but I'd >prefer that it stayed in local memory as much as possible, since it >gets used so much. Any advice on how to make a dynamic global variable >like tha

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread bfrederi
every once in a while, but I'd > > prefer that it stayed in local memory as much as possible, since it > > gets used so much. Any advice on how to make a dynamic global variable > > like that is much appreciated. > > Don't do that in settings.py. Use Django's

Re: Dynamic settings variables (dynamic global variable)

2012-02-08 Thread akaariai
settings.py. It's data that gets > changed infrequently, but should update every once in a while, but I'd > prefer that it stayed in local memory as much as possible, since it > gets used so much. Any advice on how to make a dynamic global variable > like that is much apprecia

Dynamic settings variables (dynamic global variable)

2012-02-08 Thread bfrederi
, but should update every once in a while, but I'd prefer that it stayed in local memory as much as possible, since it gets used so much. Any advice on how to make a dynamic global variable like that is much appreciated. Thanks, Brandon -- You received this message because you are subscri

Re: Help How to append or join db.StringProperty(required=True) + string or global variable

2011-07-06 Thread ddghl
yeh yeh a moment ago I realized that this is a google engines as well also thanks :working: -- View this message in context: http://old.nabble.com/Help-How-to-append-or-join--db.StringProperty%28required%3DTrue%29-%2B-string-or-global-variable-tp31996850p32003633.html Sent from the

Re: Help How to append or join db.StringProperty(required=True) + string or global variable

2011-07-05 Thread bruno desthuilliers
now is {{ article.title }}  => "Bla bla bla" but i need   > > {{ article.title + string or global variable  }} {{ article.title }} and some more text {{ article.title }} {{ some_var }} {{ article.title }} {{ some_var.some_attribute }} for the second and third examples you obviousl

Help How to append or join db.StringProperty(required=True) + string or global variable

2011-07-05 Thread ddghl
Help guys i need append or join django title = db.StringProperty(required=True) now is {{ article.title }} => "Bla bla bla" but i need {{ article.title + string or global variable }} maybe someone knows :working: -- View this message in context: http://o

Re: Global variable during request

2010-10-22 Thread Daniel Roseman
On Oct 22, 5:35 pm, Jop wrote: > Hello all, > > I've been googeling for a while but haven't been able to find a > solution for my problem. I will try to describe the problem > > I want to be able to set a variable in a view function on the start of > the request. During the same request i want to

Re: Global variable during request

2010-10-22 Thread Jop
Thnx, i'll try that :) On 22 okt, 18:39, Michael wrote: > Use middleware to set a threadlocal variable in a global namespace on > request, and unset it on response. > -- > Michael > > > > On Fri, 2010-10-22 at 09:35 -0700, Jop wrote: > > Hello all, > > > I've been googeling for a while but haven

Re: Global variable during request

2010-10-22 Thread Michael
Use middleware to set a threadlocal variable in a global namespace on request, and unset it on response. -- Michael On Fri, 2010-10-22 at 09:35 -0700, Jop wrote: > Hello all, > > I've been googeling for a while but haven't been able to find a > solution for my problem. I will try to describe th

Global variable during request

2010-10-22 Thread Jop
Hello all, I've been googeling for a while but haven't been able to find a solution for my problem. I will try to describe the problem I want to be able to set a variable in a view function on the start of the request. During the same request i want to use the variables value in a manager method.

Re: How do I update a global variable?

2010-06-18 Thread Stefan Frauenknecht
Please rethink your design! There is certainly no need for a global variable. There is may be a way to implement your requirement as a singleton that is being able to deliver the huge bag of data in a much more smarter way. Am 18.06.2010 um 20:17 schrieb aurphir : In my django

Re: How do I update a global variable?

2010-06-18 Thread Daniel Roseman
On Jun 18, 7:17 pm, aurphir wrote: > In my django application I have a global variable 'gv' which is > accessed by different requests coming from the end users. > > Now 'gv' holds a data of 2 MB size which needs to be update at regular > interval, pulling 2

How do I update a global variable?

2010-06-18 Thread aurphir
In my django application I have a global variable 'gv' which is accessed by different requests coming from the end users. Now 'gv' holds a data of 2 MB size which needs to be update at regular interval, pulling 2 MB data from the database for every request doesn't mak

Re: global variable issue

2008-06-24 Thread csmithmaui
Ok...guys...I think I understand what you are saying. It gives me much relief to understand this better. I didn't realize that the server would run multiple instances of django to serve my requests. It seems I had a fundamental misunderstanding of how things work on the server. I will try to do so

Re: global variable issue

2008-06-24 Thread Norman Harman
[EMAIL PROTECTED] wrote: > If I hit Ctrl-R again it puts my name back, and so on. It's like there > there are two copies of the global that I am accessing. I can't figure > this out. Any ideas? Thanks so much! Rule 1: Don't use globals. Rule 2: Don't try to store state in a stateless server, use

Re: global variable issue

2008-06-24 Thread Rajesh Dhawan
g. I can't figure > this out.  Any ideas? Thanks so much! The global variable you've defined is global "per-process". It's likely that you've two or more processes setup to serve your Django requests. In that case, there's no guarantee that every request fro

global variable issue

2008-06-24 Thread csmithmaui
ave a global variable defined in a file called globvars.py: Code: alias = {'fake_username':''} Then I have a view where I try and set the variable based upon whatever the user enters as a username(I know this is a little weird but this site is only for friends and family so I ju

Re: How to set a global variable?

2007-10-09 Thread James Bennett
On 10/9/07, Greg <[EMAIL PROTECTED]> wrote: > I want to create a list that can be updated from within a part of a > view and retreived from another part of a view. Here is my view.py To access a global variable you need to use the 'global' keyword. A better option, ho

Re: How to set a global variable?

2007-10-09 Thread Greg
Kenneth, I've tried that. It will not work because everytime the view gets accessed then mysearchlist gets cleared. Once mysearchlist is created from within the post. I want the values to stay the same no matter how many times the GET gets accessed. On Oct 9, 10:02 pm, Kenneth Gonsalves <[EMAI

Re: How to set a global variable?

2007-10-09 Thread Kenneth Gonsalves
On 10-Oct-07, at 8:27 AM, Greg wrote: > def searchresult(request): mysearchlist = [] > if request.method == 'POST': > mysearchlist = [1,2,3,4,5] > if request.method == 'GET': > assert False, mysearchlist -- regards kg http://lawgon.livejournal.com http://nrcfo

How to set a global variable?

2007-10-09 Thread Greg
;POST': mysearchlist = [1,2,3,4,5] if request.method == 'GET': assert False, mysearchlist Here is basically my view (I've taken out most of the text). The post will always be called first. So I want my code from within the post to update my global variable &#x