the-paperless-project / paperless

Scan, index, and archive all of your paper documents
GNU General Public License v3.0
7.86k stars 499 forks source link

Make this a proper django package #46

Open spapas opened 8 years ago

spapas commented 8 years ago

Hello, thanks for the nice project!

Would you consider making a proper django package out of paperless for easier integration with other django projects? You'll just need to create a django-paperless (or something like that) package that contains (more or less) the documents app of this project and add it as a dependency.

Thanks!

danielquinn commented 8 years ago

I'd love to do this, if for no other reason that it'd make it easier to install, but while I've made django packages before, they've always just been one app, and at present, this is two (documents & logging). I'm unclear as to how to make a django package with more than one app.

Do you have any examples of packages out there that I might model paperless after in a case like this?

spapas commented 8 years ago

Hello @danielquinn, creating django packages with more than one application is really simple, just create a python package and put every app inside it! After you install that package you can include 'packagename.app1', 'packagename.app2' in your INSTALLED_APPS setting.

For example, take a look at wagtail: https://github.com/torchbox/wagtail/: It has a package named wagtail and all apps are inside it (wagtail.wagtailadmin, wagtail.wagtailcore etc). You'll then include them in your settings: http://docs.wagtail.io/en/v1.3.1/getting_started/integrating_into_django.html#settings

danielquinn commented 8 years ago

Looks good. Alright consider this a will-do feature, but I want to stabilise a few things before I start mucking about with the structure. Namely, I want to get the Docker situation finalised (should happen very soon) and then I want to get the API working so I can start on a nicer UI. When that's done, I'll be happy enough with this that I can submit it as a package to PyPi and I'll definitely be following your advice here.

So, I'm going to mark this as enhancement, but understand, that it'll be a while still before it happens unless you can give me a terribly compelling reason to do it sooner.

spapas commented 8 years ago

No problem! Also, a nicer UI (with non-admin views and where users would be able to upload files) would definitely be great !

romgar commented 8 years ago

I can help on that if you want !

danielquinn commented 8 years ago

Hi @romgar! Help is always welcome, especially if it comes in the form of pull requests. I've not been prioritising rolling Paperless into a proper Python package because I've wanted to focus on developing a better UI and/or some of the more user-facing issues like searching for non-ascii strings. However if you're feeling inspired, I'm happy to hear your ideas on how to get this cleaned up and PyPi friendly.

philippeowagner commented 7 years ago

There are a lot of Django based projects, for example Sentry, PyPI2 et al. that comes as stand alone projects. From my point of view the file upload and the UI as mentioned earlier should be done first.

danielquinn commented 7 years ago

Interesting. I was wondering if there was a best-practise way of turning a Django project into a pypi module, and this looks to be it. Well at least there's a nice project to mimic when I get around to doing this.