|
Posted by Acropolis |
|
|
Hi Folks,
Just yesterday i started to learn web programming in Python and found django very exciting to learn. But one thing which i hate is, the command that we have to run to create app or validate using the manage.py etc. There is one thing or the other at every step! Coming to my problem, right now i'm reading the 5th capter of the book which explains about the Models. I'm just following the book and I get an error (Error: No module named books) when i validate using "python manage.py validate". Here are my settings or steps which i did, INSTALLED_APPS = ( #'django.contrib.auth', #'django.contrib.contenttypes', #'django.contrib.sessions', #'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: # 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'mysite.books', ) MIDDLEWARE_CLASSES = ( #'django.middleware.common.CommonMiddleware', #'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', #'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) I also tried to comment all the installed apps and middleware classes but nothing worked. from django.db import models # Create your models here. class Publisher(models.Model): name = models.CharField(max_length=30) address = models.CharField(max_length=50) city = models.CharField(max_length=60) state_province = models.CharField(max_length=30) country = models.CharField(max_length=50) website = models.URLField() class Author(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=40) email = models.EmailField() class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher) publication_date = models.DateField() Could anyone please throw light on this? |
|
|
Posted by mihaibarbu |
|
|
And I'm in the same situation.
python manage.py validated Error: No module named books It would be nice to get an answer |
|
|
Posted by SeymenSipahi |
|
|
you should change 'mysite.books', into 'books' after that your problem will end
|
|
|
Posted by zeinab |
|
|
I have some problems with models too. Actually I did post it in another ctegory, but I think I should mention it here too. this is the question:
------------------------------------------------------------------------------------------------------------------- I'm working on a web project using Django framework and python language, actually I'm learning to use it for web programming. But I have two problems with Django framework: First: I'v installed PyCharm and Django framework. When I run my project, "ruserver" process proceeds successfully but instantly an error comes out and stops server. This is the exact phrase: "Error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions". I have unabled my firewall and my antivirus, but no change happened. I should mention that I'v tested this project in another computer and it absolutely worked well. Second: I can't access to databases. I primarily know that I should mention type and other stuff about my database in the file "settings.py" but it didn't work. I don't know why. I'v not worked with databases very much before and I'm kinda new. Can anyone help me with details about it, please? ------------------------------------------------------------------------------------------------------------------- |


