Skip to content

Commit d56ffd0

Browse files
committed
Merge branch 'master' into oauth-login
2 parents b8c81c2 + 6a53bdd commit d56ffd0

192 files changed

Lines changed: 7011 additions & 2994 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*.pyc
2-
htdocs/media/logo/*
2+
media/*
33
logs/*
44
*.mo
55
mygpo/settings_prod.py
@@ -23,3 +23,9 @@ venv*
2323

2424
# envdirs
2525
envs
26+
27+
# Jupyter Notebooks
28+
notebooks/
29+
30+
.cache
31+
.pytest_cache

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: python
22

33
python:
4-
- "3.5"
54
- "3.6"
65
- "3.6-dev"
76
- "3.7-dev"
@@ -19,7 +18,7 @@ before_script:
1918
- psql -c 'create database mygpo_test;' -U postgres
2019

2120
script:
22-
coverage run --branch --source=mygpo ./manage.py test
21+
- pytest --cov=mygpo/ --cov-branch
2322

2423
after_script:
2524
- coveralls
@@ -28,3 +27,11 @@ env:
2827
- DATABASE_URL="postgres://postgres@localhost/mygpo_test"
2928

3029
sudo: false
30+
31+
# temporarily allow failures on 3.7
32+
# see https://github.com/chtd/psycopg2cffi/issues/95
33+
matrix:
34+
allow_failures:
35+
- python: "3.7-dev"
36+
- python: "nightly"
37+

Procfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
web: gunicorn mygpo.wsgi:application -c gunicorn.conf.py
2-
beat: python manage.py celery beat -S django --pidfile /var/run/mygpo/celerybeat.pid
1+
web: gunicorn mygpo.wsgi:application -c conf/gunicorn.conf.py
2+
beat: celery -A mygpo beat --pidfile /tmp/celerybeat.pid -S django
3+
celery: celery -A mygpo worker --concurrency=3 -l info -Ofair
File renamed without changes.

conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pytest
2+
3+
4+
@pytest.fixture(autouse=True)
5+
def enable_db_access_for_all_tests(db):
6+
""" Enable DB access for all tests
7+
8+
http://pytest-django.readthedocs.io/en/latest/faq.html#how-can-i-give-database-access-to-all-my-tests-without-the-django-db-marker """
9+
pass

doc/api/reference/devices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Update Device Data
4040
List Devices
4141
------------
4242

43-
.. http:post:: /api/2/devices/(username).json
43+
.. http:get:: /api/2/devices/(username).json
4444
:synopsis: list the user's devices
4545

4646
* Requires HTTP authentication

doc/dev/configuration.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,8 @@ Social Login
9595

9696
* ``GOOGLE_CLIENT_ID`` - Google Client ID
9797
* ``GOOGLE_CLIENT_SECRET`` - Google Client Secret
98+
99+
100+
API
101+
---
102+
* ``MAX_EPISODE_ACTIONS`` - maximum number of episode actions that the API will return in one `GET` request.

doc/dev/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gpodder.net
77
The sourcecode of the webservice gpodder.net is released as open source under
88
the `AGPLv3 <http://www.gnu.org/licenses/agpl-3.0.html>`_ and `hosted at GitHub
99
<https://github.com/gpodder/mygpo>`_. Bugs can be reported at the `gPodder
10-
Bugtracker <https://bugs.gpodder.org/enter_bug.cgi?product=gpodder.net>`_.
10+
Bugtracker <https://github.com/gpodder/mygpo/issues>`_.
1111

1212
Integrating Clients
1313
-------------------
@@ -30,3 +30,4 @@ Contents
3030
postgres-setup
3131
libraries
3232
configuration
33+
jupyter-notebook

doc/dev/installation.rst

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,7 @@ Now install additional dependencies locally:
4343
pip install -r requirements-test.txt # for running tests
4444
4545
46-
That's it for the setup. Now to initialize the DB:
47-
48-
First run the commands from :ref:`db-setup`. Then
49-
50-
.. code-block:: bash
51-
52-
cd mygpo
53-
python manage.py migrate
54-
55-
..and here we go:
56-
57-
.. code-block:: bash
58-
59-
python manage.py runserver
46+
That's it for the setup.
6047

6148

6249
Configuration
@@ -72,9 +59,35 @@ For a development configuration you will probably want to use the following
7259
echo postgres://mygpo:mygpo@localhost/mygpo > envs/local/DATABASE_URL
7360
echo True > envs/local/DEBUG
7461
62+
On an Debian/Ubuntu based system, you can perform this configuration with
63+
64+
.. code-block:: bash
65+
66+
make dev-config
67+
7568
See :ref:`configuration` for further information.
7669

7770

71+
Database Initialization
72+
-----------------------
73+
74+
Now to initialize the DB:
75+
76+
First run the commands from :ref:`db-setup`. Then
77+
78+
.. code-block:: bash
79+
80+
cd mygpo
81+
envdir envs/local python manage.py migrate
82+
83+
..and here we go:
84+
85+
.. code-block:: bash
86+
87+
envdir envs/local python manage.py runserver
88+
89+
90+
7891
Accessing the dev server from other devices
7992
-------------------------------------------
8093

@@ -84,7 +97,7 @@ runserver command of manage.py, like this:
8497

8598
.. code-block:: bash
8699
87-
python manage.py runserver 0.0.0.0:8000
100+
envdir envs/local python manage.py runserver 0.0.0.0:8000
88101
89102
Beware, though, that this will expose the web service to your all networks
90103
that your machine is connected to. Apply common sense and ideally use only
@@ -101,22 +114,22 @@ commands regularly on your development machine:
101114

102115
.. code-block:: bash
103116
104-
python manage.py update-categories
105-
python manage.py update-toplist
106-
python manage.py update-episode-toplist
117+
envdir envs/local python manage.py update-categories
118+
envdir envs/local python manage.py update-toplist
119+
envdir envs/local python manage.py update-episode-toplist
107120
108-
python manage.py feed-downloader
109-
python manage.py feed-downloader <feed-url> [...]
110-
python manage.py feed-downloader --max <max-updates>
111-
python manage.py feed-downloader --random --max <max-updates>
112-
python manage.py feed-downloader --toplist --max <max-updates>
113-
python manage.py feed-downloader --update-new --max <max-updates>
121+
envdir envs/local python manage.py feed-downloader
122+
envdir envs/local python manage.py feed-downloader <feed-url> [...]
123+
envdir envs/local python manage.py feed-downloader --max <max-updates>
124+
envdir envs/local python manage.py feed-downloader --random --max <max-updates>
125+
envdir envs/local python manage.py feed-downloader --toplist --max <max-updates>
126+
envdir envs/local python manage.py feed-downloader --update-new --max <max-updates>
114127
115128
or to only do a dry run (this won't do any web requests for feeds):
116129

117130
.. code-block:: bash
118131
119-
python manage.py feed-downloader --list-only [other parameters]
132+
envdir envs/local python manage.py feed-downloader --list-only [other parameters]
120133
121134
122135
Maintaining publisher relationships with user accounts
@@ -127,7 +140,7 @@ To set a user as publisher for a given feed URL, use:
127140
.. code-block:: bash
128141
129142
cd mygpo
130-
python manage.py make-publisher <username> <feed-url> [...]
143+
envdir envs/local python manage.py make-publisher <username> <feed-url> [...]
131144
132145
133146
Web-Server
@@ -138,7 +151,7 @@ directory with
138151

139152
.. code-block:: bash
140153
141-
python manage.py runserver
154+
envdir envs/local python manage.py runserver
142155
143156
If you want to run a production server, check out `Deploying Django
144157
<https://docs.djangoproject.com/en/dev/howto/deployment/>`_.

doc/dev/jupyter-notebook.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _jupyter-notebook:
2+
3+
Jupyter Notebook
4+
================
5+
6+
You can use `Jupyter Notebooks <http://jupyter.org/>`_ during development for
7+
exploring data and prototyping methods.
8+
9+
To do so, follow these steps
10+
11+
* Make sure you have all requirements from ``requirements-dev.txt`` installed.
12+
13+
* Run ``make notebook``, which will start the notebook and open it in the
14+
browser .
15+
16+
* Navigate to the directory ``notebooks`` (listed in `.gitignore`) and create
17+
a new notebook.
18+
19+
* Use the following code in the first cell to setup your environment
20+
21+
.. code-block:: python
22+
23+
MYPROJECT = '/path/to/mygpo'
24+
import os, sys
25+
sys.path.insert(0, MYPROJECT)
26+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "local_settings.py")
27+
import django
28+
django.setup()

0 commit comments

Comments
 (0)