Skip to content

Commit 8b39f2e

Browse files
committed
Steps for the Django Heroku Hosting tutorial
1 parent 7010df1 commit 8b39f2e

File tree

46 files changed

+2329
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2329
-0
lines changed
Lines changed: 320 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,320 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/python,pycharm+all,django
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,pycharm+all,django
4+
5+
### Django ###
6+
*.log
7+
*.pot
8+
*.pyc
9+
__pycache__/
10+
local_settings.py
11+
db.sqlite3
12+
db.sqlite3-journal
13+
media
14+
15+
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
16+
# in your Git repository. Update and uncomment the following line accordingly.
17+
# <django-project-name>/staticfiles/
18+
19+
### Django.Python Stack ###
20+
# Byte-compiled / optimized / DLL files
21+
*.py[cod]
22+
*$py.class
23+
24+
# C extensions
25+
*.so
26+
27+
# Distribution / packaging
28+
.Python
29+
build/
30+
develop-eggs/
31+
dist/
32+
downloads/
33+
eggs/
34+
.eggs/
35+
parts/
36+
sdist/
37+
var/
38+
wheels/
39+
pip-wheel-metadata/
40+
share/python-wheels/
41+
*.egg-info/
42+
.installed.cfg
43+
*.egg
44+
MANIFEST
45+
46+
# PyInstaller
47+
# Usually these files are written by a python script from a template
48+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
49+
*.manifest
50+
*.spec
51+
52+
# Installer logs
53+
pip-log.txt
54+
pip-delete-this-directory.txt
55+
56+
# Unit test / coverage reports
57+
htmlcov/
58+
.tox/
59+
.nox/
60+
.coverage
61+
.coverage.*
62+
.cache
63+
nosetests.xml
64+
coverage.xml
65+
*.cover
66+
*.py,cover
67+
.hypothesis/
68+
.pytest_cache/
69+
pytestdebug.log
70+
71+
# Translations
72+
*.mo
73+
74+
# Django stuff:
75+
76+
# Flask stuff:
77+
instance/
78+
.webassets-cache
79+
80+
# Scrapy stuff:
81+
.scrapy
82+
83+
# Sphinx documentation
84+
docs/_build/
85+
doc/_build/
86+
87+
# PyBuilder
88+
target/
89+
90+
# Jupyter Notebook
91+
.ipynb_checkpoints
92+
93+
# IPython
94+
profile_default/
95+
ipython_config.py
96+
97+
# pyenv
98+
.python-version
99+
100+
# pipenv
101+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
102+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
103+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
104+
# install all needed dependencies.
105+
#Pipfile.lock
106+
107+
# poetry
108+
#poetry.lock
109+
110+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
111+
__pypackages__/
112+
113+
# Celery stuff
114+
celerybeat-schedule
115+
celerybeat.pid
116+
117+
# SageMath parsed files
118+
*.sage.py
119+
120+
# Environments
121+
# .env
122+
.env/
123+
.venv/
124+
env/
125+
venv/
126+
ENV/
127+
env.bak/
128+
venv.bak/
129+
pythonenv*
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# operating system-related files
153+
# file properties cache/storage on macOS
154+
*.DS_Store
155+
# thumbnail cache on Windows
156+
Thumbs.db
157+
158+
# profiling data
159+
.prof
160+
161+
162+
### PyCharm+all ###
163+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
164+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
165+
166+
# User-specific stuff
167+
.idea/**/workspace.xml
168+
.idea/**/tasks.xml
169+
.idea/**/usage.statistics.xml
170+
.idea/**/dictionaries
171+
.idea/**/shelf
172+
173+
# Generated files
174+
.idea/**/contentModel.xml
175+
176+
# Sensitive or high-churn files
177+
.idea/**/dataSources/
178+
.idea/**/dataSources.ids
179+
.idea/**/dataSources.local.xml
180+
.idea/**/sqlDataSources.xml
181+
.idea/**/dynamic.xml
182+
.idea/**/uiDesigner.xml
183+
.idea/**/dbnavigator.xml
184+
185+
# Gradle
186+
.idea/**/gradle.xml
187+
.idea/**/libraries
188+
189+
# Gradle and Maven with auto-import
190+
# When using Gradle or Maven with auto-import, you should exclude module files,
191+
# since they will be recreated, and may cause churn. Uncomment if using
192+
# auto-import.
193+
# .idea/artifacts
194+
# .idea/compiler.xml
195+
# .idea/jarRepositories.xml
196+
# .idea/modules.xml
197+
# .idea/*.iml
198+
# .idea/modules
199+
# *.iml
200+
# *.ipr
201+
202+
# CMake
203+
cmake-build-*/
204+
205+
# Mongo Explorer plugin
206+
.idea/**/mongoSettings.xml
207+
208+
# File-based project format
209+
*.iws
210+
211+
# IntelliJ
212+
out/
213+
214+
# mpeltonen/sbt-idea plugin
215+
.idea_modules/
216+
217+
# JIRA plugin
218+
atlassian-ide-plugin.xml
219+
220+
# Cursive Clojure plugin
221+
.idea/replstate.xml
222+
223+
# Crashlytics plugin (for Android Studio and IntelliJ)
224+
com_crashlytics_export_strings.xml
225+
crashlytics.properties
226+
crashlytics-build.properties
227+
fabric.properties
228+
229+
# Editor-based Rest Client
230+
.idea/httpRequests
231+
232+
# Android studio 3.1+ serialized cache file
233+
.idea/caches/build_file_checksums.ser
234+
235+
### PyCharm+all Patch ###
236+
# Ignores the whole .idea folder and all .iml files
237+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
238+
239+
.idea/
240+
241+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
242+
243+
*.iml
244+
modules.xml
245+
.idea/misc.xml
246+
*.ipr
247+
248+
# Sonarlint plugin
249+
.idea/sonarlint
250+
251+
### Python ###
252+
# Byte-compiled / optimized / DLL files
253+
254+
# C extensions
255+
256+
# Distribution / packaging
257+
258+
# PyInstaller
259+
# Usually these files are written by a python script from a template
260+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
261+
262+
# Installer logs
263+
264+
# Unit test / coverage reports
265+
266+
# Translations
267+
268+
# Django stuff:
269+
270+
# Flask stuff:
271+
272+
# Scrapy stuff:
273+
274+
# Sphinx documentation
275+
276+
# PyBuilder
277+
278+
# Jupyter Notebook
279+
280+
# IPython
281+
282+
# pyenv
283+
284+
# pipenv
285+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
286+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
287+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
288+
# install all needed dependencies.
289+
290+
# poetry
291+
292+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
293+
294+
# Celery stuff
295+
296+
# SageMath parsed files
297+
298+
# Environments
299+
# .env
300+
301+
# Spyder project settings
302+
303+
# Rope project settings
304+
305+
# mkdocs documentation
306+
307+
# mypy
308+
309+
# Pyre type checker
310+
311+
# pytype static type analyzer
312+
313+
# operating system-related files
314+
# file properties cache/storage on macOS
315+
# thumbnail cache on Windows
316+
317+
# profiling data
318+
319+
320+
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm+all,django
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: python manage.py runserver 0.0.0.0:$PORT
2+
release: python manage.py migrate
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

django-hosting-heroku/source_code_final/portfolio-project/portfolio/__init__.py

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for portfolio project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio.settings')
15+
16+
application = get_asgi_application()

0 commit comments

Comments
 (0)