Re: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-19 Thread Stephen Anto
Hi,

There are only 7 steps ahead to say 'Hello World' via Django project.

Visit http://www.f2finterview.com/web/Django/17/ its tells how to make
simple django project with seven steps. Thank you for
visiting

On Thu, Sep 13, 2012 at 2:55 PM, DJ-Tom  wrote:

>
> Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had
>>> to restart Apache to make config changes effective... is that "normal"?
>>>
>>> I think important things like "you have to restart the webserver to make
>>> changes life" should go into the tutorial in *BIG RED LETTERS* 
>>>
>>
>>
>> The tutorial, by design, doesn't mention Apache at all. That's because
>> it's heavily recommended that you use the built-in devserver for
>> development, for precisely this reason. That's what it's for.
>>
>>
> Basically I always try to have the same environment for development as I
> also use for actual production - I'm lucky that my projects are small
> enough so i can do that :-) to avoid last minute surprises when trying to
> deploy the application to the public.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/qPvYvgWTXS8J.
> 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.
>



-- 
Thanks & Regards
Stephen S



Website: www.f2finterview.com
Blog:  blog.f2finterview.com
Tutorial:  tutorial.f2finterview.com
Group:www.charvigroups.com

-- 
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-19 Thread DJ-Tom

I have now found extensive documentation as to why and how Apache has to be 
configured with Django and mod_wsgi here 
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WQXagLAa1bsJ.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-13 Thread James Bennett
On Thu, Sep 13, 2012 at 4:25 AM, DJ-Tom  wrote:
> Basically I always try to have the same environment for development as I
> also use for actual production - I'm lucky that my projects are small enough
> so i can do that :-) to avoid last minute surprises when trying to deploy
> the application to the public.

This is a fine thing to do once you understand Django and know what
you're doing with it. But for a beginner's tutorial aimed at someone
who knows nothing about Django, the development server is far more
ideal since it avoids throwing in a pile of "oh, and before you even
start, go learn how to set up and run Apache and a bunch of other
stuff so that you can use a production server stack to learn Django"
:)

As such, the tutorial doesn't and shouldn't mention trying to set up
Apache or other production deployment setups. It should simply teach
people how to write Django applications and understand how the pieces
of the framework fit together.

-- 
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-13 Thread DJ-Tom


> Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had 
>> to restart Apache to make config changes effective... is that "normal"?
>>
>> I think important things like "you have to restart the webserver to make 
>> changes life" should go into the tutorial in *BIG RED LETTERS* 
>>
>
>
> The tutorial, by design, doesn't mention Apache at all. That's because 
> it's heavily recommended that you use the built-in devserver for 
> development, for precisely this reason. That's what it's for.
>
>
Basically I always try to have the same environment for development as I 
also use for actual production - I'm lucky that my projects are small 
enough so i can do that :-) to avoid last minute surprises when trying to 
deploy the application to the public.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qPvYvgWTXS8J.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread Daniel Roseman
On Tuesday, 11 September 2012 16:33:31 UTC+1, DJ-Tom wrote:
>
>
>
> Am Dienstag, 11. September 2012 10:20:16 UTC+2 schrieb Chang.Jian:
>>
>> "d:/wwwroot/djtest/djtest/" was already in system path, so I think you 
>> should set DJANGO_SETTINGS_MODULE like this: 
>> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
>>
>> try it!
>>
>>
> Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had 
> to restart Apache to make config changes effective... is that "normal"?
>
> I think important things like "you have to restart the webserver to make 
> changes life" should go into the tutorial in *BIG RED LETTERS* 
>


The tutorial, by design, doesn't mention Apache at all. That's because it's 
heavily recommended that you use the built-in devserver for development, 
for precisely this reason. That's what it's for.
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/LlpRVasnf_UJ.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread DJ-Tom


Am Dienstag, 11. September 2012 10:20:16 UTC+2 schrieb Chang.Jian:
>
> "d:/wwwroot/djtest/djtest/" was already in system path, so I think you 
> should set DJANGO_SETTINGS_MODULE like this: 
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
>
> try it!
>
>
Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had 
to restart Apache to make config changes effective... is that "normal"?

I think important things like "you have to restart the webserver to make 
changes life" should go into the tutorial in *BIG RED LETTERS* 

Now I get a "regular" Django exception:

