Hi,

Django's own documentation contains a description of how to do this:

https://docs.djangoproject.com/en/1.5/topics/settings/#using-settings-without-setting-django-settings-module

James Bennett has also written a blog post that gives a good rundown on
approaches you can take:

http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/

Unfortunately, the links in that blog post are a little stale; however, he
provides code samples, which should be enough to get you going.

Yours,
Russ Magee %-)

On Tue, Sep 17, 2013 at 3:25 PM, 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