On Thu, 2011-02-17 at 02:44 -0800, Daniel Roseman wrote:
> > could you elaborate on this? I am suffering from this misconception.
> >
> Not sure what else to say. Taking mod_wsgi as an example, Apache
> spawns a
> number of processes and/or threads to serve Django requests, depending
> on
> your
On Thursday, February 17, 2011 6:37:56 AM UTC, lawgon wrote:
>
> On Wed, 2011-02-16 at 02:12 -0800, Daniel Roseman wrote:
> > Your question betrays a misconception that I often see. Django - at
> > least
> > when served other than via CGI - does not reload everything for each
> > request. The Dja
On Wed, 2011-02-16 at 02:12 -0800, Daniel Roseman wrote:
> Your question betrays a misconception that I often see. Django - at
> least
> when served other than via CGI - does not reload everything for each
> request. The Django process is long-running, and is managed by the
> server,
> but usual
On Feb 16, 12:21 pm, galago wrote:
> My django runs on FastCGI as I can see.
> I have that small part of the code:
>
> # Generate user register_hash
> import hashlib
> reg_hash = hashlib.md5()
> reg_hash.update(request.POST.get('email') +
> str(rando
My django runs on FastCGI as I can see.
I have that small part of the code:
# Generate user register_hash
import hashlib
reg_hash = hashlib.md5()
reg_hash.update(request.POST.get('email') +
str(random.random()) + request.POST.get('username'))
On Wednesday, February 16, 2011 8:38:40 AM UTC, galago wrote:
>
> Is it a good idea to import modules in the middle of the code, and not on
> the beginning?
> I want to make a hash generation. It's few lines - it's used once in all
> application. Should I import hashlib just on the beginning of t
. django modules
3. 3rd party modules
4. Your project/application modules
Regards
Chris
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of galago
Sent: 16 February 2011 10:39
To: django-users@googlegroups.com
Subject: Importing modules in
Is it a good idea to import modules in the middle of the code, and not on
the beginning?
I want to make a hash generation. It's few lines - it's used once in all
application. Should I import hashlib just on the beginning of the file? Now
I put it with the rest of the code.
Is it bad?
I don't wa
Another possibility would be to simply encourage the placing of the
'project.apps' directory in the PYTHONPATH as well as the parent
directory of 'project'.
If this was the convention, then people could simply simply use the
form:
myproject.models.modulename
myproject.utils.anothermodule
etc.
T
In briefly playing around, I couldn't figure out a way to use the
INSTALLED_APPS tuple to extend the module path. I just don't have that
sort of kung-fu with python and manipulating modules.
The one thing I came up with instead is creating a new SETTING called
"EXTENSION_APPS_DIR". This would be
So, to add an app to a new project, you just need to include it in the
INSTALLED_APPS tuple as "ellington.apps.your_app_name"?
This works for me, but I am concerned about easily sharing applications
with other people and being able to do imports within my application.
My one suggestion is to use
On 8/24/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Because of this, "project.apps.application.module" should work and it
> does for me. But, this isn't ideal since I do want there to be a
> dependency on the project name in my apps that I want to be able to
> share and drag-and-drop into m
Is this by default? I don't have the 'apps' module from my project
available to me in my View. According to the instructions on the django
website, it is the "parent" directory of your project that you should
include in the path, not the project directory itself.
Because of this, "project.apps.ap
Figured out my own problem: the I kept trying to import
"project.apps.application.module" when the django configuration means
that my sys.path is actually already in the project directory.
Importing "apps.application.module" works fine.
Hello,
I'm having a strange issue with importing my own modules into the view
module for an application.
What I have is this:
project/apps/application/module.py
project/apps/application/views/application.py
In application.py, I want to include module.py, but no matter which way
I try the impor
15 matches
Mail list logo