undernewmanagement / 3cosystem

Dockerized django web application that runs the website

Home Page:https://www.3cosystem.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Purpose

This is the source code for the 3cosystem.com project. It contains the code for the website and the firehose.

The Webapp

This is a standard django app,

Requirements

  • Python 3.6
  • Postgresql with postgis (We use some of the distance functions)
  • Docker is helpful but not required

Development

Standing up a local development environment is simple

  1. Create your database with create database "3cosystem" or another database tool
  2. Copy env.sample to env.
  3. Update the values in the env to match the credentials for your database, sentry, and email server
  4. setup your virtual environment. I use PyCharm, but you can use python -m venv venv
  5. install requirements with pip install -r requirements.txt
  6. migrate the database: ./manage.py migrate
  7. import some fixtures: ./manage.py loaddata data/geography
  8. create your superuser: ./manage.py createsuperuser
  9. create your cache table: ./manage.py createcachetable
  10. start the firehose task in a separate terminal: ./manage.py firehose
  11. start your web process: ./manage.py runserver 0.0.0.0:8000

You are now ready to start development.

Task runners

There is a Makefile task-runner to help you run database migrations and load fixtures.

Just type make in the root folder to see which commands are available

The architecture is simple

There are two parts; the Firehose and the web process.

The Firehose

This is a Django command that runs as a daemon. It connects to the Meetup.com API and consumes the feed of events fired from there. Any tech events are then parsed and inserted into the database

The web process

This is just a plain vanilla django web app. It connects to the same database as the firehose and displays the events to web users.

About

Dockerized django web application that runs the website

https://www.3cosystem.com


Languages

Language:Python 77.3%Language:HTML 17.4%Language:Makefile 3.9%Language:Dockerfile 1.4%