Re: activating models

2020-03-09 Thread SHANKAR JHA
I think you forget to put a comma (,) at the last.

Try using the polls and check if it's working or not.

It's best practice to put your app at the last because you want all the
package to load in first when you open your website.
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
 'polls.apps.PollsConfig',
]



On Tue, Mar 10, 2020 at 11:06 AM Omar Abou Mrad 
wrote:

> We need to see your directory structure.
>
> meanwhile see if 'polls' works instead 'polls.apps.PollsAppConfig'
>
> On Mon, Mar 9, 2020, 11:14 PM Atıl Ardıç  wrote:
>
>>
>> I added polls app in below place;But i am getting errors while i was
>> running makemigrations
>>
>> INSTALLED_APPS = [
>> 'polls.apps.PollsConfig'
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> ]
>>
>>
>> C:\Users\ibrahim\Documents\Python Scripts\mart2020\mysite>py manage.py
>> makemigrations polls
>> Traceback (most recent call last):
>>   File "manage.py", line 21, in 
>> main()
>>   File "manage.py", line 17, in main
>> execute_from_command_line(sys.argv)
>>   File
>> "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py",
>> line 401, in execute_from_command_line
>> utility.execute()
>>   File
>> "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py",
>> line 377, in execute
>> django.setup()
>>   File
>> "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\__init__.py",
>> line 24, in setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File
>> "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\registry.py",
>> line 91, in populate
>> app_config = AppConfig.create(entry)
>>   File
>> "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\config.py",
>> line 116, in create
>> mod = import_module(mod_path)
>>   File
>> "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\importlib\__init__.py",
>> line 127, in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 1014, in _gcd_import
>>   File "", line 991, in _find_and_load
>>   File "", line 961, in
>> _find_and_load_unlocked
>>   File "", line 219, in
>> _call_with_frames_removed
>>   File "", line 1014, in _gcd_import
>>   File "", line 991, in _find_and_load
>>   File "", line 970, in
>> _find_and_load_unlocked
>> ModuleNotFoundError: No module named 'polls.apps.PollsConfigdjango';
>> 'polls.apps' is not a package
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d5c976f6-a6df-4f1e-bd77-0417d62049b2%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFwtXp0x8Vh7TMeyGtr2GxtqyEgEuntNWzcMn8uFngjKbitTjg%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOmnpAxvZLP7Or81j-tBEAR-GUUv9WhuCnZYC-XQsqB9MeJ2gA%40mail.gmail.com.


Re: Beginner needs help getting templates to work - is this the right group?

2020-03-06 Thread SHANKAR JHA
Why don't you compare your code with the Github repo provided by the
author: https://github.com/wsvincent/djangoforbeginners.

You can share your code with us for more clarity.

On Fri, Mar 6, 2020 at 9:31 AM Shishir Jha  wrote:

> Can you show the code that you have written until page 55?
>
>
> On Fri, 6 Mar 2020, 9:01 am Philip Means,  wrote:
>
>> Thank you for your response.  The book is Django for Beginners, by
>> William S. Vincent.  I will copy and send you the chapter I am having
>> trouble with.  My directory structure, as created by Django, doesn't seem
>> to be the same as his, so I will send you that as well.  The problem I am
>> having
>> is that after the changes to the files have been made, and I "runserver"
>> (on page 55) I get a huge error dialog that seems to say that django can't
>> find the app. I have deleted the project several times and re-entered it,
>> so I think it is unlikely that it is a typing error.
>>
>>
>> On Thu, Mar 5, 2020 at 8:27 PM Jorge Gimeno  wrote:
>>
>>>
>>> On Thu, Mar 5, 2020 at 6:04 PM Philip Means  wrote:
>>>
 I am new to web development.  Wanted to help my daughter with a simple
 website (she does pet portraits) and learn something that interests me.  I
 watched some you tube tutorials, then bought a book.  First couple simple
 projects went OK.  Then I got to templates and I have not been able to get
 the example project to work.  Been banging my head against the wall for
 about a week.  Part of the problem is my directory structure does not look
 like the authors and so I am not sure I am putting things in the right
 place. When I go searching for another explanation of how to set it up, I
 find that nobody seems to do it the same way.  Also, I find the jargon
 confusing.  At this point I just want to display a simple html page.  If
 this is in the wrong place, maybe someone can direct me to a better one.

 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/fe83a557-759d-460d-96ec-2c7fd18117bb%40googlegroups.com
 
 .

>>>
>>> Django is a framework that supports a lot of features, and that means
>>> there's a lot of moving parts.  However, similar to driving a car, you need
>>> to know a few things to get things working, rather than knowing the
>>> niceties of how everything works.
>>>
>>> To address your point about project structure, there's a lot of opinions
>>> on this (most of them are subjective). I have a structure I use and I'm
>>> comfortable with, but Django will support some variety in this.
>>>
>>> Without seeing what code you have and what happens that is not expected,
>>> we don't know where we can help.  So, to help us understand, we need to
>>> know a few things.
>>>
>>> 1.  What steps did you take to get here?
>>>
>>> 2..  What goes wrong?  If there's a traceback, copying and pasting it is
>>> invaluable.
>>>
>>> 3.  We may ask to see code.  Again, copying and pasting that will help
>>> us understand what is going on.
>>>
>>> You said that your project isn't working once you get to templates.  Is
>>> there a book or tutorial you are following?  That might help us know where
>>> to start.
>>>
>>> In addition to this list, there is a forum at forum.djangoproject.com
>>> (I follow posts in there as well).  That might be another resource for you,
>>> as sometimes the question you have has already been answered.
>>>
>>> -Jorge
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CANfN%3DK9POCHxkn8-OoU2Yoy3rj%3D%3D9%3DPVOZo0E07fOrPbqcV87w%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAM%3DzXYddr_TyXy43rhgtAAfJNJS%3D7D-EE6KngCcyYuhGQ9wXcw%40mail.gmail.com
>>