Re: ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "No module named mysite"

2007-02-01 Thread wub

Henrik,

I've been stuck in a a place like Ron's all morning.  I thought I had
gotten to a later problem when I started getting Django errors
indication that there was 'no module mysite.urls', but I just gave it
another try, and I'm back to the mod-python error 'no module named
mysite'.  I seem to be at a point where I get to choose between the
mod-python and Django errors about non-existence of modules.  At least
I no longer have Apache 'no such place' errors.

Do you know why there is such a lag in response to configuration file
changes?  When I change httpd.conf and restart Apache, it seems to see
new settings fairly quickly, but when I change settings.py, Django
does not "catch up" for quite a while. I tried deleting everything I
could find with a .pyc extension, but that does not seem to help, (and
may be causing some actual harm?)

I have gotten the full tutorial to work (WinXP, Python 2.4.1/mod-
python3.2.8 /Django 0.95) with the development web server, and the
next place to go is Apache (2.0.59, at least for now).  I intend to
move to Linux, but for reasons of practicality I am currently working
in Windows.

Thanks for any light you can shed on this.

John.

On Feb 1, 7:09 am, "HenrikG" <[EMAIL PROTECTED]> wrote:
> Hi Ron!
>
> Try changing
> '/home/rsie/projects/mysite'
> to
> '/home/rsie/projects'
>
> and also change
> SetEnv DJANGO_SETTINGS_MODULE settings
> to
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
>
> regards,
> /Henrik


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: image doesn't display in template

2007-01-24 Thread wub

I am having the same problem placing an image in a template file.  I
think you may be farther along than I am, if you understand the
'object.get_mug_shot_url' portion of the instructions.  My impression
of the Image_File instructions was that they were intended to allow
users to send images >to< the web server.

I am working in WinXP at the moment.  I have currently got my.gif in
C:\temp.

I do not see any difference whether my settings.py file contains
MEDIA_ROOT = '/temp/' or MEDIA_ROOT = '', and the same goes for
MEDIA_URL.  The Django development web server is now sending this
message when I hit a page descended from this template:

"GET /descendant_page HTTP/1.1" 200 2294
"GET /temp/my.gif HTTP/1.1" 404 2310

When I use my browser to view my page source, I see "img src =
'/temp/my.gif' (an improvement over "img src = [Didn't have permission
to include file]".  Now, I guess that the server simply can't find the
file in the directory I thought I told it to look in.

At one point, I tried using {% ssi /temp/my.gif %}, along with the
ALLOWED_INCLUDE_ROOT = '/temp'
directive in settings.py - that resulted in the of bytes from my.gif
embedded in the page source. I was glad to see the server >did< find
the file, but I wish it had done something more useful with the
contents.


On Jan 24, 8:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi group,
>
> I'm just getting started with Django and I've run into a snag with
> images:  I've set up the image portion of my site following these
> directions from the Django FAQ:
>
> 1) "In your settings file, define MEDIA_ROOT as the full path to a
> directory where you'd like Django to store uploaded files."
> ** mine is set as the absolute path on my machine
>
> 2) "Define MEDIA_URL as the base public URL of that directory. Make
> sure that this directory is writable by the Web server's user account.
> "
> ** have tried this as both the absolute path and the http path, neither
> works
>
> 3) "Add the FileField or ImageField to your model, making sure to
> define the upload_to option to tell Django to which subdirectory of
> MEDIA_ROOT it should upload files."
> ** used "specimen_image=models.ImageField(upload_to='public/')" in
> models.py
>
> 4) "you can get the absolute URL to your image in a template with {{
> object.get_mug_shot_url }}."
> ** in my template, I refer to  src="{{specimen.get_specimen_image_url}}>
>
> When I access the template's associated script through a browser, only
> the alt text is displayed (no image).  I can access the image directly
> by entering the absolute path into my browser, but must be missing
> something somewhere along the way in Django.  Any ideas?
> 
> Thanks!  Go Django!
> Heather Y.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---