|
Hi, just want to know anyone succeeded in integrating osqa with an existing django project(django version 1.2.3) the steps I've tried with are: 1) get the latest svn trunk, with is r611 into a new directory
4) run python manage.py runserver
Following these steps, however, I can't log in with an existing user. I did some investigation on the source, it turns out there're two problems: 1) within forum_modules/localauth/forms.py
here the user_ is actually the result of calling
which is an django.contrib.auth.User instance and has no attribute user 2) after fixing the aforementioned problem by changing line 81 to
I still got problems by process_provider_signin in forum/views/auth.py
based on following logic, it seems to me assoc_key is expected to be an forum.User object, but since
it's an django.contrib.auth.User and can't pass following tests and the authentication eventually failed. My guess is somewhere within localauth we need to do sth to wrap up a django user into an osqa user, and at the same time store it to the database if it doesn't previously exists. Any comments? |
|
This question has become old. But here it goes. OSQA is not meant to be integrated with other django apps. Anyway, that integration is not that hard, and you don't need to mess with that code, there is no problem with it, actually has almost zero relation with your problem. Here's a couple of followup questions: How are you planning on do the integration? Which app will be in charge of the registration process and all that stuff? Do you already have an existing user base, or you're just testing? |
|
I did actually check some relevant questions before posting my own but unfortunately they didn't help me much. I still think there's some issue within forum_modules/localauth/forms.py, as the user_ is the direct result of calling django.contrib.auth.authenticate(), it is a legal django.contrib.auth.models.User and in no way has it a "user" attributed expected in the code. Here're my answers for your questions:
I want osqa run as a separate project, more specifically with a separate fcgi process, but it will reuse the existing django project's user table. Previously our site has a simple forum based on django-forum and I want it replaced by osqa, to migrate the data is another topic.
The existing django app will be responsible for registration, but I want to try something described in this post to make osqa share the same login. So what I wish is there is a link like "Q&A" on the main project and when users click on it they will navigate to osqa without the need to re-login.
Yes I've have existing user base already and I take this approach very seriously. So lemme explain you why So my suggestion is that, you make some changes to the extended user middleware, or better yet, you can just make it a module, so that whenever you see an users without the necessary "dependencies" you can just create them on the fly and move on. Its just a one way proccess, cause the OSQA user is just an extension of the auth User, and unless there is some very weird check on the existing django-app, it shouldn't even notice the difference.
(11 Nov '10, 06:12)
Hernani Cerq... ♦♦
|