Installing

Warning

This project is still in an experimental state and may be unstable. Proceed at your own risk.

First, install the dependencies. If you already have Python & pip, you can install all the required Python modules with:

pip install -r requirements.txt

Then, download and unzip the latest release and follow these steps to initialize the site:

Generate a secret key

python manage.py generatekey

Configure the site URL

Replace <URL> with the URL of your website.

python manage.py configureurl <URL>

Create the database

python manage.py migrate

Collect the static files

These commands will compile and collect the static files (CSS, JS, etc).

python manage.py compilestatic
python manage.py collectstatic --noinput

Create an administrator account

You will be prompted for a name, email, and password. This account is needed to access the /admin page. You can create multiple administrator accounts.

python manage.py createsuperuser

Enable HTTPS

If you want to enable HTTPS, run this command:

python manage.py https on

To disable it, run:

python manage.py https off

Finally, set up the server

To set up the server you will need Apache, Nginx or any other web server that supports Django. Make sure the web server has the necessary permissions to access all the relevant files. Also, create the media and log directories beforehand to avoid possible errors.

Apache example

Apache requires mod_wsgi to be installed.

<VirtualHost *:80>
    ServerName my-site.com
    ServerAlias www.my-site.com
    ServerAdmin you@email.com

    <Location /admin>
        LimitRequestBody 51000000
    </Location>

    Alias /static /var/www/my-site.com/static
    <Directory /var/www/my-site.com/static>
        Require all granted
    </Directory>

    Alias /media  /var/www/my-site.com/media
    <Directory /var/www/my-site.com/media>
        Require all granted
    </Directory>

    WSGIDaemonProcess my-site python-path=/var/www/my-site.com:/var/www/my-site.com/.venv/lib/python3.6/site-packages
    WSGIProcessGroup my-site
    WSGIScriptAlias / /var/www/my-site.com/MangAdventure/wsgi.py process-group=my-site
    <Directory /var/www/my-site.com/MangAdventure>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>
</VirtualHost>

Nginx example

Nginx requires uwsgi to be installed.

server {
    listen 80;
    server_name my-site.com www.my-site.com;
    charset utf-8;

    location /admin {
        client_max_body_size 51M;
    }

    location /favicon.ico {
        access_log off;
        log_not_found off;
    }

    location /static {
        alias /var/www/my-site.com/static;
    }

    location /media  {
        alias /var/www/my-site.com/media;
    }

    location / {
        uwsgi_pass 127.0.0.1:25432;
        include uwsgi_params;
    }
}

Don’t forget to run uwsgi:

uwsgi --socket 127.0.0.1:25432 --chdir /var/www/my-site.com/ --module MangAdventure.wsgi

Updating

First, install any new or updated dependencies:

pip install -U -r requirements.txt

Then, compile and collect the static files:

python manage.py compilestatic
python manage.py collectstatic --noinput

Finally, update the database:

python manage.py migrate