Skip to content

kartikk868/Django-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blogger

Django App to create blogs

Blogger is a cloud-enabled, Django-powered application for writing blog posts.

URL

https://quiet-crag-39123.herokuapp.com/

Features

  • Users can create,update and delete their blog posts
  • Users can change their profile image

Tech

Blogger uses a number of open source projects to work properly:

  • Django - Python web framework
  • Heroku - lets you deploy, run and manage applications.
  • AWS S3 - Object storage built to store and retrieve any amount of data from anywhere.

Installation

Dillinger requires Django to run.

  1. Install the dependencies.
pip3 install -r requirements.txt
  1. Make database migrations
python manage.py migrate
  1. Start the server
python manage.py runserver 
  1. Go to localhost:8000

Create .env

  1. To load the media files , you have to create an aws s3 bucket
  2. Create a .env file in the root dir of the project
touch .env
  1. Go to aws s3 > create a new s3 bucket , get
    1. Get the access key
    2. secret access key
    3. bucket name
  2. Generate a secret key with python secrets module
    1. Open python shell
    2. Type
    import secrets 
    print(secrets.token_hex(48))
    1. Copy the token
  3. Go to .env file. Paste the following values without quotes
SECRET_KEY=<copied from python>
DEBUG_VALUE=True
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=

Django Admin

One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site.

To go to django admin
  1. Create a superuser
python manage.py createsuperuser 

specify the username and password 2. Go to http://localhost:8000/admin 3. Login with the credentials 4. Here you will see all the django models and data inside each

draw.io: https://drive.google.com/file/d/1d9_tA4-hD69lz7S-AuzIac2TnycBCl5E/view?usp=sharing

Docker

Blogger is very easy to install and deploy in a Docker container.

By default, the Docker will expose port 8000, so change this within the Dockerfile if necessary. When ready, simply use the Dockerfile to build the image.

docker build -t django-app .

This will create the dillinger image and pull in the necessary dependencies in requirements.txt. Once done, run the Docker image

docker compose up -d

Verify the deployment by navigating to your server address in your preferred browser. localhost:8000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors