So, I just started playing with Django, and I decided to try it on my server. So I installed Django and created a new project, following the basics outlined in the Djangoproject.com tutorial
Unfortunately, no matter what I do, I can't get the views to work: I constantly get
ImportError at /
No module named index
Here is a screenshot of this error
I searched Google and tried to execute different commands without any luck, and I'm literally going to rip my hair out until I become bald. I tried adding the django source directory, my project directory and application directory to PYTHONPATH with no luck. I also made sure init .py is in all directories (both in the project and in the application). Does anyone have an idea what might be wrong here?
UPDATES
Sorry, I was in a hurry posting this, here is some context:
The server I tried was only django built into the server using manage.py (python manage.py 0.0.0.0:8000, since I need to access it from the outside) on linux (debian)
AppDir / views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Sup")
def test(request):
return HttpRespons("heyo")
urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^test/', include('mecore.views.test')),
(r'^', include('mecore.views.index'))
)
source
share