Giter VIP home page Giter VIP logo

django-wordpress's Introduction

Hey

  • ๐Ÿš€ 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

Python badge

django-wordpress's People

Contributors

adamstrojek avatar collinanderson avatar ejesse avatar ferrix avatar flowerowl avatar jcarbaugh avatar twig avatar vanwarantion avatar wadewilliams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-wordpress's Issues

How are we supposed to set the database name, user and password for distant DB?

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?

this project is dead?

Hi, this projects is dead? or any people continue develop for compatibility with django1.10??

Querying for Terms can throw MultipleObjectsReturned error in Wordpress 4.2+, after taxonomy term split

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.

Change IPAddressField to GenericIPAddressField for Django 1.9 Support

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.

Django 2.x compatibility

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 ForeignKeys 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.

Post requires a parent even though null=True

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:

  1. Insert a dummy post with no content directly into the database: insert into wp_posts (ID) values (1);
  2. Set the following: post.parent = Post.objects.get(id=1) before calling post.save()

Thanks in advance!

Couldn't configure the database

Hello @jcarbaugh ,

My django setting are the following

For my django app

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'name',
'USER': 'dev',
'PASSWORD': 'password',
'HOST': 'host',
'PORT': '3306',
}
}

For wordpress

WP_DATABASE = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'wordpress',
'USER': 'username',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '8889',
}
}

I will really appreciate your help. I am constantly getting the error. Here is the trace back.

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

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  2.         return self.dispatch(request, _args, *_kwargs)
    
    File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  3.     return handler(request, _args, *_kwargs)
    
    File "/usr/local/lib/python2.7/dist-packages/wordpress/views.py" in get
  4.     return super(Archive, self).get(request, _args, *_kwargs)
    
    File "/usr/local/lib/python2.7/dist-packages/django/views/generic/dates.py" in get
  5.     self.date_list, self.object_list, extra_context = self.get_dated_items()
    
    File "/usr/local/lib/python2.7/dist-packages/django/views/generic/dates.py" in get_dated_items
  6.     date_list = self.get_date_list(qs, ordering='DESC')
    
    File "/usr/local/lib/python2.7/dist-packages/django/views/generic/dates.py" in get_date_list
  7.     if date_list is not None and not date_list and not allow_empty:
    
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in nonzero
  8.     self._fetch_all()
    
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _fetch_all
  9.         self._result_cache = list(self.iterator())
    
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in iterator
  10.     return self.query.get_compiler(self.db).results_iter()
    
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py" in get_compiler
  11.         connection = connections[using]
    
    File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py" in getitem
  12.     if hasattr(self._connections, alias):
    

Exception Type: TypeError at /path/to/blog/
Exception Value: hasattr(): attribute name must be string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.