Jump to content
Fórum Script Brasil
  • 0

Criação de APP em sub pasta


Question

Olá, estou iniciando no python/django, estou seguindo um tutorial, porém estou esbarrando logo no inicio, acredito que é na definição das rotas, estou montando projeto na seguinte estrutura:

PASTA_PROJETO
--- rhm (pasta)
------ pessoal (meu app)
# urls. py do projeto
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('',include('pessoal.urls')), # tentei path('rhm/',include('pessoal.urls'))
    path('admin/', admin.site.urls),
]
# settings.py

INSTALLED_APPS = [
    'rhm/pessoal' # tentei apenas 'pessoal'
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]
# apps.py do app criado
from django.apps import AppConfig


class PessoalConfig(AppConfig):
    name = 'pessoal'
# views.py dentro do app
from django.shortcuts import render
from django.http import HttpResponse

def index(request):
    return H

Quanto tento acessar o localhost ele exibe o seguinte erro no terminal

ModuleNotFoundError: No module named 'pessoaldjango'

 

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      148900
    • Total Posts
      644981
×
×
  • Create New...