Re: Django 1.4 manage.py cannot find settings

2012-12-26 Thread Bill Freeman
On Tue, Dec 25, 2012 at 8:22 AM, huw_at1  wrote:

> Hi,
>
> This has probably been asked a million times before so apologies. I'm new
> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to
> perform a simple import from within my shell:
>
> from django.contrib.sites.models import Site
>
> However I am constantly getting the problem that my settings are not being
> found:
>
> raise ImportError("Could not import settings '%s' (Is it on
> sys.path?): %s" % (self.SETTINGS_MODULE, e))
> ImportError: Could not import settings 'test.test.settings' (Is it on
> sys.path?): No module named test.settings
>
> In the past I would have thought that this was an issue as the project and
> the "app" had the same name although in the case of 1.4 the settings are
> placed in a directory with the same name as the project. I'm not sure what
> I should change to get this to work.
>
> Has this been seen before or any ideas?
>
> Many thanks
>
>
> The only shell from which you can perform this import is the one you reach
via:

python manage.py shell

If you just start python, such imports will not work.

Note, too, that the directory containing manage.py should be the current
directory at the time that python is started (as opposed to adding that
directory to sys.path.

You can do a lot of typing and get a bare python into a state from which it
can import Site, but it would be far more productive to teach your IDE to
start a shell as above for those times when you want to play like this.

Bill

-- 
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Ryan Blunden
I would say stay away using PyCharm to manage your Django application until 
you're more experienced. Learn to manage your app purely through the 
command line first.

On Tuesday, December 25, 2012 9:28:15 AM UTC-8, Victor Rocha wrote:
>
> Your welcome! Merry Christmas
>
>
>
> On Tue, Dec 25, 2012 at 12:25 PM, huw_at1  > wrote:
>
>> Hiya - sorry yeah I pasted the wrong manage.py file initially. It should 
>> have been the test.settings manage.py.
>>
>> I figured it out partially anyway - I needed to change the project 
>> directory setting in the IDE as you said.
>>
>> Thanks for the help.
>>
>>
>> On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>>
>>> I don't think I can be of more help. Hopefully someone with experience 
>>> with PyCharm can chime in.
>>> This is probably not what you want to hear but ditch windows, ditch 
>>> pycharm use windows and vim or at least gedit.
>>>
>>> One last comment, in your manage.py file i can see this 'pkadata.settings'; 
>>> i didnt see that directory when you showed me your file structure.
>>>
>>>
>>>
>>> On Tue, Dec 25, 2012 at 12:01 PM, huw_at1  wrote:
>>>
 pkadata.settings
>>>
>>>
>>>  -- 
>> 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/-/xbeOEaE7Ah4J.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FeHXglY42PAJ.
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
Would you please describe all you have to do to resolve it, in case someone
else stumbles upon the same issue?

Thank you,
Victor Rocha
RochApps 

On Tue, Dec 25, 2012 at 5:51 PM, huw_at1  wrote:

> [RESOLVED]
>
>
> On Tuesday, 25 December 2012 17:28:15 UTC, Victor Rocha wrote:
>
>> Your welcome! Merry Christmas
>>
>>
>>
>> On Tue, Dec 25, 2012 at 12:25 PM, huw_at1  wrote:
>>
>>> Hiya - sorry yeah I pasted the wrong manage.py file initially. It should
>>> have been the test.settings manage.py.
>>>
>>> I figured it out partially anyway - I needed to change the project
>>> directory setting in the IDE as you said.
>>>
>>> Thanks for the help.
>>>
>>>
>>> On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>>>
 I don't think I can be of more help. Hopefully someone with experience
 with PyCharm can chime in.
 This is probably not what you want to hear but ditch windows, ditch
 pycharm use windows and vim or at least gedit.

 One last comment, in your manage.py file i can see this 'pkadata.settings';
 i didnt see that directory when you showed me your file structure.



 On Tue, Dec 25, 2012 at 12:01 PM, huw_at1  wrote:

> pkadata.settings


  --
>>> 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/-/**xbeOEaE7Ah4J
>>> .
>>>
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> 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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/QDMIerGSTp8J.
>
> 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.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
[RESOLVED]

On Tuesday, 25 December 2012 17:28:15 UTC, Victor Rocha wrote:
>
> Your welcome! Merry Christmas
>
>
>
> On Tue, Dec 25, 2012 at 12:25 PM, huw_at1  > wrote:
>
>> Hiya - sorry yeah I pasted the wrong manage.py file initially. It should 
>> have been the test.settings manage.py.
>>
>> I figured it out partially anyway - I needed to change the project 
>> directory setting in the IDE as you said.
>>
>> Thanks for the help.
>>
>>
>> On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>>
>>> I don't think I can be of more help. Hopefully someone with experience 
>>> with PyCharm can chime in.
>>> This is probably not what you want to hear but ditch windows, ditch 
>>> pycharm use windows and vim or at least gedit.
>>>
>>> One last comment, in your manage.py file i can see this 'pkadata.settings'; 
>>> i didnt see that directory when you showed me your file structure.
>>>
>>>
>>>
>>> On Tue, Dec 25, 2012 at 12:01 PM, huw_at1  wrote:
>>>
 pkadata.settings
>>>
>>>
>>>  -- 
>> 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/-/xbeOEaE7Ah4J.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QDMIerGSTp8J.
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
Your welcome! Merry Christmas



On Tue, Dec 25, 2012 at 12:25 PM, huw_at1  wrote:

> Hiya - sorry yeah I pasted the wrong manage.py file initially. It should
> have been the test.settings manage.py.
>
> I figured it out partially anyway - I needed to change the project
> directory setting in the IDE as you said.
>
> Thanks for the help.
>
>
> On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>
>> I don't think I can be of more help. Hopefully someone with experience
>> with PyCharm can chime in.
>> This is probably not what you want to hear but ditch windows, ditch
>> pycharm use windows and vim or at least gedit.
>>
>> One last comment, in your manage.py file i can see this 'pkadata.settings';
>> i didnt see that directory when you showed me your file structure.
>>
>>
>>
>> On Tue, Dec 25, 2012 at 12:01 PM, huw_at1  wrote:
>>
>>> pkadata.settings
>>
>>
>>  --
> 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/-/xbeOEaE7Ah4J.
>
> 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.



Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hiya - sorry yeah I pasted the wrong manage.py file initially. It should 
have been the test.settings manage.py.

I figured it out partially anyway - I needed to change the project 
directory setting in the IDE as you said.

Thanks for the help.

On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote:
>
> I don't think I can be of more help. Hopefully someone with experience 
> with PyCharm can chime in.
> This is probably not what you want to hear but ditch windows, ditch 
> pycharm use windows and vim or at least gedit.
>
> One last comment, in your manage.py file i can see this 'pkadata.settings'; 
> i didnt see that directory when you showed me your file structure.
>
>
>
> On Tue, Dec 25, 2012 at 12:01 PM, huw_at1  > wrote:
>
>> pkadata.settings
>
>
>

-- 
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/-/xbeOEaE7Ah4J.
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
I don't think I can be of more help. Hopefully someone with experience with
PyCharm can chime in.
This is probably not what you want to hear but ditch windows, ditch pycharm
use windows and vim or at least gedit.

One last comment, in your manage.py file i can see this 'pkadata.settings';
i didnt see that directory when you showed me your file structure.



On Tue, Dec 25, 2012 at 12:01 PM, huw_at1  wrote:

> pkadata.settings

-- 
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

manage.py is show below:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)


I think you may be right...I think I have the project directory set at a 
level too high some how...


On Tuesday, December 25, 2012 1:22:10 PM UTC, huw_at1 wrote:
>
> Hi,
>
> This has probably been asked a million times before so apologies. I'm new 
> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
> perform a simple import from within my shell:
>
> from django.contrib.sites.models import Site
>
> However I am constantly getting the problem that my settings are not being 
> found:
>
> raise ImportError("Could not import settings '%s' (Is it on 
> sys.path?): %s" % (self.SETTINGS_MODULE, e))
> ImportError: Could not import settings 'test.test.settings' (Is it on 
> sys.path?): No module named test.settings
>
> In the past I would have thought that this was an issue as the project and 
> the "app" had the same name although in the case of 1.4 the settings are 
> placed in a directory with the same name as the project. I'm not sure what 
> I should change to get this to work.
>
> Has this been seen before or any ideas?
>
> Many thanks
>

-- 
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/-/EGGUxTvjArEJ.
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

manage.py contents below:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pkadata.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)


I think you maybe right - I think it may be somewhere the project directory 
is set a level too high...

On Tuesday, December 25, 2012 1:22:10 PM UTC, huw_at1 wrote:
>
> Hi,
>
> This has probably been asked a million times before so apologies. I'm new 
> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
> perform a simple import from within my shell:
>
> from django.contrib.sites.models import Site
>
> However I am constantly getting the problem that my settings are not being 
> found:
>
> raise ImportError("Could not import settings '%s' (Is it on 
> sys.path?): %s" % (self.SETTINGS_MODULE, e))
> ImportError: Could not import settings 'test.test.settings' (Is it on 
> sys.path?): No module named test.settings
>
> In the past I would have thought that this was an issue as the project and 
> the "app" had the same name although in the case of 1.4 the settings are 
> placed in a directory with the same name as the project. I'm not sure what 
> I should change to get this to work.
>
> Has this been seen before or any ideas?
>
> Many thanks
>

-- 
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/-/oGSYDONdBzUJ.
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
I don't have much experience using PyCharm, however from I can understand,
your issues may be alleviated by adding a ___init__.py file at the same
level as your manage.py file. Can you set which dir is the project's root
dir? can you show me the content of your manage.py file?

I am still concern about this 'test.test.settings'  it should only be
'test.settings'

Thank you,
Victor Rocha
RochApps 


On Tue, Dec 25, 2012 at 10:22 AM, huw_at1  wrote:

> Thank you,
> Victor Rocha
> RochApps 
>

-- 
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread huw_at1
Hi,

This project was created using django 1.4. The structure is as follows:

/home
  |
  --/huw_at1
  |
  ---/TEST
|

-/test-/test-settings.py
 .git   /static 
  urls.py
 /templates
wsgi.py   
 /test_app
 manage.py

So I have a parent container directory called TEST, then the project 
directory within this and then within the project directory django has set 
up the test subdirectory with the settings in. I am using PyCharm to try 
and run the Django console or shell as it is known which appears to run 
from the TEST container directory.

Does this make things clearer? Currently trying to run syncdb has issues 
creating the site because of this issue with not finding the settings as 
well I suspect. Are there any particular environment variables I should be 
setting considering I am running this from Win7?

Many thanks for the response

Huw_at1

On Tuesday, December 25, 2012 2:19:10 PM UTC, Victor Rocha wrote:
>
> Hi,
>
> I would like to ask you to post a snapshot of your dir structure. In the 
> mean time, I am going to give you some pointers that you could consider. Is 
> the an app you converted to django 1.4 or did you created your app from 
> scratch(using 1.4 from the beginning)?
>
> If you converted you app your Error("Could not import settings 
> 'test.test.settings' (Is it on sys.path?): ") indicates that you set your 
> "DJANGO_SETTINGS_MODULE" is set incorrectly. Open your manage.py file and 
> set it the django environmental variable to "test.settings".
>
> If you created your app using django 1.4 from the beginning, I don't see 
> how this error could happen! Django lays out your project for you and sets 
> everything correctly. 
>
> Thank you,
> Victor Rocha
> RochApps 
>
>
> On Tuesday, December 25, 2012 8:22:10 AM UTC-5, huw_at1 wrote:
>>
>> Hi,
>>
>> This has probably been asked a million times before so apologies. I'm new 
>> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
>> perform a simple import from within my shell:
>>
>> from django.contrib.sites.models import Site
>>
>> However I am constantly getting the problem that my settings are not 
>> being found:
>>
>> raise ImportError("Could not import settings '%s' (Is it on 
>> sys.path?): %s" % (self.SETTINGS_MODULE, e))
>> ImportError: Could not import settings 'test.test.settings' (Is it on 
>> sys.path?): No module named test.settings
>>
>> In the past I would have thought that this was an issue as the project 
>> and the "app" had the same name although in the case of 1.4 the settings 
>> are placed in a directory with the same name as the project. I'm not sure 
>> what I should change to get this to work.
>>
>> Has this been seen before or any ideas?
>>
>> Many thanks
>>
>

-- 
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/-/QfQAXqhRxVoJ.
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: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
Hi,

I would like to ask you to post a snapshot of your dir structure. In the 
mean time, I am going to give you some pointers that you could consider. Is 
the an app you converted to django 1.4 or did you created your app from 
scratch(using 1.4 from the beginning)?

If you converted you app your Error("Could not import settings 
'test.test.settings' (Is it on sys.path?): ") indicates that you set your 
"DJANGO_SETTINGS_MODULE" is set incorrectly. Open your manage.py file and 
set it the django environmental variable to "test.settings".

If you created your app using django 1.4 from the beginning, I don't see 
how this error could happen! Django lays out your project for you and sets 
everything correctly. 

Thank you,
Victor Rocha
RochApps 


On Tuesday, December 25, 2012 8:22:10 AM UTC-5, huw_at1 wrote:
>
> Hi,
>
> This has probably been asked a million times before so apologies. I'm new 
> to 1.4 so the standard project layout is a little unfamiliar. I'm trying to 
> perform a simple import from within my shell:
>
> from django.contrib.sites.models import Site
>
> However I am constantly getting the problem that my settings are not being 
> found:
>
> raise ImportError("Could not import settings '%s' (Is it on 
> sys.path?): %s" % (self.SETTINGS_MODULE, e))
> ImportError: Could not import settings 'test.test.settings' (Is it on 
> sys.path?): No module named test.settings
>
> In the past I would have thought that this was an issue as the project and 
> the "app" had the same name although in the case of 1.4 the settings are 
> placed in a directory with the same name as the project. I'm not sure what 
> I should change to get this to work.
>
> Has this been seen before or any ideas?
>
> Many thanks
>

-- 
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/-/BjA9V-YqpBgJ.
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.