Giter Site home page Giter Site logo

blog_django's Introduction

Django Simple Blog Demo

About

This is a demo project for simple blogging using Django.

It was made using Python 3.6 + Django and database is SQLite. Bootstrap was used for styling.

There is a login and registration functionality included.

User has his own blog page, where he can add new blog posts.

Non-authenticated users can see all blog posts, but cannot add new posts or comment.

App is covered with tests.

Prerequisites

[Optional] Install virtual environment:

$ python -m virtualenv env

[Optional] Activate virtual environment:

On macOS and Linux:

$ source env/bin/activate

Install dependencies:

$ pip install -r requirements.txt

How to run

Default

You can run the application from the command line with manage.py. Go to the root folder of the application.

Run migrations:

$ python manage.py migrate

Initialize data:

$ python manage.py loaddata users posts comments

Run server on port 8000:

$ python manage.py runserver 8000

Helper script

It is possible to run all of the above with helper script:

$ chmod +x scripts/run.sh
$ scripts/run.sh

Post Installation

Go to the web browser and visit http://localhost:8000/home

Admin username: admin

Admin password: adminpassword

User username: abcd

User password: abcdpassword

Helper Tools

Django Admin

It is possible to add additional admin user who can login to the admin site. Run the following command:

$ python manage.py createsuperuser

Enter your desired username and press enter.

Username: admin_username

You will then be prompted for your desired email address:

Email address: [email protected]

The final step is to enter your password. You will be asked to enter your password twice, the second time as a confirmation of the first.

Password: **********
Password (again): *********
Superuser created successfully.

Go to the web browser and visit http://localhost:8000/admin

Tests

Default

Activate virtual environment:

On macOS and Linux:

$ source env/bin/activate

On Windows:

$ .\env\Scripts\activate

Running tests:

$ python manage.py test blog

					

blog_django's People

Contributors

sauravkdubey avatar

Watchers

James Cloos 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.