Re: File wsgi.py identify SO
On Wed, Jun 19, 2013 at 2:29 PM, Hélio Miranda wrote: > Hi > I wonder if someone can help me. > My problem is the following: > in my file wsgi.py django, I wish I could make a condition if OS is > windows running sys.path.append (...) if linux runs sys.path.append ('...') > > Is this possible? > How do I identify the OS? > http://docs.python.org/2/library/sys.html#sys.platform > -- > 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 django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." -- Frank Herbert -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: File wsgi.py identify SO
On Wed, Jun 19, 2013 at 3:15 PM, Hélio Miranda wrote: > I was trying this: > *if os.name == 'nt':* > *sys.path.append('c:/Projectos/Test/') # Windows* > *else:* > *sys.path.append('/srv/django/OnPitch/') # other (unix)* > > doing so, looking at the link that you send will not give > *if sys.platform('win32'):* > *sys.path.append('c:/Projectos/Test/') # Windows* > *else:* > *sys.path.append('/srv/django/OnPitch/') # other (unix)* > Both sys.platform and os.name are variables, not functions. sys.platform('win32') should be sys.platform == 'win32' As the documentation says, os.name is another way to distinguish the OS, but os.name is more coarse. Use whichever suits you best. > * > * > which is correct? > > -- > 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 django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." -- Frank Herbert -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: Doubt the split()
But note that this question is completely off-topic for the django-users list. On Fri, Jun 21, 2013 at 5:47 PM, Tomas Neme wrote: > a regex? > > something like re.match("\[ yourstring).groups()[0] > > -- > 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 django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." -- Frank Herbert -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: A PHP framework with some Django features?
On Fri, Jun 28, 2013 at 7:04 PM, Javier Guerra Giraldez wrote: > On Fri, Jun 28, 2013 at 12:54 PM, Jason Arnst-Goodrich > wrote: > > Nobody's ever switched FROM Django TO PHP as far as I know :) > > > maybe not, but returns to PHP might be common. > > still many people take PHPs ease of deployment as a failure of other > schemes (not realizing that creating a web application separate from > the web server is a big plus), so i don't find surprising that some of > them don't take the time to reap the benefits and get back to what > they know. > > I don't know what you mean. You can use apache mod_wsgi to have apache directly serve Django web apps[1], same as PHP. [1] unless you need to do web sockets, of course. -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." -- Frank Herbert -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: A PHP framework with some Django features?
On Fri, Jun 28, 2013 at 7:26 PM, Javier Guerra Giraldez wrote: > On Fri, Jun 28, 2013 at 1:16 PM, Gustavo Carneiro > wrote: > > I don't know what you mean. You can use apache mod_wsgi to have apache > > directly serve Django web apps[1], same as PHP. > > > in most cases, apache out of the box will let you simply drop *.php > files anywhere you have static files and they'll be interpreted. many > people consider that an advantage. > Yeah. It's easier, true, no need to do apache configuration. I see your point. On the other hand, scary. Putting on a sysadmin hat, the possibility of a PHP file accidentally lying around in certain places being able to be executed remotely would scare me. You _should_ be forced to do apache configuration, so that you tell apache explicitly what code can be executed. > > > -- > Javier > > -- > 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 django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." -- Frank Herbert -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.