To make my code work, you could set DJANGO_SETTINGS_MODULE to
'my_project.settings', and just put formdesigner.py directly under
my_project.

If you wanted to keep formdesigner.py where it is, you would want to change
the sys.path.append line to this:

sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),
'..'))


---------
Brad Pitcher


On Tue, Sep 17, 2013 at 12:25 AM, DJ-Tom <[email protected]> wrote:

>
> Hi,
>
> I'm also not sure if the python file is at the correct location.
>
> This is how the directory structure looks:
>
> my_project
>     \my_project\
>          settings.py
>     \my_app\ # this is where my models are defined
>          models.py
>          formdesigner.py
>
>
> Where should my formdesigner.py be located?
>
> my_project ?
> my_project\my_project ?
> my_project\my_app ?
>
> What do I put into DJANGO_SETTINGS_MODULE?
>
> 'my_project.settings'?
>
>
> Am Montag, 16. September 2013 18:17:21 UTC+2 schrieb Brad Pitcher:
>
>> You need to do something like this before import django stuff:
>>
>> import os
>> import sys
>>
>> sys.path.append(os.path.**abspath(os.path.dirname(__**file__)))
>> os.environ['DJANGO_SETTINGS_**MODULE'] = 'web.settings'
>>
>>
>> ---------
>>
>>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to