Giter Club home page Giter Club logo

circle-app's Introduction

BLOGS REST API

To run the app, use the following steps

git clone https://github.com/harsha444/circle-app.git

cd circle-app/

docker-compose build

To run migrations

docker-compose run app python manage.py makemigrations
docker-compose run app python manage.py makemigrations users
docker-compose run app python manage.py makemigrations blog
docker-compose run app python manage.py migrate
docker-compose run app python manage.py migrate users
docker-compose run app python manage.py migrate blog

Note: If you get a django.db.migrations.exceptions.NodeNotFoundError: error while running migrations, please do the following and rerun the above commands Else proceed to Next step(generating fake data)

docker-compose run app rm -rf users/migrations
docker-compose run app rm -rf blog/migrations

Generating Fake data

docker-compose run app python populate_data.py

(You'll be asked a set of questions, fill that and it might take some time for it to get populated)

Run the server

sudo docker-compose run app

This will start server at 127.0.0.1 in your local machine.

Note: If the server doesn't start in your local machine, get the IP from the command sudo docker-compose run app sh -c ifconfig and add the inet addr given in app/blog_project/settings.py ALLOWED_HOSTS field and and run the server from above command.

Now the server will be live on either 127.0.0.1:8000 or the inet addr:8000 that we get from above.

APIs

The project currently has APIs for

  1. Creating a user, Updating a user, Deleting a user and applying a patch on user

Endpoint: http://127.0.0.1:8000/api/users/profile/<user_profile_id>

  1. Getting a list of users

Endpoint: http://127.0.0.1:8000/api/users/profile/>

  1. Creating a Blog, Updating a Blog, Deleting a Blog and applying a patch on Blog

Endpoint: http://172.21.0.3:8000/api/blogs/blog/<blog_id>

  1. Getting list of all blogs

Endpoint: http://172.21.0.3:8000/api/blogs/blog/

  1. Getting the blogs of first level friends of users of a blog

Endpoint: http://127.0.0.1:8000/api/blogs/common/<blog_id>/

circle-app's People

Contributors

harsha444 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.