Can't run a downloaded django server

Hi, so i have created a django project with some apps in linux. But when a friend in Windows 10 tries to run it it shows a warning i got about a url namespace is not unique and
‘System check identified 1 issue (0 silenced).’
nothing else shows up, no promt either. Nothing about development server started or anything.
He have activated the venv and downloaded with pip django and mysqlclient.
Another friend who has linux doesnt have this problem. He can successfully run the server.
When my windows friend starts a new project with
'django-admin startproject ’ and starts the server it works.
What is a possible problem here?

Python 3.8.5
Django 3.1.1

We’d probably need to see (at least) the complete text of the output your friend is receiving. We’re likely also going to need to see the settings.py file (sanitized - remove any credentials and your secret key), root urls.py and any referenced urls file.
(There may be more, but this should be a good start.)

This is our settings file. He is pointing to his database.cnf file with same structure as my example. We use the same secred key since its only development.

Django settings for twelvesteps project.

Generated by 'django-admin startproject' using Django 3.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/

"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = ''

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'breathe.apps.BreatheConfig',
    'call.apps.CallConfig',
    'chat.apps.ChatConfig',
    'check.apps.CheckConfig',
    'home.apps.HomeConfig',
    'danger.apps.DangerConfig',
    'info.apps.InfoConfig',
    'practice.apps.PracticeConfig',
    'savemeplan.apps.SavemeplanConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'twelvesteps.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            BASE_DIR / 'templates'
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'twelvesteps.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
"""
Added by Kevin
read_default_file is the file wich will contain information about the
database. Change /path/to/my.cnf to your .cnf file
This is how the .cnf file should look like
"""

"""
[client]
database = NAME
user = USER
password = PASSWORD
default-character-set = utf8
"""

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'OPTIONS': {
            'read_default_file': '',
        },
    }
}


# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Europe/Stockholm'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    BASE_DIR / 'static/',
]

This is what he sees when doing
python manage.py runserver

Watching for file changes with StatReloader
Performing system checks...

System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace 'home' isn't unique. You may not be able to reverse all URLs in this nam
espace                                                                                                

System check identified 1 issue (0 silenced).

He tried going to
localhost:8000 but didnt work.

Thanks for the reply

Ok, so now we are going to need to see your root urls.py file and any other urls.py files that are referenced by your application.

Sorry forgot them.
Here are those which apps i have actually changed something in.

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('home.urls')),
    path('home/', include('home.urls')),
]

This is the only ones i have actually done something in

from django.urls import path

from . import views

app_name = 'home'
urlpatterns = [
    # ex: /polls/
    path('', views.IndexView, name='index'),
]

I got like 7 other items in urlpatterns but i have only set app_name.

I haven’t done any actual development yet. I have only created a start for my friends to use.

So part of the problem is that you’ve got two urls pointing to the same view name. Index can resolve to either / or home/ - that’s what’s causing the message.

You should be seeing that same warning in your Linux environment, it just doesn’t prevent the server from starting up.

Since you are not getting anything following the “System check identified…” message, I don’t believe the problem is in the application. For some reason, Windows is preventing that application from starting.

One difference between your application and starting one from scratch is that the default start app uses sqlite rather than MySQL. This leads me to believe the issue is related to database connectivity.

Is this person connecting to your database, or one of their own? Can you verify that they can connect to the database from their code? (Is Windows firewall blocking the connection?)
If it’s their own database, have they done the migrate to get the tables initialized?

Another way to attempt to verify this would be to replace the database connection with a sqlite database, just to prove that the app itself would work if the database connectivity were correct.

Thanks for the answere!

So my first thought was that having two urls point to same place is a good idea but not now.

Didn’t even thought about database conectivity. My friend is using his own localhosted mariadb server with its own user and password.

I will look more into it. I will check and see if it is the database connection that is the fault. If it isn’t i will reply with an update. Thanks again!

Having two urls point to the same place is fine, provided you define them such that each has a different name. (See URL namespaces and included URLconfs for some ideas.)

(Sidebar: We have a similar situation - a bare URL needs to display a particular application home page, but we handle that through a redirect.)