-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to start discussion? #9
Comments
Hi Ted, thanks for your feedback! There should be nothing stopping you from using django's built-in authorization/authentication. In fact, I'm using it in my project. Are you having any troubles? I'll gladly help. :) You are not forced to use the token, you can just leave it unset and you should be good to go to use the admin. About the forums, I'm not entirely sure if it would help. I think most of the people are too lazy to create a forum account and most of them already have a git accout. But of course, if you have the time I'd love if you could create a forum for us. Many thanks in advance. Cya! |
Hi Bernardo, From: Bernardo Pires reply@reply.github.com Hi Ted, thanks for your feedback! There should be nothing stopping you from using django's built-in authorization/authentication. In fact, I'm using it in my project. Are you having any troubles? I'll gladly help. :) You are not forced to use the token, you can just leave it unset and you should be good to go to use the admin. About the forums, I'm not entirely sure if it would help. I think most of the people are too lazy to create a forum account and most of them already have a git accout. But of course, if you have the time I'd love if you could create a forum for us. Many thanks in advance. Cya! Reply to this email directly or view it on GitHub: |
Hi Ted, thanks again for your feedback! What do you mean with client? Do you mean tenant? If that is the case, I think you misunderstood a little how this app works. The client can always be deduced from the URL. You don't need a foreign key because you only have access to the current tenant's schema. The data of the tenants are all separate. On a previous version I did have a private token instead of a public token. I did have some problems because of the URL routers and apps being used on tenant schemas. I still haven't thought of a better solution. However, any problems you encounter feel free to write here and we will think of something. :) Cheers, |
Bernardo, --- On Sun, 8/5/12, Bernardo Pires reply@reply.github.com wrote: From: Bernardo Pires reply@reply.github.com Hi Ted, thanks again for your feedback! What do you mean with client? Do you mean tenant? If that is the case, I think you misunderstood a little how this app works. The client can always be deduced from the URL. You don't need a foreign key because you only have access to the current tenant's schema. The data of the tenants are all separate. On a previous version I did have a private token instead of a public token. I did have some problems because of the URL routers and apps being used on tenant schemas. I still haven't thought of a better solution. However, any problems you encounter feel free to write here and we will think of something. :) Cheers, Reply to this email directly or view it on GitHub: |
Hi Ted, oh I think I now understand what you ment. You want your tenants to also be able to login (to some sort of tenant control panel) from your main domain and not from the tenant subdomain, that's why you need a foreign key on your client to the user class, right? Yeah, feel free to add whichever models you want to the tenant model, but remember that they are only being selected from the public schema. Any problems you have feel free to write an issue! :) Cheers, |
Bernardo, --- On Sun, 8/5/12, Bernardo Pires reply@reply.github.com wrote: From: Bernardo Pires reply@reply.github.com Hi Ted, oh I think I now understand what you ment. You want your tenants to also be able to login (to some sort of tenant control panel) from your main domain and not from the tenant subdomain, that's why you need a foreign key on your client to the user class. Yeah, feel free to add whichever models you want to the tenant model, but remember that they are only being selected from the public schema. Any problems you have feel free to write an issue! :) Cheers, Reply to this email directly or view it on GitHub: |
Hi Ted, I did a small research about your concerns because I myself haven't had any big problems so far. Apparently the whole problem is around pg_dump, which for every call needs to scan all tables in the database. So if you are calling pg_dump for each schema, it will be highly inefficent (assuming you have n schemas with m tables each, you'd scan in total n_n_m tables). I assume this is how Heroku's pg:backup tool works, that is, it uses pg_dump. Here's the thread I based my reply on: http://postgresql.1045698.n5.nabble.com/Thousands-databases-or-schemas-td5731189.html I myself use amazon AWS for my solution and I right now I only have 4 schemas, so I haven't had any big troubles. Anyhow, even if I had more schemas, I shouldn't have the problem you mentioned because my backups are all file-system backups (amazon incremental snapshots), so it's extremely fast and doesn't depend on postgresql at all. There should be however no problem with performance on Heroku besides any tools that rely on pg_dump. So if you can find an alternativate with Heroku for the backups you shouldn't be concerned. Cheers, |
Thank you for your reply Bernardo! I have pushed my code to dotcloud's sandbox and am thinking about doing the same into Heroku's sandbox. I need to use dotcloud's paid service to exercise schemas for subdomains, however, so I will likely need to cough up some money sooner than I had hoped. For me, it will likely be between dotcloud and Heroku for production. --- On Wed, 11/14/12, Bernardo Pires Carneiro notifications@github.com wrote: From: Bernardo Pires Carneiro notifications@github.com Hi Ted, I did a small research about your concerns because I myself haven't had any big problems so far. Apparently the whole problem is around pg_dump, which for every call needs to scan all tables in the database. So if you are calling pg_dump for each schema, it will be highly inefficent (assuming you have n schemas with m tables each, you'd scan in total n_n_m tables). I assume this is how Heroku's pg:backup tool works, that is, it uses pg_dump. Here's the thread I based my reply on: http://postgresql.1045698.n5.nabble.com/Thousands-databases-or-schemas-td5731189.html I myself use amazon AWS for my solution and I right now I only have 4 schemas, so I haven't had any big troubles. Anyhow, even if I had more schemas, I shouldn't have the problem you mentioned because my backups are all file-system backups (amazon incremental snapshots), so it's extremely fast and doesn't depend on postgresql at all. There should be however no problem with performance on Heroku besides any tools that rely on pg_dump. So if you can find an alternativate with Heroku for the backups you shouldn't be concerned.
|
You could also check amazon's AWS free tier if you have the time to fiddle with server configurations. I used an image that already had postgresql, django and apache installed. It's from bitnami, I'll send you the link if you are interested. You have full root access to the server on amazon, so you can do pretty much anything you want with it. I had no problem setting up apache to route all subdomains to my django project so I don't have to setup any subdomains manually. |
Bernardo, From: Bernardo Pires Carneiro notifications@github.com You could also check amazon's AWS free tier if you have the time to fiddle with server configurations. I used an image that already had postgresql, django and apache installed. It's from bitnami, I'll send you the link if you are interested. You have full root access to the server on amazon, so you can do pretty much anything you want with it. I had no problem setting up apache to route all subdomains to my django project so I don't have to setup any subdomains manually.
|
Hi Ted, you are definitely right that it will be extra work to get everything working under AWS, but it should be worth on the long run, specially if you are short on cash and want fine grained control over everything on the server. This is the image I used to get everything up and working quickly: http://bitnami.org/stack/djangostack. I also try to use the most amazon services I can. I don't like reinventing the wheel and that saves time. So I use Amazon's Route 53 for DNS and Amazon's SES for sending e-mails (there's a neat app called django-ses that makes everything pretty easy). So I didn't have to worry about setting my own email server up, which would be a huge pain in the ass. There was an additional factor that I considered when picking amazon that was that they had servers in São Paulo, in Brazil, where all my clients are located. Pretty much all services like Heroku only support servers in the US. Amazon has servers everywhere, US, Europe, South America, Asia, Australia. If I were you, I'd make some sort of pros/cons list and try to figure it out if the extra bucks on Heroku are worth it. If I had the money and if they had servers in Brazil I think I'd have picked Heroku. Cheers, |
Hi Bernardo, From: Bernardo Pires Carneiro notifications@github.com Hi Ted, you are definitely right that it will be extra work to get everything working under AWS, but it should be worth on the long run, specially if you are short on cash. This is the image I used to get everything up and working quickly: http://bitnami.org/stack/djangostack. I also try to use the most amazon services I can. I don't like reinventing the wheel and that saves time. So I use Amazon's Route 53 for DNS and Amazon's SES for sending e-mails (there's a neat app called django-ses that makes everything pretty easy). So I didn't have to worry about setting my own email server up, which would be a huge pain in the ass. There was an additional factor that I considered when picking amazon that was that they had servers in São Paulo, in Brazil, where all my clients are located. Pretty much all services like Heroku only support servers in the US. If I were you, I'd make some sort of pros/cons list and try to figure it out if the extra bucks on Heroku are worth it. If I had the money and if they had servers in Brazil I think I'd have picked Heroku. Cheers, Bernardo
|
Bernardo -
This is not an issue perse, but more a question about communications about this project. What you are doing is very important for SaaS apps, and I have forked the code and started to explore it for my own SaaS development. There does not seem to be a place for communications on django-tenant-schemas, like a forum. Has there been one set up? I think some sort of forum could really generate a lot of interest and positive contributions.
I'm interested in using the code, but would like to get it to work with Django's built-in authorization/authentication. I've looked at Django simple multi-tenant and this blog: http://www.loggly.com/blog/2009/12/django-middleware-munging/ , so I think with a little effort, we can get some good authorization/authentication supported leveraging existing stuff.
Also, it would be great to use it with Django contrib.admin. With the current setup using your public token, the code will need some small work to enable that.
Thanks,
Ted (surfer26th@gmail.com)
The text was updated successfully, but these errors were encountered: