ayoungpe / django-moinmoin Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/django-moinmoin
Automatically exported from code.google.com/p/django-moinmoin
I am a little confused about the required settings to get this working. Are
the wiki the admin site required to be on the same host *.domain.com or must
they be configured to share the same VirtualHost in Apache?
Original issue reported on code.google.com by [email protected]
on 29 Aug 2009 at 2:13
Hi there,
as i've not found patch submissions or just ideas submission, i just post
here something that perhaps could help.
in DjangoAuth.py, get_session and get_decoded could be modified in order to
respect more easily django settings (crypt or sha1 encodings, pickle or
database session persistence,...) :
def get_session(self, session_id):
from django.contrib.sessions.models import Session
try:
session = Session.objects.get(session_key=session_id)
except Session.DoesNotExist:
return False, ''
try:
from datetime import datetime
#Has the session expired?
if session.expire_date < datetime.now():
return False, ''
return True, session # here you return session directly
except:
return False, ''
def get_decoded(self, session): # simpler version :)
try:
return session.get_decoded()
except:
return {}
another thing could be done in __init__ in order to get all django settings
and not only some of them (as i used django and moinmoin in merge WSGI
settings, if you connect to moinmoin then go to django, the WSGI process
will only have some of django settings with the current code). As i do not
manage several django on same OS, i have choosen os.environ settings that's
possible if you use only one django instance in your os partition server:
from django.conf import settings
if <your django project parent directory> not in sys.path:
sys.path.append(<your django project parent directory>)
if <your django project directory> not in sys.path:
sys.path.append(<your django project directory>)
import <your django project name>.settings
import os
os.environ['DJANGO_SETTINGS_MODULE'] = '<your django project
name>.settings'
For example :
<your django project parent directory> : /home (where you've used
django-admin.py startproject mysite)
<your django project directory> : /home/mysite
You can also remove third assumptions as i'm using it on windows xp pro if
you just replace in writeLog(*args):
log = open('/<your log path>/djangoAuthMoinMoin.log', 'a')
a best thing will be to set a variable at the begin of the file (like
TMP_LOG=/tmp/ # +++ windows users should set a viable path here). you can
also use logging module.
regards,
bruce vinchon.
Original issue reported on code.google.com by [email protected]
on 3 Oct 2009 at 6:11
What steps will reproduce the problem?
1. in Wiki config, define auth to be [MoinAuth(),DjangoAuth(autocreate=True)
2. update the wiki with a request using Django credentials
3. update the wiki with a request using Moin credentials - it fails
What is the expected output? What do you see instead?
Expect to see an update in the wiki using MoinAuth credentials, but instead see
an invalid login.
What version of the product are you using? On what operating system?
Moin 1.9.2
Please provide any additional information below.
Here's the patch I used to fix it, copied from the internal GivenAuth method;
*** djangoAuth1.py 2010-10-10 09:23:18.155189239 -0400
--- djangoAuth.py 2010-10-10 09:23:27.456642073 -0400
***************
*** 102,107 ****
--- 102,114 ----
# user_obj = kw.get('user_obj') # +++ example does not use this
# username = kw.get('name') # +++ example does not use this
# logout = kw.get('logout') # +++ example does not use this; logout is expected in other application
+
+ if user_obj and user_obj.auth_method == self.name:
+ user_obj = None
+
+ if user_obj and user_obj.valid:
+ return user_obj, False
+
import Cookie
user = None # user is not authenticated
try_next = True # if True, moin tries the next auth method in auth list
Original issue reported on code.google.com by mark%[email protected]
on 10 Oct 2010 at 1:27
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.