Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 7, 2011 17:02:08

Mo M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Including subfolders


Hi,

My project is getting quite large with so many apps, so i decided to create
a folder for libs/shared and folder for apps in which libs/shared will
contain all my generic libraries and apps will contain the project specific
apps.

I found the followinghttp://solutions.treypiepmeier.com/2009/01/08/keep-your-django-applications-in-a-subfolder/and It did the job in enabling me to include apps. I just have to questions

1. How do create a tuple in my settings.py containing all the folders I need
to include (in my case libs/shared and apps) and in manage.py include them
without hard coding the folder names? It seems like the following function
does not take tuples and only accept strings

sys.path.insert(0, join(settings.PROJECT_ROOT, "apps"))

2. Will my code works when I move it to production using mod_wsgi?

regards,

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 7, 2011 17:15:54

Subhranath C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Including subfolders


On Fri, Jan 7, 2011 at 10:32 PM, Mo Mughrabi <mo.mughr...@gmail.com> wrote:

> Hi,
>
> My project is getting quite large with so many apps, so i decided to create
> a folder for libs/shared and folder for apps in which libs/shared will
> contain all my generic libraries and apps will contain the project specific
> apps.
>
> I found the following
>
>
>http://solutions.treypiepmeier.com/2009/01/08/keep-your-django-applications-in-a-subfolder/>
> and It did the job in enabling me to include apps. I just have to
> questions
>
> 1. How do create a tuple in my settings.py containing all the folders I
> need to include (in my case libs/shared and apps) and in manage.py include
> them without hard coding the folder names? It seems like the following
> function does not take tuples and only accept strings
>
> sys.path.insert(0, join(settings.PROJECT_ROOT, "apps"))
>

In your settings.py you can add:
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib/shared'))
sys.path.append(os.path.join(os.path.dirname(__file__), 'app'))


> 2. Will my code works when I move it to production using mod_wsgi?
>

Yes.


>
> regards,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>

Thanks,
Subhranath Chunder.

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 17th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support