Re: django-facebookconnect

2009-06-26 Thread Alen Mujezinovic

Hm, I didn't use this application, but there's another one on
http://code.google.com/p/django-fbconnect which is quite easy to use.

cheers, alen

Am Freitag, den 26.06.2009, 07:16 -0700 schrieb R C:
> Well more good newsit seems the reason things weren't working was
> because Facebook had a problem.
> 
> Now the next problem I'm having is that I keep getting this error:
> 
> Warning at /facebook/setup
> Out of range value adjusted for column 'facebook_id' at row 1
> 
> Any ideas?
> 
> Thanks
> 
> 
> 
> 
> 
> 
> 
> On Jun 26, 3:01 pm, R C  wrote:
> > Well I have solved part of my problem:
> >
> > There are updated installation 
> > instructionshttp://code.google.com/p/django-facebookconnect/issues/detail?id=1
> >
> > But the problem remains:
> > When I click on the facebook connect button I get redirected to
> >
> > http://xxx.com/facebook/setup?next=/accounts/profile/
> > (I have replaced my site with xxx)
> >
> > How do I get the facebook login box to popup and for that to create
> > accounts, etc?
> >
> > On Jun 26, 2:04 pm, R C  wrote:
> >
> > > Hi Everyone,
> >
> > > I've been trying to get the django-facebookconnect (http://
> > > code.google.com/p/django-facebookconnect/) app working with my site.
> >
> > > The problem I'm having is that I don't know how to "plug-in" the views
> > > and urls for this plugin
> >
> > > I have "hacked" it by simply copying the urls.py from the
> > > facebookconnect project into my project/urls.py but I'm not sure if
> > > this is what I should be doing.
> >
> > > Does anyone have any experience getting the urls, views, templates,
> > > etc working with this?
> >
> > > What I would ideally like to do is the following:
> >
> > > 1) user is presented with an option to facebook-login or django-login
> > > (provided by django-registration)
> > > 2) if the user chooses django-logineverything goes as normal for
> > > django-registration
> > > 3) if the user chooses facebook-login: facebook connect login pops up,
> > > user enters credentials
> > > then:  user has option to create an account on my site, link their
> > > facebook account to an existing django-account on my site, or do
> > > nothing
> >
> > > Any ideas?  All help is greatly appreciated.
> >
> > > thanks!
> >
> >
> 
-- 
Alen Mujezinovic | http://www.caffeinehit.com 


Earn cash in your spare time -- blackmail your friends.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: About managing dependencies in a collaborative development team and good practices.

2012-02-23 Thread Alen Mujezinovic
Hi Santiago


All the mentions of virtualenv and pip are good, but I want to throw in 
another suggestion that will make your life a lot easier when working in 
teams and lower the discrepancy between "development machine" and "live 
server": Vagrant [1].

In fact, we're now running *all* projects in vagrant vm's with automated 
provisioning. Adding a new coder to the team involves 

* Checking out the repository that contains 
** the vagrant configuration file
** the requirements.txt
** the setup.py
** the provisioning recipes

* running `vagrant up`

And you'll have a complete mini server that runs exactly the same 
architecture on each team member's dev machine and server.

Alen


[1] http://vagrantup.com/


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/nwExUXgJTx4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Walking the template / Partial rendering

2011-12-09 Thread Alen Mujezinovic
Hi group
I considered posting this to django-dev or opening a ticket but
decided to erron the side of caution.
I've been looking thoroughly through django's template code the last
two daysbecause I'd like to render only parts of templates.
Pseudocode:
    tpl = Template("""        {% block someblock %}foo{% endblock %}
     {% block otherblock %}bar{% endblock %}    """)        node =
tpl.get_block("someblock")    result =
node.render(template.Context({}))
The motivation to do this is to get rid of the overhead that goes into
templates when dealing with reasonably AJAX heavy and complex
templates. Thinkof a template structure like this:
        {% block body %}        {% block map %}{%
endblock %}        {% block content %}{% endblock %}            {%
endblock %}            {% extends "body.html" %}
{% block map %}{% endblock %}    {% block content %}
     {{ object_list|unordered_list }}    {% endblock %}            {% extends "map.html" %}    {% block content %}{{
object }}{% endblock %}
Ideally when requesting the page that serves pin.html via AJAX we'd
want to serve only the content that is in {% block content %}. One way
to do this
        {% extends "map.html" %}    {% block content
%}{% include "pin-detail.html" %}{% endblock %}
And the corresponding view:
    def pin(request, id):        #...        if request.is_ajax():
        tpl = loader.get_template("pin-detail.html")
