Lessn More is a fork of [Lessn](https://github.com/DavidSchaefer/lessn) with support for more types of short URLs than Lessn supported; stats; and other enhancements.
It's written in Python using CherryPy 3, SQLAlchemy, and Jinja2 for templating.
The code is licensed GPL3+. See the LICENSE file for details.
**Did you see my note above? I did not write this software and it's not me, so don't use my name or username anywhere on this site or its code!** This article was written by someone who got hold of the source code made some changes to it to fix bugs or add features. You should have seen that since it's in the article, but I'm putting this note here because people make assumptions...
The Lessn project was abandoned by its maintainer(s) in 2014. This fork has been created to support more types of short URLs than Lessn supported; include an API; and provide web stats using either PySimpleStats or mod_wsgi-stats .
**Hey!** Yes, I know about pymissile , but Lessn More is written with other projects in mind (see #Requirements). Besides, I think it's great that you are working on pymissile ! :-)
[[What type of short does the software support?]]
**Go to the [How-to](Installation) section.** Quick installation instructions are below!
<insert section header here>
See Installation for more info on the API, web stats, etc. Once you've got Lessn More installed, be sure to check out our API documentation ! You can also take a look at the source code , in case you're looking for hints on how to hack it... Please note that if you do hack Lessn More , I don't want any credit; I'd rather you didn't mention my name or username anywhere (you can include my email address though). Just send me a copy of changes and/or tell me how you made them, and I'll list your name as the developer if it's appropriate... Thanks!
- **Required dependencies (minimum)** : CherryPy 3.x; SQLAlchemy 0.8 or newer; Jinja2 2.x; pycrypto
- **Optional dependencies (recommended)** : PySimpleStats 1.0 or newer for stats
**If you're happy to use mod_wsgi, skip ahead to configuring mod_wsgi below** . Otherwise, read on... You can just copy lessnmore.py into an existing directory within your Apache webroot and then call that URL from a Web client such as a browser . If you want to use a different URL or directory to access Lessn More , edit lessn_more.py and change the relevant constants.
If you want to run it on your local PC (which is not advised) then you can just leave Apache out of the equation; in that case, simply create an entry in your `/etc/hosts` file for something like:
127.0.0.1 www . example . com
and run it locally by typing:
cd example_dir ; python3 lessnmore . py [ site ] [ post ] [ #links] [ URLs ] [ options ] [ useragent ] [ referer ]
**CherryPy 3.x** must be installed for Lessn More to work. Follow the instructions on CherryPy's site if you don't already have Python 3 and CherryPy 3.x installed.
**SQLAlchemy 0.8 or newer** must also be installed properly to support SQL database storage of hyperlinks (and, optionally, tracking visits). The preferred version is 1.0 , because it supports Python 3 better than older versions (which are very slow in testing with Python 3). You should follow SQLAlchemy's installation instructions . I used the one here: http://www.sqlalchemy-tutorial.org/en/latest/#quickstart
Note that if you decide to use SQLite as your database server, you won't need to install anything, since SQLite is a file rather than a server. In that case, just type this into your command line:
**Jinja2 2.x** is required for generating HTML from Lessn More's templates. Edit lessn_more.py and look for `TEMPLATE = 'jinja2'`. If you didn't want to use Jinja2 as the template engine, all you'd have to do would be remove `TEMPLATE = 'jinja2'` from lessn_more.py , import jinja2 in lessn_more.py , and change TEMPLATE = "jinja" to something else (like TEMPLATE = "base" ).
**pycrypto** is required for HTTPS support (recommended), and you should follow pycrypto's installation instructions . If you don't want to use HTTPS, just set `USE_SSL = None` in lessn_more.py .
After all that, simply put the Lessn More software somewhere where Apache can find it. I recommend creating a directory called `lessn-more/` within your Apache web root and putting the source code there under whatever name you like (I renamed mine to be `lessn_more/`, since I already had a directory called `lessn/`). Then, call that URL from your Web browser or other client!
- **Required configuration (minimum)** : You must edit lessn_more.py in your favorite text editor and change the constants at the top to reflect your site's URL(s), post URLs, short URLs, and other variables that I'll discuss in more detail later.
For example, if you want to use `example.com` as your main site URL and `subdomain.example.com` as a subdomain of that URL where Lessn More can store its data instead of a database, then you'd have to replace every instance of `localhost` with something like this: 'http://www.example.com' or 'http://subdomain . example . com'
Top Blog Posts
- Learn HTML in 12 Minutes 4 months ago
- FOCUS ON YOURSELF NOT OTHERS - Best Motivational Speech 2021 6 months ago
- British English Slang [Advanced Pronunciation Practice] - Reductions & Contractions 6 months ago
- How To Build Your URL Short System (Premium URL Shortening Setup) 6 months ago
- Best URL Shortener: Why You Should Shorten Your Links 2 months ago