From 30b5d08110c02dff7f51ae82b79e5987d79f68a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sat, 22 Jul 2017 20:20:09 +0200 Subject: [PATCH] Update installation docs --- doc/dev/configuration.rst | 39 ++++++++++++++++ doc/dev/index.rst | 3 ++ INSTALL.md => doc/dev/installation.rst | 84 +++++++++++++++++++--------------- doc/dev/postgres-setup.rst | 2 + 4 files changed, 92 insertions(+), 36 deletions(-) create mode 100644 doc/dev/configuration.rst rename INSTALL.md => doc/dev/installation.rst (58%) diff --git a/doc/dev/configuration.rst b/doc/dev/configuration.rst new file mode 100644 index 00000000..0c1d98b4 --- /dev/null +++ b/doc/dev/configuration.rst @@ -0,0 +1,39 @@ +.. _configuration: + +Configuration +============= + +* ADMINS +* ADSENSE_CLIENT +* ADSENSE_SLOT_BOTTOM +* BROKER_POOL_LIMIT +* BROKER_URL +* CACHE_BACKEND +* CACHE_LOCATION +* DATABASE_URL +* DEBUG +* DEFAULT_BASE_URL +* DEFAULT_FROM_EMAIL +* DIRECTORY_EXCLUDED_TAGS +* ELASTICSEARCH_SERVER +* ELASTICSEARCH_TIMEOUT +* FLATTR_KEY +* FLATTR_SECRET +* FLICKR_API_KEY +* GOOGLE_ANALYTICS_PROPERTY_ID +* GOOGLE_CLIENT_ID +* GOOGLE_CLIENT_SECRET +* LOGGING_CELERY_HANDLERS +* LOGGING_DJANGO_HANDLERS +* LOGGING_FILENAME +* LOGGING_MYGPO_HANDLERS +* MAINTENANCE +* OPBEAT_APP_ID +* OPBEAT_ORGANIZATION_ID +* OPBEAT_SECRET_TOKEN +* PODCAST_AD_ID +* SECRET_KEY +* SERVER_EMAIL +* SOUNDCLOUD_CONSUMER_KEY +* STAFF_TOKEN +* SUPPORT_URL diff --git a/doc/dev/index.rst b/doc/dev/index.rst index bbfa8f24..a2e29a07 100644 --- a/doc/dev/index.rst +++ b/doc/dev/index.rst @@ -26,5 +26,8 @@ Contents .. toctree:: :maxdepth: 1 + installation postgres-setup libraries + configuration + diff --git a/INSTALL.md b/doc/dev/installation.rst similarity index 58% rename from INSTALL.md rename to doc/dev/installation.rst index f79d64e8..0cbe2b31 100644 --- a/INSTALL.md +++ b/doc/dev/installation.rst @@ -1,5 +1,5 @@ -Deployment instructions for mygpo -================================= +Installation +============ Dependencies @@ -8,56 +8,71 @@ Dependencies When no version number is indicated, it is advisable to install the current development version from the repository. -* Python (>= 2.6) or PyPy (tested with 2.0 beta1) +* Python >= 3.5 * PostgreSQL Basic setup ----------- -Here's how you start from scratch with a new mygpo install (assuming a -Ubuntu 12.04 x86 install, 'should work' with other versions/archs as well). +On an Debian/Ubuntu based system, you can install dependencies with -If you are on a Debian/Ubuntu system, do: +.. code-block:: bash - sudo apt-get install erlang git python-pip python-dev libevent-dev + make install-deps -For creating logo thumbnails, install libraries for the various image formats. -They are used by the pillow library. - sudo apt-get install libjpeg-dev zlib1g-dev libpng12-dev +mygpo itself can be cloned from the repository: -Select a cozy place for the mygpo sources and clone it: +.. code-block:: bash git clone git://github.com/gpodder/mygpo.git cd mygpo -Now install additional dependencies locally (you could also use virtualenv or -some other fancy stuff): +Now install additional dependencies locally: + +.. code-block:: bash + + virtualenv venv + source venv/bin/activate pip install -r requirements.txt + pip install -r requirements-dev.txt # for local development + pip install -r requirements-doc.txt # for building docs + pip install -r requirements-setup.txt # for a productive setup + pip install -r requirements-test.txt # for running tests + That's it for the setup. Now to initialize the DB: +First run the commands from :ref:`db-setup`. Then + +.. code-block:: bash + cd mygpo python manage.py migrate ..and here we go: +.. code-block:: bash + python manage.py runserver -Ok, so you need a user. This requires e-mails to be sent. If your machine is -configured to send e-mail, that should work out well. If not, you can use the -Django E-Mail File Backend to "send" mails to a local folder: - mkdir inbox +Configuration +------------- + +For a development configuration you will probably want to use the following -Now, edit mygpo/settings_prod.py (or create it) and add the following lines: +.. code-block:: bash - import os.path + mkdir -p envs/local + echo django.core.mail.backends.console.EmailBackend > envs/local/EMAIL_BACKEND + echo secret > envs/local/SECRET_KEY + echo postgres://mygpo:mygpo@localhost/mygpo > envs/local/DATABASE_URL + echo True > envs/local/DEBUG - EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' - EMAIL_FILE_PATH = os.path.join(os.path.dirname(__file__), '..', 'inbox') +See :ref:`configuration` for further information. Accessing the dev server from other devices @@ -67,6 +82,8 @@ Sometimes you might want to access the server from another machine than localhost. In that case, you have to pass an additional argument to the runserver command of manage.py, like this: +.. code-block:: bash + python manage.py runserver 0.0.0.0:8000 Beware, though, that this will expose the web service to your all networks @@ -82,7 +99,8 @@ run special commands. This is usually done regularly on a production server using cron. You can also run these commands regularly on your development machine: - cd mygpo +.. code-block:: bash + python manage.py update-categories python manage.py update-toplist python manage.py update-episode-toplist @@ -96,6 +114,8 @@ commands regularly on your development machine: or to only do a dry run (this won't do any web requests for feeds): +.. code-block:: bash + python manage.py feed-downloader --list-only [other parameters] @@ -104,29 +124,21 @@ Maintaining publisher relationships with user accounts To set a user as publisher for a given feed URL, use: +.. code-block:: bash + cd mygpo python manage.py make-publisher [...] -Settings --------- - -Check the settings in mygpo/settings.py. If you want to change any settings, -add them to mygpo/settings_prod.py with the correct value. If you want to -avoid warning messages on startup, simply: - - touch mygpo/settings_prod.py - - - Web-Server ---------- Django comes with a development webservice which you can run from the mygpo directory with - python manage.py runserver +.. code-block:: bash -If you want to run a production server, check out + python manage.py runserver - https://docs.djangoproject.com/en/dev/howto/deployment/ +If you want to run a production server, check out `Deploying Django +`_. diff --git a/doc/dev/postgres-setup.rst b/doc/dev/postgres-setup.rst index dea96895..07f5b724 100644 --- a/doc/dev/postgres-setup.rst +++ b/doc/dev/postgres-setup.rst @@ -1,3 +1,5 @@ +.. _db-setup: + PostgreSQL Setup ================ -- 2.11.4.GIT