Giter Site home page Giter Site logo

finallyeva / django-react-blog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lumenwrites/django-react-blog

0.0 2.0 0.0 12.45 MB

Simple blog built with Django and React/Redux, deployed with Docker, and served with nginx/uwsgi.

Home Page: http://digitalmind.io

License: MIT License

Python 14.77% Shell 0.10% CSS 21.50% JavaScript 63.36% HTML 0.27%

django-react-blog's Introduction

This is a very simple blog built with Django, Django REST Framework, React/Redux, and Bootstrap, deployed with Docker, and served with nginx-uwsgi. It can be useful as an example of integrating Django with React, as a starter project, or as a beautiful and simple blogging tool =)

I have built this project by following these two awesome React courses, I highly recommend them to anybody who wants to learn React! This Django REST Framework course really helped me to build the backend, and this course was incredibly helpful for learning Docker.

I have tried to extensively comment the code, so you could easily understand what's going on, and apply it to your own projects.

This is my first project built with all this tech, so if you have suggestions on how to improve it - I'd really appreciate them. I will keep gradually improving this blog and adding more features. Feel free to contribute to this project, report bugs, or fork it and use it for your purposes. I hope you will find it useful!

You can always contact me at [email protected], and you can check out the other stuff I'm working on over here.

Screenshot

Screenshot

Installation

Installing and running this blog is very simple. Clone this repo, and then simply run:

docker-compose up
(use -d flag to run it in the background)

After that, the blog will be running on the localhost. Isn't Docker amazing? =)

You will also need to attach to the container by running this:

docker exec -i -t backend  /bin/bash

run migrations:

python3.5 manage.py migrate

and create an admin user with:

python3.5 manage.py createsuperuser

Now you can go to localhost/login url, login and begin blogging!

Important: Before running it on the server, go to backend/config/env, and change "SECRET_KEY" and "POSTGRES_PASSWORD" to something unique.

To deploy it online, go to Digital Ocean, create a Docker droplet, and repeat the same commands. Then you will need to go to the networking tab, and create two A records pointing to the droplet:

yourawesomeblog.com
api.yourawesomeblog.com

Like so:

Screenshot

You can also go to:

api.yourawesomeblog.com/admin

to access the admin panel. You can add categories there, if you want to better organize your posts, and you can create a settings object where you can add an about page and fill in the meta info(site title, keywords, etc).

Todo

Upcoming features

  • Core settings. Meta info, analytics, about page.
  • Categories
  • Filter by tags.
  • Drafts
  • Email subscriptions.
  • Pagination.
  • Server side rendering.
  • Proper form validation.
  • RSS

Bugs

  • Sometimes post editor toolbar is yellow
  • After clicking on post, it doesn't always scroll to the beginning of the page, though it should.

Devops

  • Don't expose 8000/8080 ports. Access them only with the nginx container.
  • Separate docker-compose files for production and development.
  • Compile and serve frontend files from the /dist directory.
  • Properly use Docker Volume API. Like here
  • Learn to backup DB.
  • Maybe: Copy the code into container instead of using voulmes(if it has advantaeges).
  • Chain together RUN commands in the Dockerfile, for efficiency.

Future/Maybe

  • Auto Saving.
  • Code syntax highlighting? IPython? MathJax?
  • Create settings page where you can fill in meta info and create categories.
  • Figure out how to properly run multiple instances of the blog on one server.
  • Create page that allows you to just send emails, like on medium?
    //or just customize a notification email about new posts.
  • Themes?
  • Hosting?
  • Export/Import data?
  • Add nested comments?
  • Image upload?

Clean up

django-react-blog's People

Contributors

alephmelo avatar lumenwrites avatar

Watchers

 avatar  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.