Could you please suggest any available app for sending & managing emails in django?
You can find a detailed comparison here: http://www.djangopackages.com/grids/g/email/
You can try implement this youself using http://docs.python.org/library/poplib.html and http://docs.python.org/library/smtplib.html#smtp-example but, if you describe what concrete functionality you need, may be i can suggest some ready Django app for you needs.
Related
I'm using rabl_rails for generating json for my rails app and caching most of them for faster response. Things work great for non logged in users but I also want to able to cache responses for logged in users with their ID append in the cache key but as per the documentation, instance variables are not available in the rabl template due to the way its designed. You can find it here https://github.com/ccocchi/rabl-rails#how-it-works
What I am trying to achieve is this
cache "api/v1/home/top_menu_data-#{#current_user.id}"
but this doesn't work according to the document.
Has anyone done this before ? How do I achieve this ?
PS: This is feasible with rabl but not with rail_rails as far as I know. Would love to know ideas on how to be able to do this.
Thanks in advance.
As per the discussion with developer of the gem, its found that it can't access any instance variables or params hash. The discussion could be found here
I started using rabl for generating json for my views which works great.
I'm discovering django-activity-stream, I would like to use it on our website for showing a news feed based on follow relationships (like Twitter) and a profile feed. It seems perfect for doing this.
However, it doesn't seem really great for notifications feed. So :
Should I use django-notifications which is dedicated for this use case ? (Maybe both framework are meant to work as a pair, is there specific configuration for that ?)
Or should I just tweak django-activity-stream(considering that both framework are based on the same structure) and how ?
FYI : I don't need template features as I'm building a REST API (with django-rest-framework).
You just need to use both packages for their own purpose. Just follow their docs and you will get many thing answered.
django-notification is based on django-activity-stream and can be used for github-like notifications. you can serialize the django motifications models with django rest framework.
I want to limit my site to USA plus several outside-US IP adrresses (developers, QA etc..). And beside these, I want to display template saying "Coming soon to your country".
I'm curious if there's any easy or already developed plugin for this.
In Django the simplest way would be to use GeoIP and custom middleware to check every request.
On the Django level you can use GeoIP application from GeoDjango (thanks to ArturM).
But it's better do this on webserver level for performance purpose. If you are using ngingx, try HttpGeoIPModule. For apache - libapache2-mod-geoip
I am currently working an a webapp, using mongoengine and django, which will require users to create an account from a registration page. I know MongoEngine has an authentication backend, but does it also include a registration form, etc..., like django itself does? If not, are there any example projects which show how to implement this? The only open-source mongoengine project I've found is django-mumblr, but I can't find the examples I want in it.
I'm not interested in alternative options, such as MongoKit or mango for handling authentication.
I am just getting started with django and mongoDB, so please excuse my lack of knowledge. Thanks in advance for the help!
Not tried it out yet, but https://github.com/lig/django-registration-me by http://twitter.com/#!/lig1 looks like it could be a good bet.
Following this post (I was looking for a library allowing me to declare Django models on a ldap backend), I have decided to use ldapdb. After having played a while with this library, I figured out that it doesn't reach the level of control I need, and I am therefore looking for other solutions. What I am thinking of now is implementing a Django db backend based on python-ldap.
EDIT
I need this because I am currently implementing a user/group management system on a ldap directory (it requires to be able to manipulate not only users, but different classes of ldap objects as well). So basically, I would like to be able to use (nearly) full Django orm, but with a ldap backend.
Because I love Django (and would be rather motivated in learning the dirty low-level details of db.backends), and because there's already a lot of things implemented in this project, I would like to stick to Django (unless somebody has a very good reason why I shouldn't, and a very good alternative !).
Do some of you have a simpler solution to this problem ?
Do some of you know about an implementation of such a thing (ldap db backend) ?
Do some of you know some good reads to get started on "implementing a Django db backend"?
Are some of you interested in helping with this project ?
You make a lot of bold statements such as "lots of things broken because of the way it is implemented" and "the subclassing is very very far from being complete", would you care to elaborate on them? As the author of django-ldapdb I would welcome your suggestions as to what you would like changed/fixed, that's what the django-ldapdb mailing list is for!
FYI, I took the approach of subclassing the Model class because you will usually want to have just a couple of models using the LDAP backend, not all the models in your application, and django 1.1 did not support multiple databases. Also, LDAP is very different from existing SQL backends:
is not a relational database
it is not "flat", it is a tree-like
the true "primary key" for an entry is the Distinguished Name (DN), which is not an actual field, but a value computed from other fields
fields can be multi-valued
For all these reasons, I have serious doubts as to what can be achieved by writing a true LDAP backend. I think you will always have some LDAP-specific quirks, and subclassing Model allows just that.
Your best bet is probably to write an authentication backend for the application. Here is some documentation about it:
http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#writing-an-authentication-backend
And here is an article that explains how to extend the User model to enable you to use this authentication backend seamlessly:
http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/
Seems like there's no really good solution. And doing everything without Django's ORM is no good solution either.
I'll make new attempt at solving that problem soon, with a django-orm-based solution.