You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once these files are created, go to the Terminal and execute the following commands to create your first Django project:
112
+
113
+
{% filename %}Terminal{% endfilename %}
114
+
```
115
+
django-admin.py startproject mysite .
116
+
refresh
117
+
```
118
+
119
+
In order to see detailed error messages, you can activate Django debug logs for your Glitch application.
120
+
Simply add the following at the end of the `mysite/settings.py` file.
121
+
122
+
{% filename %}mysite/settings.py{% endfilename %}
123
+
```python
124
+
LOGGING= {
125
+
'version': 1,
126
+
'disable_existing_loggers': False,
127
+
'handlers': {
128
+
'file': {
129
+
'level': 'DEBUG',
130
+
'class': 'logging.FileHandler',
131
+
'filename': 'debug.log',
132
+
},
133
+
},
134
+
'loggers': {
135
+
'django': {
136
+
'handlers': ['file'],
137
+
'level': 'DEBUG',
138
+
'propagate': True,
139
+
},
140
+
},
141
+
}
142
+
```
143
+
This will create a `debug.log` file detailing Django operations and any error messages that might come up, making it much easier to fix if your website does not work.
144
+
145
+
The initial restarting of the Glitch project should fail.
146
+
(If you click on the top dropdown button `Show` then click on `In a New Window`, you will receive a `DisallowedHost` error message.)
147
+
Do not worry about it at this stage, the tutorial will fix this as soon as you update the Django settings of your project in the `mysite/settings.py` file.
148
+
64
149
### Virtual Environment
65
150
66
151
A virtual environment (also called a virtualenv) is like a private box we can
0 commit comments