Skip to content

timabilov/django-social-sample

Repository files navigation

timabilov / django-social-sample Build Status

Required docker and docker-compose

docker-compose-prod.yml is not production ready. used for uwsgi bot setup ONLY.

./startup.sh

Add your CLEARBIT_KEY to configuration env.secret if you want.

Open http://localhost/

For spamming/testing API in bot/ directory:

python social_bot.py -u 100 -p 20 -l 20
python social_bot.py --config config.json

API

POST /v1.0/signup/

{
  "username": "username" ,
  "password": "validatedpass"
}

POST /v1.0/token/

Use your credentials. JWT used.

{
  "username": "username" ,
  "password": "validatedpass"
}

POST /v1.0/posts/

Create post.

{
  "content": "Summertime sadness?"
}

GET /v1.0/posts/

Posts list

{
  "posts": [
        {
            "id": 1,
            "user": {
                "id": 4,
                "username": "willsmith",
                "img": null
            },
            "content": "Summertime sadness?",
            "date": "just now",
            "likes": 0,
            "liked": false
        }
  ],
  "count": 1
}

POST       /v1.0/posts/{id}/like/

DELETE   /v1.0/posts/{id}/like/

About

Social platform example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published