IDE to the Django?

Asked

Viewed 519 times

1

Good evening guys, I’m having big problems with some ides, and I need your advice. I’m trying to program web projects in python, so I installed pycharm to work... It’s a great IDE at first, but it seems like the world doesn’t even use it. The funny thing is that I’m trying to do the blessed "hello world" in Jango, in pycharm, but I just come across tracebacks, even using a virtualenv in python 3 as an interpreter. Then I ask the comrades, is it worth insisting? Although it is very practical, this headache for so little is valid? I stand by.

Look at my current problem in pycharm:

/home/user/mv_python/django/bin/python 
/home/user/PycharmProjects/django_ecommerce/manage.py runserver 
8000
Performing system checks...

System check identified some issues:

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in 
Django 1.8 and the TEMPLATES dictionary takes precedence. You must put 
the values of the following settings into your default TEMPLATES dict: 
TEMPLATE_DIRS.

System check identified 1 issue (0 silenced).

You have 13 unapplied migration(s). Your project may not work properly 
until you apply the migrations for app(s): admin, auth, contenttypes, 
sessions.
Run 'python manage.py migrate' to apply them.
August 16, 2017 - 20:16:37
Django version 1.11.4, using settings 'django_ecommerce.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Internal Server Error: /
Traceback (most recent call last):
File "/home/user/mv_python/django/lib/python3.5/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/home/user/mv_python/django/lib/python3.5/site-
packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/user/mv_python/django/lib/python3.5/site-
packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, 
**callback_kwargs)
File 
"/home/user/PycharmProjects/django_ecommerce/core/views.py", 
line 7, in index
return render(request, 'index.html ')
File "/home/user/mv_python/django/lib/python3.5/site-
packages/django/shortcuts.py", line 30, in render
content = loader.render_to_string(template_name, context, request, 
using=using)
File "/home/user/mv_python/django/lib/python3.5/site-
packages/django/template/loader.py", line 67, in render_to_string
template = get_template(template_name, using=using)
File "/home/user/mv_python/django/lib/python3.5/site-
packages/django/template/loader.py", line 25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: index.html 
[16/Aug/2017 20:16:40] "GET / HTTP/1.1" 500 83461
Not Found: /favicon.ico
[16/Aug/2017 20:16:40] "GET /favicon.ico HTTP/1.1" 404 2074
Not Found: /favicon.ico
[16/Aug/2017 20:16:40] "GET /favicon.ico HTTP/1.1" 404 2074

Process finished with exit code 0
  • 1

    The problem has nothing to do with pycharm, without fear of error I can tell you that pycharm is among the best ide’s in the python world and is used by 99.99% of experienced developers.

1 answer

2


I also found a solution to the error

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in 
Django 1.8 and the TEMPLATES dictionary takes precedence. You must put 
the values of the following settings into your default TEMPLATES dict: 
TEMPLATE_DIRS

In the stack in English

Define debug in the dictionary OPTIONS of your settings models.

DEBUG = True

TEMPLATES = [
    {
        ...
        'OPTIONS': {
            'debug': DEBUG,
        },
    },
]

Then remove this line from your settings to stop the warnings

TEMPLATE_DEBUG = DEBUG

Also on the line 7 of the archive py views., contains a space in the final

File 
"/home/user/PycharmProjects/django_ecommerce/core/views.py", 
line 7, in index
return render(request, 'index.html ')

Checks whether the file index.html exists, otherwise no will really work.

  • Vlw Wellinghton, yes the index.html file exists I had created but could not call it. I ended up creating the template folder, which pycharm creates into the "core" folder that is my application, but is not able to call.... I spent hours trying to debug, but without understanding what the mistake was after all! I will modify and then return!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.