Skip to content

mini blog web application using Python/Django and Channels (web socket)

Notifications You must be signed in to change notification settings

petersobhi/MyBlog2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyBlog2

A new version of MyBlog without commenting and liking systems but using Django with web sockets.

it can run online through AWS or locally.

Requirements to run locally:

Installation

  • clone or download the repo:

    $ git clone https://github.com/petersobhi/MyBlog2.git
  • create a virtual environment with python3 and activate it

    $ virtualenv {location} --python=python3
    $ source {location}/bin/activate
  • upgrade pip and install requirements while virtual environment is activated:

    $ pip install --upgrade pip
    $ pip install -r {repo}/requirements.txt
  • configure the database:

    • install MySQL

      $ sudo apt-get update
      $ sudo apt-get install mysql-server
      $ mysql_secure_installation
    • create a database in MySQL

    • edit DATABASES dict in settings.py with the MySQL username, password and database name

    • make the migrations:

      $ python manage.py makemigrations
      $ python manage.py migrate
  • now you have to run two processes concurrently

    $ python manage.py runworker

    and:

    $ daphne -b {{ip_address}} -p {{port_number}} {{project_namee}}.asgi:channel_layer
    

    you can use Supervisor to do so. note that you can configure Supervisor to run the runworker task mare than once which is recommended.

About

mini blog web application using Python/Django and Channels (web socket)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published