mrmicjam / wp_django_auth Goto Github PK
View Code? Open in Web Editor NEWEnables django to register and authenticate wordpress users
Enables django to register and authenticate wordpress users
Please fill-in the README with the packages versions this library was supposed to work with.
Thanks and congratulations for this nice work
The failing code is
db = MySQLdb.connect(host=MYSQL_HOST, user=MYSQL_USER, passwd=MYSQL_PASSWD, db=MYSQL_DB)
cursor = db.cursor()
cursor.execute("select option_value from wp_options where option_name = 'logged_in_salt'")
log_in_salt = cursor.fetchone()[0]
because the query no longer returns anything on this WordPress version - the value with 'logged_in_salt' cannot be found inside wp_options table.
If I hard-code log_in_salt and auth_key with those from wp-config.php all tests are passing.
I think that you need to consider support for multiple WP versions. I will try to provide a patch for this, including processing of wp-includes/version.php where $wp_version holds the actual WP version.
Error:
(sandbox)cristi:wp_django_auth cristiroma$ python wp_django_auth.py
Traceback (most recent call last):
File "wp_django_auth.py", line 354, in <module>
test()
File "wp_django_auth.py", line 315, in test
cookie_name, cookie = generate_cookie(user_id)
File "wp_django_auth.py", line 92, in wrap
return func(*args, **kwargs)
File "wp_django_auth.py", line 195, in generate_cookie
log_in_salt = cursor.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
Packages:
Python 2.7.3
PHP 5.4.9 (cli) (built: Dec 17 2012 16:31:03)
WordPress 3.4.2
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.