Re: import error: no model named .....

2012-05-17 Thread Nick Legotte
Copy and paste the stacktrace
On May 17, 2012 11:58 AM, "Ali Shaikh"  wrote:

> Hey...
>
>
> I am practicing to implement simple examples in django...
>
> started project with
> 1.django-admin.py startproject wikicamp
> 2.python manage.py startapp wiki
> 3.editing the setting
> 4.python manage.py syncdb
> 5.python mange.py runserver
>
>  till this stage its working fine:)
>
>
> But after editing urls.py and views.py ...i run the server
> again that time its showing this error
>
> IMMPORTERROR at .//
>
> NO module named views...:'(
>
>
>
>
>
> help pls.!!!
>
> am getting
>
> ImoprtError at //
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to specify utf8 in models.py

2012-05-17 Thread Nick Legotte
This should answer your question:

class Person(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)

def __unicode__(self):
return u'%s %s' % (self.first_name, self.last_name)

 If you define a __unicode__() method on your model and not a
__str__()method,
Django will automatically provide you with a
__str__()that
calls
__unicode__() and then converts the result correctly to a UTF-8 encoded
string object. This is recommended development practice: define only
__unicode__() and let Django take care of the conversion to string objects
when required.


https://docs.djangoproject.com/en/dev/ref/unicode/#choosing-between-str-and-unicode


On Thu, May 17, 2012 at 11:23 AM, Elim Qiu  wrote:

> In the tutorial poll app, we have models.py like
>
> from django.db import models
>
> # Create your models here.
>
> class Poll(models.Model):
> question = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> class Choice(models.Model):
> poll = models.ForeignKey(Poll)
> choice = models.CharField(max_length=200)
> votes = models.IntegerField()
>
> But how to specify utf8 for columns like 'choice', 'question' here?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: import error: no model named .....

2012-05-17 Thread Nick Legotte
urls.py should look like this

from django.conf.urls.defaults import*
from wikicamp.views import hello

urlpattern = patterns(' ',
('^hello/$',hello),
)


On Thu, May 17, 2012 at 12:23 PM, Tanveer Ali Sha wrote:

> Hi  Apokalyptica Painkiller ,
>
> Here is my urls.py and views.py
>
>
> *URLS.PY*
>
> from django.conf.urls.defaults import*
> from wikicamp.views import hello
>
> urlpattern = patterns(' ',
> ('^hello/$,hello),
> )
>
> *VIEWS.py*
> *
> *
> *from django.http import HttpResponse*
> *
> *
> *def hello(request):*
> * return HttpResponse("hello world")*
>
>
> On Fri, May 18, 2012 at 12:44 AM, Tanveer Ali Sha wrote:
>
>> even am getting *page not found* error
>>
>> 1.^notes/
>> the current URL,didnt match any of these
>>
>>
>>
>> for that wikicamp example which is available in showmedo.com..
>>
>> I donno why I getting these error ...??:(
>>
>>
>> On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin wrote:
>>
>>> You should import models into views.py.
>>>
>>> For Example;
>>>
>>> from hdyazi.models import *
>>> from hdmakale.models import *
>>> from hdsayfalar.models import *
>>>
>>> My models' names are hdyazi,mdmakale,hdsayfalar ...
>>>
>>> --
>>> *www.halitalptekin.com | Halit Alptekin*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.