content = json.dumps(content = tpl.render(Context({'object': pin})))
         return HttpResponse(content, mimetype = 'application/json')
     return render_to_response('pin.html', {'object': pin})
This gets very tedious with time and isn't desireable.
So I came up with a mixin that gets rid of the repetition. It checks
if the request is AJAX'd and if so, renders all the blocks listed in
`self.partials`and `json.dump`'s the result to the HttpResponse. It
all works, except:
* {{ block.super }} does not work without resolving the whole chain of
parent  templates and building up the quite complex corresponding
context. It's   basically a copy of the first half of the
`django.template.loader_tags.ExtendsNode.render` method.
* Rendering blocks that are part of a parent template but not the
current one   fails because of the complexity of how the context for
the current and its  parent blocks are created. I figure building up
the context properly is   duplicating too much of django's internals
to be sane work.
Ignoring these two points, it all works very well - but I'd also like
to be able to render blocks that do make use of {{ block.super }} and
that can bedefined at any point in the template chain. Ideally the
`BlockNode`, `ExtendsNode` and `Template` classes would provide some
methods to walk the chain and build the context.
Are you guys interested in having similar functionality? It would
involve somerefactoring of the template internals and probably some
decisions of the corecomitters - I wouldn't really want to change the
`Template` class because itis the interface to adopt for third party
template languages.
Also, here's more pseudo code to illustrutate how the partial mixin
looks whenused.
    class PinView(PartialRenderingView):        template_name =
'pin.html'        # Blocks to render and dump as json when doing AJAX
requests         partials = ['title', 'pin', 'form']
def get(request, id):            # ...             return
self.render_to_response(request, pin = pin, form = form)
 def post(request, id):            # ...            return
self.render_to_response(request, pin = pin, form = form)

Anyway. Thoughts?

Alen

-- 
http://twitter.com/flashingpumpkin
http://github.com/flashingpumpkin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Walking the template / Partial rendering

2011-12-09 Thread Alen Mujezinovic
Whoops. Editor ate the formatting. Here's the correctly formatted 
version: https://gist.github.com/d7b50c7449dfd09725ea

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/n6YA8FHUauUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Walking the template / Partial rendering

2011-12-09 Thread Alen Mujezinovic
Hey Tom

I've had a look through previous tickets if something similar came up and 
also looked at the link you posted. It's the right direction, but not quite 
what I'm trying. Pulling out a single block from a template and rendering 
is easy. It breaks and throws an `AttributeError` though as soon as you've 
got a `{{ block.super }}` in the block you've pulled from the template due 
to the context not being fully assembled:

http://dpaste.com/hold/670841/

Also, say I want to pick the block "map" from the parent template will not 
work without first walking manually up the chain, and again, build the 
context:

http://dpaste.com/hold/670842/

Alen






-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/sbqc07PVHbcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Walking the template / Partial rendering

2011-12-09 Thread Alen Mujezinovic
Also, here's the actual code that is used by the mixin to assemble the 
response:

https://gist.github.com/70beb521546d59deb207

Compare this to what is going on in  `ExtendsNode.render`:

https://code.djangoproject.com/browser/django/trunk/django/template/loader_tags.py#L103

The code in the gist does handle `{{ block.super }}` but it comes with the 
cost of duplicating a big part of the render method. Having the context 
assembly moved out of the render method in the `ExtendsNode` would already 
be a big step :)

Alen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/vUL82_HQ6QIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: rendering CSV in response; need a little help

2011-12-09 Thread Alen Mujezinovic
Hey

Here's what I use to add CSV export to the admin:

https://gist.github.com/46e6d19e6e08faefb476

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/3dDsN7eCWFQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Which IDE should I use for Django?

2011-12-21 Thread Alen Mujezinovic
PyDev.

You don't need to use Aptana to get PyDev. I dislike Aptana but really like 
PyDev. It's very feature rich and supports quite everything that I need

* Syntax / Error highlighting
* Virtual environments
* Documentation
* Autocompletion
* Jump-to-file/definition 

If you do use PyDev, don't use the Django projects though. Just create 
normal Python projects.

Alen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Lib-xVpvikQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.