- ๐ Iโm currently working on technology stuff with Xplor
- ๐ฑ Iโm currently learning corporate finance ๐
- ๐ Pronouns: he/him
I enjoy Python and have published some packages on PyPI
WordPress models and views for Django.
License: BSD 3-Clause "New" or "Revised" License
I enjoy Python and have published some packages on PyPI
There is a small typo in wordpress/views.py.
Should read compatibility
rather than compatibilty
.
I installed django-wordpress successfully. I am willing to connect to a distant database.
INSTALLED_APPS += ('wordpress',)
WP_DATABASE = "db1234567890.db.xxx.com"
DATABASE_ROUTERS = ['wordpress.router.WordpressRouter']
However, the previous gives:
The connection db403846194.db.1and1.com doesn't exist
Is that something wrong with the portfowarding from my host machine to my Vagrant box?
And how am I supposed to set the db name, user and password of my MySQL database?
Hi, this projects is dead? or any people continue develop for compatibility with django1.10??
The wordpress tables were not created after "python manage.py syncdb"
Before Wordpress 4.2, Terms were shared by taxonomies. This means if a Term was updated, the change would be reflected in all taxonomies.
In Wordpress 4.2+, the terms are no longer shared, which introduces a case where there can be multiple terms with identical names and slugs. Furthermore, the DB schema does not enforce unique slugs.
In wordpress/views.py on line 132, this library uses get_object_or_404 to query for a Term by slug and a MultipleObjectsReturned error is thrown.
I would like to display an error message if the Wordpress database happens to be offline, but I get an exception when going to mydjangoapp.com/blog
OperationalError: (2003, "Can't connect to MySQL server on '10.0.2.2' (110)")
What should I do?
Also have a look at: http://stackoverflow.com/questions/25839018/handle-unhandled-exception-from-python-package
I created the tables with wordpress (http://codex.wordpress.org/Installing_WordPress), but got an new error:
ValueError: Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?
I have pytz installed.
Warning during django-admin migrate
:
System check identified some issues:
WARNINGS:
wordpress.Comment.author_ip: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
HINT: Use GenericIPAddressField instead.
Not sure if this project is still alive (ping @jcarbaugh ?) but it's currently incompatible with Django >= 2.0.
First problem I've run across is the ForeignKey
s lacking explicit on_delete
kwargs.
If this project is still alive and there's a chance of a release being made upon merging a PR, I'd be happy to create a pull request.
I'm using django-wordpress to import some existing content into a Wordpress installation, and I've got a management command that creates Post
objects using the ORM (and I've set wordpress.models.READ_ONLY = False
).
I've got something like:
post = Post()
post.title = '...'
post.author = user # I've created a wordpress.models.User object
... # additional content & required fields (e.g. the DateTimeFields), but I omit the parent field
post.save()
At this point, I get a Traceback like the following. It appears that the parent
field is required, even tho it is defined with null=True
.
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File ".venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File ".venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File ".venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File ".venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "myapp/management/commands/export_blog_to_wordpress.py", line 22, in handle
self.export_posts()
File "myapp/management/commands/export_blog_to_wordpress.py", line 160, in export_posts
wp.save() # We need the id before we can assign Categories
File ".venv/local/lib/python2.7/site-packages/wordpress/models.py", line 81, in save
super(WordPressModel, self).save(**kwargs)
File ".venv/local/lib/python2.7/site-packages/django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File ".venv/local/lib/python2.7/site-packages/django/db/models/base.py", line 551, in save_base
result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File ".venv/local/lib/python2.7/site-packages/django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File ".venv/local/lib/python2.7/site-packages/django/db/models/query.py", line 1576, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File ".venv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 910, in execute_sql
cursor.execute(sql, params)
File ".venv/local/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File ".venv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 114, in execute
return self.cursor.execute(query, args)
File ".venv/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 201, in execute
self.errorhandler(self, exc, value)
File ".venv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.IntegrityError: (1048, "Column 'post_parent' cannot be null")
Any ideas what's going on, here, and is this a bug or am I just doing something wrong?
My current workaround is this:
insert into wp_posts (ID) values (1);
post.parent = Post.objects.get(id=1)
before calling post.save()
Thanks in advance!
Hello @jcarbaugh ,
My django setting are the following
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'name',
'USER': 'dev',
'PASSWORD': 'password',
'HOST': 'host',
'PORT': '3306',
}
}
WP_DATABASE = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'wordpress',
'USER': 'username',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '8889',
}
}
Environment:
Request Method: GET
Request URL: http://192.168.33.10:8080/path/to/blog/
Django Version: 1.7.3
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'admin_app',
'rest_framework',
'rest_framework_swagger',
'djangoapps',
'djangoapps.applicants',
'djangoapps.catalog',
'djangoapps.ezylnx',
'djangoapps.landers')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
return self.dispatch(request, _args, *_kwargs)
return handler(request, _args, *_kwargs)
return super(Archive, self).get(request, _args, *_kwargs)
self.date_list, self.object_list, extra_context = self.get_dated_items()
date_list = self.get_date_list(qs, ordering='DESC')
if date_list is not None and not date_list and not allow_empty:
self._fetch_all()
self._result_cache = list(self.iterator())
return self.query.get_compiler(self.db).results_iter()
connection = connections[using]
if hasattr(self._connections, alias):
Exception Type: TypeError at /path/to/blog/
Exception Value: hasattr(): attribute name must be string
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.