GithubHelp home page GithubHelp logo

mini-instagram's Introduction

Overview

  • A website that uses Django framework to implement basic Instagram functionalities
    • User registration/login/logout
    • Post CRUD operation
      • make/modify/delete a post
    • User timeline page
      • shows posts from users that current user is following
    • User profile page
      • shows a user's all posts
    • User interactions
      • follow/un-follow
      • likes
      • comments

Installation

Install required modules

pip install requirements.txt

Set up data models

python manage.py makemigrations python manage.py migrate

Create super user (optional)

python manage.py createsuperuser

Run the server

Quick way with built-in Django command

python manage.py runserver

Comprehensive way with web server (NGINX or Apache HTTP server) and WSGI server (uWSGI or gunicorn)

Why do we need NGINX and uWSGI?

  1. NGINX works as a reverse proxy to 1.serves static contents 2. directs dynamic request to WSGI server
  2. uWSGI sits between NGINX and our Django web application, connects to NGINX via sockets and talks to web application via wsgi.py
  • NGINX
    • install NGINX
    • modify mysite_nginx.conf
      • change /static route to the static folder under your project
    • test NGINX with mysite_nginx.conf - nginx -t -c mysite_nginx.conf
      • you might need to change http.include field to point to right mime file path if the system is not Mac
    • start NGINX server - nginx -c mysite_nginx.conf
      • stop NGINX serve - nginx -s quit
  • uWSGI
    • install uWSGI - pip install uwsgi
    • modify uWSGI config file uwsgi.ini (optional)
      • change pidfile and daemonize if needed
    • start WSGI server - uwsgi --ini uwsgi.ini
      • run uwsgi --stop PID_FILE to stop the server, PID_FILE is configured in uwsgi.ini

Access

Use 'http://127.0.0.1:8000/insta/posts/' to access the website and 'http://127.0.0.1:8000/admin' for admin management

mini-instagram's People

Contributors

xuegegege avatar

Watchers

 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.