Skip to content

ijustwannathat/BlogiFy

Repository files navigation

This website was influenced by the book.

I'm very thankful for material this books provides

General material:

This website introduces us to a basic logic django blog application with user authorisation and drf included.

Part one. Setting db and dependencies


Setting up

$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt   

Managing db.

Note:

  • You need to create your own postgres database in order for it to work using
$ CREATE USER blog WITH PASSWORD '<password>'; #set a password
$ CREATE DATABASE blog OWNER blog ENCODING 'UTF8';

move bellow and fill the necessary fields with information regarding your database


Move on if you did the steps, otherwise try adding you own data!

  • First of all you need to create db
$ python manage.py makemigrations
$ python manage.py migrate
  • You need to either load your own data later via admin or load them from preinstalled in the project json file mysite_json.data
$ python -Xutf8 manage.py loaddata mysite_data.json

Quick note: Default password and login for admin panel from loaded data are

  • login: admin
  • password: admin

In case those don't work i suggest that you create your own superuser via terminal

$ python manage.py createsuperuser

Part two. Setting variables(Optional)


  • If you want to check how email recommendation works you need to create your own .env file
$ touch .env
  • Follow all steps here click and get 16-digit code
EMAIL_HOST = '' #your email from which you're going to send recommendations
EMAIL_PASSWORD = '' #your 16-digit code

All ready. Last step is to run application

$ python manage.py runserver

.env file structure

  • GitHub authorisation can be done by click
  • And following Google authorisation Click me!
EMAIL_HOST = ''
EMAIL_PASSWORD = ''
DB_PASSWORD = ''
GITHUB_CLIENT_ID=''
GITHUB_SECRET_KEY=''
GOOGLE_CLIENT_ID=''
GOOGLE_SECRET_KEY=''

If the website doesn't work you can write to kokfbc@gmail.com

Thank you!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published