Skip to content

Instantly share code, notes, and snippets.

@4k45hv3rm4
Last active September 8, 2020 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4k45hv3rm4/98eed69e17e1aa5a7493c6d87a9d5701 to your computer and use it in GitHub Desktop.
Save 4k45hv3rm4/98eed69e17e1aa5a7493c6d87a9d5701 to your computer and use it in GitHub Desktop.
install pipenv
Install git ( check git --version)
Create an Heroku account
Install Heroku CLI
Login heroku
Copy the project in a seperate folder
Create a virtual enviroment
Run manage.py runserver not gonna run due to unmigrated files
check pip freeze if nothing installed
Check which version django,requests or other libraries you have or need to install it.
Run manage.py runserver and then stop it
Go to (django-heroku-configuration )[https://devcenter.heroku.com/articles/django-app-configuration]
Install guincorn
Create a Procfile in root level of your project and place the code
```python
web: gunicorn myprojectName.wsgi
```
Install django-heroku
Add stuff to settings.py file
```python
settings.py
#Add the following import statement to the top of settings.py:
import django_heroku
#Then add the following to the bottom of settings.py:
# Activate Django-Heroku.
django_heroku.settings(locals())
#now run to update requirments.txt file
pip freeze > requirements.txt
```
#Deploy using following commands
```python
heroku create appname (to create an app on heroku)
git status git commands (git push heroku master)
```
Open up the website
```python
#Admin panel not working.
heroku run bash.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment