This may not be a doi plugin issue and may be a "we haven't done something right in ckan" problem, but I'll see what you think...
We currently have 2 existing datasets created before the plugin was added, neither has the "cite this data" button. I'm assuming this is to be expected.
Next, somewhat fundamental, problem... if I then try and add a new data set after adding the doi plugin this happens:
[Wed Mar 25 12:24:52 2015] [error] /usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py:79: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead.
[Wed Mar 25 12:24:52 2015] [error] sess._flush_warning("related attribute set")
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] Error - <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'endswith'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] URL: http://<removed>/dataset/new
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] app_iter = self.application(environ, sr_checker)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] resp = self.call_func(req, *args, **self.kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return self.func(req, *args, **kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return request.get_response(self.app)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] application, catch_exc_info=False)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] app_iter = application(self.environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] resp = self.call_func(req, *args, **self.kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return self.func(req, *args, **kwargs)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] response = request.get_response(self.app)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] application, catch_exc_info=False)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] app_iter = application(self.environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return self.app(environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return self.wrap_app(environ, session_start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] response = self.app(environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] response = self.dispatch(controller, environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return controller(environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/lib/base.py', line 338 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] res = WSGIController.__call__(self, environ, start_response)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in __call__
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] response = self._dispatch_call()
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] response = self._inspect_call(func)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] result = self._perform_call(func, args)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return func(**args)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py', line 535 in new
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] return self._save_new(context, package_type=package_type)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/controllers/package.py', line 952 in _save_new
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] pkg_dict = get_action('package_create')(context, data_dict)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py', line 424 in wrapped
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] result = _action(context, data_dict, **kw)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/src/ckan/ckan/logic/action/create.py', line 207 in package_create
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] item.after_create(context, data)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/local/lib/python2.7/dist-packages/ckanext_doi-0.2-py2.7.egg/ckanext/doi/plugin.py', line 54 in after_create
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] create_unique_identifier(pkg_dict['id'])
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/local/lib/python2.7/dist-packages/ckanext_doi-0.2-py2.7.egg/ckanext/doi/lib.py', line 33 in create_unique_identifier
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] identifier = os.path.join(get_prefix(), '{0:07}'.format(random.randint(1, 100000)))
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] File '/usr/lib/python2.7/posixpath.py', line 68 in join
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] elif path == '' or path.endswith('/'):
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] AttributeError: 'NoneType' object has no attribute 'endswith'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] CGI Variables
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] -------------
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] AUTH_TYPE: 'cookie'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] CKAN_CURRENT_URL: '/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] CKAN_LANG: 'en'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] CKAN_LANG_IS_DEFAULT: True
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] CONTENT_TYPE: 'application/x-www-form-urlencoded; charset=utf-8'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] DOCUMENT_ROOT: '/etc/apache2/htdocs'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] GATEWAY_INTERFACE: 'CGI/1.1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_ACCEPT_ENCODING: 'gzip, deflate'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.8,en-GB;q=0.6'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_CACHE_CONTROL: 'max-age=0'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_CONNECTION: 'close'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_COOKIE: 'auth_tkt="7952cf5e11301fd24a7b61e73fc51258550aaa0e<removed>!userid_type:unicode"; ckan=f7e23d8d984755112da64e6297bf6cfefaa07faa275d5ed345c9420a8d8068b8e40fd11b'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_HOST: '<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_ORIGIN: 'http://<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_REFERER: 'http://<removed>/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] HTTP_USER_AGENT: 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] PATH_INFO: '/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] PATH_TRANSLATED: '/etc/ckan/default/apache.wsgi/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REMOTE_ADDR: '127.0.0.1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REMOTE_PORT: '39456'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REMOTE_USER: u'<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REMOTE_USER_DATA: 'userid_type:unicode'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REMOTE_USER_TOKENS: ['']
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REQUEST_METHOD: 'POST'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] REQUEST_URI: '/dataset/new'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SCRIPT_FILENAME: '/etc/ckan/default/apache.wsgi'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_ADDR: '127.0.0.1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_ADMIN: '[no address given]'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_NAME: '<removed>'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_PORT: '80'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_PROTOCOL: 'HTTP/1.0'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_SIGNATURE: '<address>Apache/2.2.22 (Ubuntu) Server at <removed> Port 80</address>\\n'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] SERVER_SOFTWARE: 'Apache/2.2.22 (Ubuntu)'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1]
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] WSGI Variables
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] --------------
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] application: <fanstatic.publisher.Delegator object at 0x7f421af1cdd0>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] beaker.cache: <beaker.cache.CacheManager object at 0x7f421af1c050>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7f421b54dfd0>>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] beaker.session: {'_accessed_time': 1427286292.06159, '_creation_time': 1427210729.204602}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] fanstatic.needed: <fanstatic.core.NeededResources object at 0x7f421af1c290>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.application_group: 'default.ckanhosted.com|'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.callable_object: 'application'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.handler_script: ''
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.input_chunked: '0'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.listener_host: ''
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.listener_port: '8080'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.process_group: 'ckan_default'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.request_handler: 'wsgi-script'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.script_reloading: '1'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] mod_wsgi.version: (3, 3)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] paste.cookies: (<SimpleCookie: auth_tkt='7952cf5e11301fd24a7b61e73fc51258550aaa0e<removed>!userid_type:unicode' ckan='f7e23d8d984755112da64e6297bf6cfefaa07faa275d5ed345c9420a8d8068b8e40fd11b'>, 'auth_tkt="7952cf5e11301fd24a7b61e73fc51258550aaa0e<removed>!userid_type:unicode"; ckan=f7e23d8d984755112da64e6297bf6cfefaa07faa275d5ed345c9420a8d8068b8e40fd11b')
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] paste.registry: <paste.registry.Registry object at 0x7f421b2f8490>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] paste.throw_errors: True
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] pylons.action_method: <bound method PackageController.new of <ckan.controllers.package.PackageController object at 0x7f421ae10f90>>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] pylons.controller: <ckan.controllers.package.PackageController object at 0x7f421ae10f90>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] pylons.pylons: <pylons.util.PylonsContext object at 0x7f421af21450>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] pylons.routes_dict: {'action': u'new', 'controller': u'package'}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] repoze.who.api: <repoze.who.api.API object at 0x7f421b2f3410>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] repoze.who.identity: <repoze.who identity (hidden, dict-like) at 139921895957488>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] repoze.who.logger: <logging.Logger object at 0x7f421af1ce50>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] repoze.who.plugins: {'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7f421b2f8b50>, 'friendlyform': <FriendlyFormPlugin 139921900667664>, 'auth_tkt': <CkanAuthTktCookiePlugin 139921900667600>}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] routes.route: <routes.route.Route object at 0x7f421b403150>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] routes.url: <routes.util.URLGenerator object at 0x7f421af21490>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] webob._parsed_post_vars: (MultiDict([('_ckan_phase', 'dataset_new_1'), ('pkg_name', ''), ('title', 'testing'), ('name', 'testing'), ('notes', 'blah'), ('tag_string', ''), ('license_id', 'notspecified'), ('url', 'dfgdfg'), ('version', 'dg'), ('author', 'dfg'), ('author_email', 'dfgdf'), ('maintainer', 'dgffd'), ('maintainer_email', 'dfgfd'), ('extras__0__key', ''), ('extras__0__value', ''), ('extras__1__key', ''), ('extras__1__value', ''), ('extras__2__key', ''), ('extras__2__value', ''), ('save', '')]), <FakeCGIBody at 0x7f421af1c850 viewing MultiDict([('_c...'')])>)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] webob._parsed_query_vars: (GET([]), '')
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] webob.adhoc_attrs: {'errors': 'ignore', 'response': <Response at 0x7f421af1c150 200 OK>, 'language': 'en-us'}
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] webob.is_body_readable: True
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] webob.is_body_seekable: False
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] wsgi process: 'Multi process AND threads (?)'
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f421b2f4300>
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] wsgi.version: (1, 1)
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f421af21490>, {'action': u'new', 'controller': u'package'})
[Wed Mar 25 12:24:52 2015] [error] [client 127.0.0.1] ------------------------------------------------------------
[Wed Mar 25 12:24:52 2015] [error] 2015-03-25 12:24:52,830 INFO [ckan.lib.base] /dataset/new render time 0.762 seconds
[Wed Mar 25 12:24:52 2015] [error] 2015-03-25 12:24:52,958 INFO [ckan.lib.base] /api/i18n/en render time 0.001 seconds