NameError: name 'admin' is not defined


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/y4GYmsDZkKwJ.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread Jian Chang
"d:/wwwroot/djtest/djtest/" was already in system path, so I think you
should set DJANGO_SETTINGS_MODULE like this:
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"settings")

try it![?][?][?]

2012/9/11 DJ-Tom 

> Am Dienstag, 11. September 2012 00:43:44 UTC+2 schrieb Mike Dewhirst:
>
>>
>> Try dropping this down to "djtest.settings". Also make sure you have a
>> file in each of your folders called __init__.py
>>
>> This tells Python the folder is part of the package.
>>
>
> Sorry - but this does not help. Just to be sure that I'm not missing
> anything essential, this is all I have so far:
>
> d:\djtest\
>manage.py
>data.sql
>\djtest\
>   __init__.py
>   settings.py
>   urls.py
>   wsgi.py
>
> Am I correct to assume that this should be sufficient to call at least the
> /admin/ interface?
>
> I have activated this in urls.py:  url(r'^admin/',
> include(admin.site.urls)),
>
> And this in settings.py: 'django.contrib.admin',
>
> But as django does not seem to be able to find settings.py... hm
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/tEB1E_DacVAJ.
>
> 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.
>

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

<<330.gif>>

Re: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread DJ-Tom
Am Dienstag, 11. September 2012 00:43:44 UTC+2 schrieb Mike Dewhirst:
>
>
> Try dropping this down to "djtest.settings". Also make sure you have a 
> file in each of your folders called __init__.py 
>
> This tells Python the folder is part of the package. 
>

Sorry - but this does not help. Just to be sure that I'm not missing 
anything essential, this is all I have so far:

d:\djtest\
   manage.py
   data.sql
   \djtest\
  __init__.py
  settings.py
  urls.py
  wsgi.py

Am I correct to assume that this should be sufficient to call at least the 
/admin/ interface?

I have activated this in urls.py:  url(r'^admin/', 
include(admin.site.urls)),

And this in settings.py: 'django.contrib.admin',

But as django does not seem to be able to find settings.py... hm

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/tEB1E_DacVAJ.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-10 Thread Mike Dewhirst

On 11/09/2012 1:31am, DJ-Tom wrote:

Hi,

I'm new to django and python at the same time (Nightmare ) and
currently struggling to get a basic understanding of how everything
works and how the different components are connected to each other.

My setup is a s follows:

- Apache 2.2 running as a service under Windows 7
- mod_wsgi
- Python 2.7.3
- django 1.4.1
- web server docroot under d:\wwwroot
- test project under d:\wwwroot\djtest\djtest set up with

 django-admin.py startproject djtest


Basically I think that almost everything is set up correctly, things
like "python manage.py syncdb" work without probkems, I could activate
django.contrib.admin and create the database without errors - only if I
try to access the admin I get the following apache error.log:

mod_wsgi (pid=6804): Exception occurred processing WSGI script
'D:/wwwroot/djtest/djtest/wsgi.py'.
Traceback (most recent call last):
   File
"D:\\Python27\\lib\\site-packages\\django\\core\\handlers\\wsgi.py",
line 219, in __call__
 self.load_middleware()
   File
"D:\\Python27\\lib\\site-packages\\django\\core\\handlers\\base.py",
line 39, in load_middleware
 for middleware_path in settings.MIDDLEWARE_CLASSES:
   File
"D:\\Python27\\lib\\site-packages\\django\\utils\\functional.py",
line 184, in inner
 self._setup()
   File
"D:\\Python27\\lib\\site-packages\\django\\conf\\__init__.py", line
42, in _setup
 self._wrapped = Settings(settings_module)
   File
"D:\\Python27\\lib\\site-packages\\django\\conf\\__init__.py", line
95, in __init__
 raise ImportError("Could not import settings '%s' (Is it on
sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'djtest.djtest.settings' (Is
it on sys.path?): No module named djtest.djtest.settings


wsgi.py looks like this:


import os
import sys

path = 'd:/wwwroot/djtest/djtest/'
if path not in sys.path:
 sys.path.append(path)

os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"djtest.djtest.settings")


Try dropping this down to "djtest.settings". Also make sure you have a 
file in each of your folders called __init__.py


This tells Python the folder is part of the package.




# This application object is used by any WSGI server configured to
use this
# file. This includes Django's development server, if the
WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()


HELP! :-)))

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/fl5wkcGjpuQJ.
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.


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