This project is implementation for the following topics related to technologies used with Django
-Implemented Complete Auth Using Custom Auth Model.
-Deployed on Hostinger VPS
Available at: https://github.com/arpansahu/geek_glasses
admin login details:-- email: admin@arpansahu.me password: showmecode
Installing Pre requisites
pip install -r requirements.txt
Making Migrations and Migrating them.
python manage.py makemigrations
python manage.py migrate
Creating Super User.
python manage.py createsuperuser
Run Server.
python manage.py runserver
Installing Heroku Cli
checkout: https://devcenter.heroku.com/articles/heroku-cli
Create your account in Heroku.
Inside your project directory
Login Heroku CLI
heroku login
Create Heroku App
heroku create [app_name]
Push Heroku App
git push heroku master
Configure Heroku App Env Variables
heroku config:set GITHUB_USERNAME=joesmith
Install whitenoise
pip install whitenoise
Include it in Middlewares.
MIDDLEWARE = [
# ...
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
# ...
]
Create Procfile and include this code snippet in it.
release: ./release-tasks.sh
web: gunicorn djangoProject.wsgi
Create release-task.sh for running multilple commands in run: section of procfile.
python manage.py makemigrations
python manage.py migrate
Make release-task.sh executable
chmod +x release-tasks.sh
To run this project, you will need to add the following environment variables to your .env file
SECRET_KEY=
DEBUG=
DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=
EMAIL_USER=
EMAIL_PASS=
ALLOWED_HOSTS=