Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Multipurpose flask-app written in Python 3.

Currently implemented:

  • Short link server
  • Paste server
  • Private image server.

The image server functionality currently doesn't resize images or confirm that they are images at all. Because of this, it is set up to require an API key.

This is a work in progress. Its current stable state runs at, and development at

Finding pastes with incorrect md5sums.

I don't yet know how this might happen, but incase it does, do this:

echo "select id, data from qxlc_data where type = 1;" | sqlite3 qxlc.db | python3 pastes | sqlite3 qxlc.db
echo "select id, data from qxlc_data where type = 2;" | sqlite3 qxlc.db | python3 images | sqlite3 qxlc.db

If you are experiencing pasting something and having the resulting url have different content, the above may fix it.


You can install on your own server using nginx and uwsgi. You will need python3, nginx, uwsgi and virtualenv installed.


Clone qxlc into /var/www/qxlc/ using git. git clone /var/www/qxlc/


Chown /var/www/qxlc/ to whatever user your going to run with. I use the user 'azd'.

[sudo] chown -Rc azd:azd /var/www/qxlc/

Create a virtualenv for qxlc to run in. I used the directory /var/www/envs/qxlc/, but feel free to use any dir. This directory should be owned by the user you are running qxlc under (in my case 'azd').

[sudo] mkdir /var/www/envs/
[sudo] chown -Rc azd:azd /var/www/envs
cd /var/www/envs/
virtualenv -p python3.4 qxlc

Activate the new virtualenv, and install all required dependencies.

source /var/www/envs/qxlc/bin/activate
pip install -r /var/www/qxlc/requirements.txt

Configure uwsgi to run qxlc. This can be done by creating a /etc/uwsgi/apps-available/qxlc.ini file, and putting the following contents:

# Bind to localhost port 3032
socket =
# Use the qxlc installation in /var/www/qxlc/
wsgi-file = /var/www/qxlc/qxlc.wsgi
# Use the virtualenv in /var/www/envs/qxlc/
virtualenv = /var/www/envs/qxlc/
callable = application
# Use azd as the user/group for running qxlc
uid = azd
gid = azd
# We aren't really loaded enough to need multiple processors
processes = 1
# Enable threads so that the github_pull function can use a ThreadPoolExecutor to execute
# Since we're enabling threads anyways, might as well use two of them for serving content
threads = 2
# Don't give write permission to group or other
umask = 022

You probably want to change the uid and gid settings to match the user you are running qxlc under. You can also change the processes and threads options to optimize for your machine. If you are running multiple uwsgi apps on the machine you can also change the :3032 part of the socket option, just be sure to change it in the nginx configuration file as well.

Then enable the app by using [sudo] ln -s /etc/uwsgi/apps-available/qxlc.ini /etc/uwsgi/apps-enabled/.


Configure nginx to run qxlc. This can be done by creating a /etc/nginx/sites-available/qxlc file, and putting the following contents:

# Handle http requests for
server {
    # replace and 2604:180:1::d4c6:e0de with your ipv4 and ipv6 addresses respectively.
    listen [2604:180:1::d4c6:e0de]:80;
    # replace with your server name

    location / {
        include uwsgi_params;
        # This should be the same as the `socket` option in the uwsgi conf

If qxlc is the only web server running on the configured IP address, you can also add the following section to the configuration file to redirect all traffic to that IP address to qxlc. This will also handle www.

/ redirection.

# Redirect all http requests for unknown sites to
server {
    listen default_server;
    listen [2604:180:1::d4c6:e0de]:80 default_server;
    # replace '' with your webserver address
    return 301 $scheme://$request_uri;

Copy /var/www/qxlc/config.default.json to /var/www/qxlc/config.json. Then edit the config with the values you need for your setup.

"base_url" should be the base URL for the qxlc app. It shouldn't have an ending slash. In my case, ''. This url is used for giving out links.

"database" should be the SQLAlchemy database URL for the database to store links and IDs in.


Restart uwsgi and reload nginx, and you should be good to go!

[sudo] service uwsgi restart
[sudo] service nginx reload


Paste/link/image server written in Python 3 using Flask







No releases published


No packages published