I've been following the django tutorial over at https://docs.djangoproject.com/en/dev/intro/tutorial03/ but I've hit a brick wall.
yes I have searched google and looked up the 15 or so exact questions and nothing is working.
My directory structure is:
djangotest/
urls.py
settings.py
My settings has this
ROOT_URLCONF = 'urls.py'
The generator generated urls.py, not djangotest.urls as detailed in the tutorial. However, I don't think the naming matters too much. I've tried every variation of this urls file and I am having errors spat at me every time. The main one being the above.
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'^reviews/$', 'djangotest.review.urls')
)
I'd love some help with this like how I can debug?
Are you being careful about the projectname and appname? Are you following the right tutorial for the version of django you downloaded? I'd also recommend using the latest stable release http://www.djangoproject.com/download/1.3.1/tarball/ rather than the latest dev release.
I'd recommend starting over; because without posting all your files (or steps you did), we aren't going to be able to debug where you went wrong.
Also, it seems like just running:
django-admin.py startproject my_test_project
cd my_test_project
django-admin.py startapp my_test_app
that you should have a directory structure like:
my_test_project/
|-- __init__.py
|-- manage.py
|-- my_test_app
| |-- __init__.py
| |-- models.py
| |-- tests.py
| `-- views.py
|-- settings.py
`-- urls.py
settings.py should have ROOT_URLCONF = 'my_test_project.urls', which reads the data in urls.py with no errors if you try
./manage runserver
and point your web browser to http://127.0.0.1:8000
On your update, it seems your specific mistake seems to be that your urls.py references 'djangotest.review.urls' Is there an app (in the installed apps) named review in the project djangotest with a urls.py? Are all the permissions correct?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With