Skip to content

Commit

Permalink
Upgrade files to django 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobichaud committed Jan 10, 2018
1 parent ad0ec30 commit 7cba054
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DJANGO_SETTINGS_MODULE=django_awesome_presentations.settings
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.sqlite3
__pycache__/

# idea IDE
.idea/*
Expand Down
1 change: 0 additions & 1 deletion django_awesome_presentations/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
Expand Down
13 changes: 9 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_awesome_presentations.settings")

from django.core.management import execute_from_command_line

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
2 changes: 1 addition & 1 deletion my_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __str__(self):


class Entry(models.Model):
blog = models.ForeignKey(Blog)
blog = models.ForeignKey(Blog, on_delete=models.CASCADE)
headline = models.CharField(max_length=255)
body_text = models.TextField()
pub_date = models.DateField()
Expand Down

0 comments on commit 7cba054

Please sign in to comment.