Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » urls.py independient from application path [RSS Feed]

#1 Dec. 18, 2010 20:16:52

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

urls.py independient from application path


In the urls.py of one application i decided to use this idea.....


import os
APP_DIR = os.path.dirname(os.path.abspath(__file__))
APP_NAME = os.basemane(APP_PATH)

I'm not sure about the performance implications of using this os
import here.

¿Do you use any similar idea to make applications movable in terms of
filesystem?

Thanks in advance !

/JMV

--
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 Dec. 19, 2010 11:43:19

Javier G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

urls.py independient from application path


On Sat, Dec 18, 2010 at 3:16 PM, JMVmedia.es <jmvme...@gmail.com> wrote:
> In the urls.py of one application i decided to use this idea.....
>
>
> import os
> APP_DIR = os.path.dirname(os.path.abspath(__file__))
> APP_NAME = os.basemane(APP_PATH)
>
> I'm not sure about the performance implications of using this os
> import here.


the import is performed once at initialization time, so there's no
performance impact in the query/responce cycle.

but i wonder what you use those variables for in the urls.py... I do
something similar in the settings.py file, to construct the MEDIA_PATH
and TEMPLATE_DIRS settings; but not in urls.py

you do know that you can simply do "import views" from an app's
urls.py and get your own views.py, right?

--
Javier

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

  • Root
  • » Django
  • » urls.py independient from application path [RSS Feed]

Board footer

Moderator control

Enjoy the 12th of December
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