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
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
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
..@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:
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.
>
>
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
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
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
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
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
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
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
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
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
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
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.
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.
-- 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.
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)
> 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
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
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:
>>> >
/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
>> &
/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?
>
://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
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
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
> 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
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
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
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
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
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
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
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
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
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
, 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
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
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 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
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
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
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
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.
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
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
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
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
[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
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
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
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
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
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
;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
56 matches
Mail list logo