Code Monkey home page Code Monkey logo

task_repo's Introduction

equirements

You need python set up tools installed globally.

$ sudo apt-get install python-setuptools
$ pip install virtualenv

After that run these commands

$ git clone https://github.com/mukulpriya/Task_Repo.git
$ cd Task_Repo
$ virtualenv myenv
$ source myenv/bin/activate
$ pip install django==1.9
$ cd my_task
$ python manage.py makemigrations blog
$ python manage.py migrate 
$ python manage.py runserver

Your server is now up and running locally @

URL: localhost:8000 

You will find nothing on the page beacuse the database is empty. To add a blog post type

URL: localhost:8000/post_a_blog 

Views along with their payloads

def index(request):
GET request
This view responds to a get request at url ('/')
This function returns the paginated home page with 5 entries per page 
def article_detail(request,**kwargs):
GET request
This page returns with all the paragraps of a blog entry
url=('/article') payload= {'id' : some number}  id here is primary key for the blog post 
can be tested directly using get('/article/4') (just for example)
def show_comments(request,**kwargs):
GET request
This page returns all the comments on a paragraph of a blog entry.
url=('/article/show_comments/') payload={'id'= : primary key}  This id here is primary key of the paragrah .
def post_a_blog(request):
POST request
url=('/post_a_blog') payload={'title' : text, 'body' : text} 
Makes a new blog entry 
The function parses the body of the entry for paragraps and store them in the models defined.
redirects to the home page
def post_a_comment(request,**kwargs)
POST request
URL=('/article/post_a_comment') payload ={'id': primary_key_for_paragraph}
Make a new comment entry .
Redirects to the paragraph on which comment was made

task_repo's People

Contributors

mukulpriya avatar

Watchers

Mukul Priya 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.