Commit 5d87cd28 authored by Agate's avatar Agate 💬
Browse files

Updated readme and dependencies

parent 507fa328
......@@ -284,3 +284,5 @@ retribute_api/media/
.pytest_cache/
data
venv
virtualenv
\ No newline at end of file
Retribute API
=============
Behold My Awesome Project!
.. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg
:target: https://github.com/pydanny/cookiecutter-django/
:alt: Built with Cookiecutter Django
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: Black code style
Install (dev)
-------------
.. code-block: shell
:License: GPLv3
pip3 install --user virtualenv
# create a Python3 virtualenv
python3 -m virtualenv venv/
Settings
--------
# install dependencies
venv/bin/pip3 install -e ".[dev]"
Moved to settings_.
# create and edit your env file
cp env.sample .env
.. _settings: http://cookiecutter-django.readthedocs.io/en/latest/settings.html
# launch redis
docker-compose up -d redis
Basic Commands
--------------
# launch the dev server
venv/bin/python retribute_api/manage.py runserver
Setting Up Your Users
^^^^^^^^^^^^^^^^^^^^^
* To create a **normal user account**, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
* To create an **superuser account**, use this command::
$ python manage.py createsuperuser
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
Type checks
^^^^^^^^^^^
Running type checks with mypy:
::
$ mypy retribute_api
Test coverage
^^^^^^^^^^^^^
To run the tests, check your test coverage, and generate an HTML coverage report::
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html
Running tests with py.test
~~~~~~~~~~~~~~~~~~~~~~~~~~
::
$ pytest
Live reloading and Sass CSS compilation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Moved to `Live reloading and SASS compilation`_.
.. _`Live reloading and SASS compilation`: http://cookiecutter-django.readthedocs.io/en/latest/live-reloading-and-sass-compilation.html
Deployment
----------
The following details how to deploy this application.
Querying the API
----------------
.. code-block: shell
# list available lookups (sources)
curl http://127.0.0.1:8000/v1/sources
# list available providers)
curl http://127.0.0.1:8000/v1/providers
# retrieve data for a specifing profile
curl http://127.0.0.1:8000/v1/search/webfinger:lila_bliblu@mastodon.opportunis.me
\ No newline at end of file
......@@ -40,11 +40,11 @@ USE_TZ = True
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
"default": env.db("DATABASE_URL", default="postgres://postgres@127.0.0.1/postgres")
}
DATABASES["default"]["ATOMIC_REQUESTS"] = True
DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # noqa F405
# DATABASES = {
# "default": env.db("DATABASE_URL", default="postgres://postgres@127.0.0.1/postgres")
# }
# DATABASES["default"]["ATOMIC_REQUESTS"] = True
# DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # noqa F405
# URLS
# ------------------------------------------------------------------------------
......@@ -291,4 +291,4 @@ ADMIN_URL = env("DJANGO_ADMIN_URL", default="admin/")
# ------------------------------------------------------------------------------
# http://whitenoise.evans.io/en/latest/django.html#enable-whitenoise
MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # noqa F405
BASE_URL = env("BASE_URL")
BASE_URL = env("BASE_URL", default="/")
version: '3'
services:
postgres:
env_file:
- .env
restart: ${RESTART_POLICY-on-failure}
image: postgres:${POSTGRES_VERSION-11.3}
command: postgres -c log_min_duration_statement=0
volumes:
- "./data/postgres:/var/lib/postgresql/data"
ports:
- "127.0.0.1:5432:5432"
redis:
restart: ${RESTART_POLICY-on-failure}
env_file:
......
DJANGO_DEBUG=False
# replace this by a random string
DJANGO_SECRET_KEY=9feaeacdc90ca3018206e4b7
DJANGO_ALLOWED_HOSTS=", default=["retribute.me"])
CACHE_URL=redis://localhost:6379/0
......@@ -19,25 +19,26 @@ zip_safe = True
include_package_data = True
packages = find:
install_requires =
pytz
aiohttp
aioredis
argon2-cffi
whitenoise
redis
channels
daphne
gunicorn
uvicorn
channels_redis
django
django-environ
django-redis
djangorestframework
markdown
psycopg2-binary
lxml
aiohttp==3.5.4
aioredis==1.2.0
argon2-cffi==19.1.0
channels-redis==2.4.0
channels==2.2.0
daphne==2.3.0
django-environ==0.4.5
django-redis==4.10.0
Django==2.2.2
djangorestframework==3.9.4
gunicorn==20.0.4
lxml==4.6.3
Markdown==3.1.1
psycopg2-binary==2.8.6
pytz==2020.4
redis==3.2.1
uvicorn[standard]==0.13.4
uvicorn==0.13.4
whitenoise==5.2.0
wsproto==0.15.0
[options.entry_points]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment