Im Trying to deploy my app on Pythonanywhere
. when i'm importing the following Django
classes, it won't recognize them (it works great on my local server):
from django.conf.urls import include, url
from django.contrib import admin
from urls.py:
"""general URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
from adray import views
urlpatterns = [
url(r'^$', views.index, name='home'),
url(r'^happen/$', views.happen , name='happen'),
url(r'^simulate/$', views.simulate , name='simulate'),
url(r'^run/$', views.happen , name='run'),
url(r'^existing/$', views.existing , name='existing'),
# url(r'^inspired/$', views.inspired , name='inspired'),
]
error.log:
2015-07-13 04:28:26,107 :Traceback (most recent call last):
2015-07-13 04:28:26,107 : File "/usr/local/lib/python3.3/dist-packages/django/core/urlresolvers.py", line 358, in urlconf_module
2015-07-13 04:28:26,107 : return self._urlconf_module
2015-07-13 04:28:26,107 :AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'
2015-07-13 04:28:26,108 :
My question is: do i need to load anything configure some thing in order to make them work?
You're using the wrong version of Django. The code is commented as being for Django 1.8, but the exception comes from the built-in Django that is installed on PythonAnywhere for Python 3.3 and that's version 1.6.6.