Re: Name error ,not defined problem

2015-07-19 Thread Scot Hacker
Your URL definition is calling a module that hasn't been imported. At the 
top of your urls.py, add:

from newsletter import views


In the URL definition, do:

url(r'^$', views.home, name='home'),


./s

>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/87e47cfe-7495-467c-ac9a-07f1be84007a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Name error ,not defined problem

2015-07-19 Thread Diego Matar
Didi you add* 'newsletter' *to your INSTALLED_APPS in settings.py?




Em domingo, 19 de julho de 2015 07:16:52 UTC-3, Tara gurung escreveu:
>
>
> 
>
> This is my application structure with newsletter application inside *SRC* 
> project.
>
> *Hellow am newbie to django framework and need some help to fix it*
>
> *urls.py* has this added
>  urlpatterns = [
>
>   url(r'^$', newsletter.views.home, name='home'),
>  url(r'^admin/', include(admin.site.urls)),
> ]
>
>
>
> *settings.py*
>
> *In the application i have listed the newsletter application*
>
> *# Application definition*
>
>
> INSTALLED_APPS = (
>
>
> 'django.contrib.admin',
>
> 'django.contrib.auth',
>
> 'django.contrib.contenttypes',
>
> 'django.contrib.sessions',
>
> 'django.contrib.messages',
>
> 'django.contrib.staticfiles',
>
> 'newsletter',
>
> )
>
>
>
> *Now in the apps part*
>
> *Added the view page in views.py*
>
>
> *from django.shortcuts import render*
>
> # Create your views here.
>
> def home(request):
>
>  return render(request,"home.html",{})
>
> *In the newsletter application create a folder templates and added the 
> home.html.*
>
>
> *Running the server I get his error below. What might be the cause*
>
>
> 
>
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84873d7c-8fb2-4a12-90a0-8b2bdd322671%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Name error ,not defined problem

2015-07-19 Thread Tara gurung




This is my application structure with newsletter application inside *SRC* 
project.

*Hellow am newbie to django framework and need some help to fix it*

*urls.py* has this added
 urlpatterns = [

  url(r'^$', newsletter.views.home, name='home'),
 url(r'^admin/', include(admin.site.urls)),
]



*settings.py*

*In the application i have listed the newsletter application*

*# Application definition*


INSTALLED_APPS = (


'django.contrib.admin',

'django.contrib.auth',

'django.contrib.contenttypes',

'django.contrib.sessions',

'django.contrib.messages',

'django.contrib.staticfiles',

'newsletter',

)



*Now in the apps part*

*Added the view page in views.py*


*from django.shortcuts import render*

# Create your views here.

def home(request):

 return render(request,"home.html",{})

*In the newsletter application create a folder templates and added the 
home.html.*


*Running the server I get his error below. What might be the cause*









-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/33de4bed-b8bb-46ec-bd7e-6308b2d3c9c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.