Re: Login in all pages

2015-02-05 Thread Kristofer Pettijohn
I think the login decorator may give you what you are trying to do in a much easier way: https://docs.djangoproject.com/en/1.7/topics/auth/default/#limiting-access-to-logged-in-users Unless I am not understanding your issue. From: "Juan Diego Gonzalez" To:

Re: Tests and temp tables

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 3:16 PM, Carl Meyer wrote: > On 02/05/2015 11:20 AM, Larry Martell wrote: >> On Thu, Feb 5, 2015 at 10:53 AM, Carl Meyer wrote: >>> TransactionTestCase has been around for quite a long time (since 1.1, >>> IIRC). It's definitely in 1.5.

survey Site

2015-02-05 Thread sum abiut
Hi, I am planning to build a survey site using django just wondering if django is the best option to get survey done. Cheers -- 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

Re: Tests and temp tables

2015-02-05 Thread Carl Meyer
On 02/05/2015 11:20 AM, Larry Martell wrote: > On Thu, Feb 5, 2015 at 10:53 AM, Carl Meyer wrote: >> TransactionTestCase has been around for quite a long time (since 1.1, >> IIRC). It's definitely in 1.5. > > I thought it was not in 1.5 because I went to >

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 2:10 PM, Henry Versemann wrote: > I have a django view (django v. 1.7 ; python v. 2.7.8) which currently and > successfully sends a request to an api, and receives a good response back. > I'm sending and receiving using the 'requests' library (v.

how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-05 Thread Henry Versemann
I have a django view (django v. 1.7 ; python v. 2.7.8) which currently and successfully sends a request to an api, and receives a good response back. I'm sending and receiving using the 'requests' library (v. 2.4.3). Now in addition to sending the raw response data back in an HttpResponse I

Re: Tests and temp tables

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 10:53 AM, Carl Meyer wrote: > Hi Larry, > > On 02/05/2015 06:57 AM, Larry Martell wrote: >> On Thu, Feb 5, 2015 at 7:29 AM, Jani Tiainen wrote: >>> On Tue, 3 Feb 2015 19:38:31 -0500 >>> Larry Martell wrote: >>>

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Guilherme Leal
Lets aproach this from other angle. What effect this would have on your app? Despite the fact that are different subdomains, there are other logic that the app implements based on the subdomain? Em Thu Feb 05 2015 at 14:18:48, Abraham Varricatt < abraham.varric...@googlemail.com> escreveu: >

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
It's more like, if a user tried logging into http://www.example.com he would be redirected to http://.example.com. Any simple ways to enforce this? Visually, the 2 links would be identical to the end-user (barring their login name somewhere) -Abraham V. On Thu, Feb 5, 2015 at 9:37 PM,

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Guilherme Leal
I've made something similar. The app had multiple databases, and the database that was connected was based on the subdomain of the request. Basically, if you tried to log in with "http://test.exemple.com;, the database that would be used would be "test". The key to this feature was that the auth

Re: subdomains and HOST in settings.py?

2015-02-05 Thread mdj
If you're talking about ALLOWED_HOSTS, make sure you use something like ALLOWED_HOSTS = ['.example.com']. The dot is significant. You will also need to set SESSION_COOKIE_DOMAIN = '.example.com' so cookies work across subdomains. On Thursday, February 5, 2015 at 4:12:24 AM UTC-8, Abraham

the source code in utils.functional about lazy function

2015-02-05 Thread Fred Zhang
Recently I am learning about django source code from utils folder. But about* functional* file, I don't know the meaning of lazy function. Can anyboby help me to explain about the meaning about it? Thanks The code: class Promise(object): """ This is just a base class for the proxy

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
@Guilherme Leal, Yes, that's correct. Do you have any ideas? -Abraham V. On Thu, Feb 5, 2015 at 9:15 PM, Guilherme Leal wrote: > Basiacally, what you want to do is change the request subdomain based on > the user that logs on to the app. > > Ex: the url that hosts the

Re: Tests and temp tables

2015-02-05 Thread Carl Meyer
Hi Larry, On 02/05/2015 06:57 AM, Larry Martell wrote: > On Thu, Feb 5, 2015 at 7:29 AM, Jani Tiainen wrote: >> On Tue, 3 Feb 2015 19:38:31 -0500 >> Larry Martell wrote: >> >>> I have a django app that uses a temp table. In the real world this is >>>

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Guilherme Leal
Basiacally, what you want to do is change the request subdomain based on the user that logs on to the app. Ex: the url that hosts the login form (or whatever it is) is like "http://exemple.com/login;. After the user correctly logs in, every request will be made to de url

oracle syncdb crashes while setting column to NULL when it already is NULL

2015-02-05 Thread Joris Benschop
hi I'm not sure if this is a dev question or it should be posted here. Probably I did something dumb, so I hope you can help me doscover what that is: I'm trying to syncdb to an empty Oracle DB. Many tables, triggers and sequences are made but then this: -- ...

Re: Tests and temp tables

2015-02-05 Thread Larry Martell
On Thu, Feb 5, 2015 at 7:29 AM, Jani Tiainen wrote: > On Tue, 3 Feb 2015 19:38:31 -0500 > Larry Martell wrote: > >> I have a django app that uses a temp table. In the real world this is >> no issue, as each invocation of the app runs in its own MySQL

Login in all pages

2015-02-05 Thread Juan Diego Gonzalez
Hi, I need to put the django login feature in all pages, I mean, the user will be able to login in the reserved area of the web from any public page. I have all the implementation done, and it works with a single page, in this way: url(r'^home/$', magic.views.login,

Re: django user (using django ORM) + SQLAlchemy for other db tables

2015-02-05 Thread Mathieu Rodic
I have been working on a Django project, where complex queries were required... so the Django ORM was out of question. As I didn't want to have both Django and SQLAlchemy models hanging around, I chose to use aldjemy . You can use this simple tutorial

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Vijay Khemlani
I'm not following, in the Django settings there is no "HOST" entry (other than the one used to connect to the database) https://docs.djangoproject.com/en/1.7/ref/settings/ If you're talking about "ALLOWED_HOSTS", then that one is only a whitelist of allowed domains. Try and describe your

Strange error with reverse() when running tests

2015-02-05 Thread João Sampaio
There are 3 Python files attached. I have my URL file attached. I'm using django-rest-framework (in case you are wondering what the routers are). When I use ./manage.py test with the first file (file1.py), the tests succeed. When I do the very same thing with the second file, the tests fail.

Re: subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
Ok, I think I goofed up asking the question here. I noticed that there was a HOST setting defined in the django documentation and assumed it was the same thing, but some more code investigation, reveals otherwise. But I *am* running into a tangential issue. I mentioned that if I set the value

Re: Tests and temp tables

2015-02-05 Thread Jani Tiainen
On Tue, 3 Feb 2015 19:38:31 -0500 Larry Martell wrote: > I have a django app that uses a temp table. In the real world this is > no issue, as each invocation of the app runs in its own MySQL session > so there cannot be any conflict with the temp tables. But in my tests

subdomains and HOST in settings.py?

2015-02-05 Thread Abraham Varricatt
Hello, I'm trying to implement custom subdomains on a customer site and am having trouble understanding how the HOST option in settings.py works. The requirement is that if a user logs in, they should see their own username as the subdomain. So for example if we have 3 users - mark, alice and