Giter Club home page Giter Club logo

socialnetwork's Introduction

Check out full tutorial here : https://www.youtube.com/watch?v=UbF4srCAf0c&t=139s Do not forget to subscribe

Django 3 Social Network | Social media

  1. Create project motechapp - django-admin startproject motechapp
  2. Change directory (cd motechapp)and create app core - django-admin startapp core
  3. Add core in installed app section of settings.py
  4. Install crispy form and add in installed app of settings.py
  5. Set path of static files
  6. Set path of templates files
  7. Set database
  8. Make migrations
    • python manage.py makemigrations
    • python manage.py migrate
  9. Run Django server
    • python manage.py runserver

CREATING A FOLLOWER AND FOLLOWING VIA DJANGO SHELL.

  1. Launch Django shell - python manage.py shell
  2. Import model User - from django.contrib.auth.models import User
  3. Import model Follower - from core.models import Follower
  4. Import model Following - from core.models import Following

mosesi following noel

mosesi is a follower and noel is following disciple = 'mosesi' and leader = 'noel'

follower = Follower() leader = User.objects.get(username='noel') disciple = User.objects.get(username='mosesi')

following = Following() leader.follower_set.create(follower_user=disciple) disciple.following_set.create(following_user=leader)

CREATING A POST VIA TERMINAL import model Post - from core.models import Post a = Post(user_id=3, post_text='Hi MotechApp') a.save()

alt text

socialnetwork's People

Contributors

motechstore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

socialnetwork's Issues

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.