django-apps

ModuleNotFoundError: No module named 'musiclibrary.song'

ModuleNotFoundError: No module named 'musiclibrary.song' Question: There is an issue while importing model ‘Artist’ of my django app in views.py. from musiclibrary.song.models import Artist when I runserver it gives ModuleNotFoundError. from django.shortcuts import render from django.http import HttpResponse from musiclibrary.song.models import Artist def hello_world(request): return HttpResponse("Hello World!") def home(request): return render(request, "home.html") def artist(request): artist_list …

Total answers: 2

AttributeError: module 'profile' has no attribute 'run'

AttributeError: module 'profile' has no attribute 'run' Question: So I have an extended User model (extended AbstractUser) called Profile. This was in a seperate app called “profiles”. I was plugging in the standard login and realised it was looking for a “profile” app name as standard, so I renamed it (directories, code, DB schema) which …

Total answers: 3

Cannot import models from another app in Django

Cannot import models from another app in Django Question: so I have 2 apps running in the same project. My files are structured as follows: /project_codebase /project __init.py settings.py urls.py wsgi.py … /app1 … /app2 … manage.py So, I for some weird reason have a different name for my base directory (that is, it ends …

Total answers: 9

Django Reverse not found in views but URL works

Django Reverse not found in views but URL works Question: I have a project containing some Apps like Account , Webadmin , etc Where after login i am redirecting a user to a view of Webadmin. Thing is i can view that page of Webadmin via Browser or so! That means the link is working. …

Total answers: 4

dynamically loading django apps at runtime

dynamically loading django apps at runtime Question: Is it possible to dynamically load Django apps at runtime? Usually, apps are loaded at initialization, using the INSTALLED_APPS tuple in settings.py. However, is it possible to load additional apps at runtime? I am encountering this issue in different situations. One situation, for example, arises during testing, when …

Total answers: 5

How to keep all my django applications in specific folder

How to keep all my django applications in specific folder Question: I have a Django project, let’s say “project1”. Typical folder structure for applications is: /project1/ /app1/ /app2/ … __init__.py manage.py settings.py urls.py What should I do if I want to hold all of my applications in some separate folder, ‘apps’ for example? So that …

Total answers: 10

model not showing up in django admin

model not showing up in django admin Question: I have ceated several django apps and stuffs for my own fund and so far everything has been working fine. Now I just created new project (django 1.2.1) and have run into trouble from 1st moments. I created new app – game and new model Game. I …

Total answers: 32