Questions tagged [django-settings]

A Django settings file is a Python module with module-level variables that contains all the configuration of your Django installation such as, Databases, Installed apps and Media and Static location to name a few.

Django settings file is a Python module with module-level variables that contains all the configuration of your Django installation such as: Databases, Installed apps and Media and Static location to name a few.

Here are a couple of example settings, extracted from the documentation:

DEBUG = False
DEFAULT_FROM_EMAIL = 'webmaster@example.com'
TEMPLATE_DIRS = ('/home/templates/mike', '/home/templates/john')
923 questions
0
votes
1 answer

How to set default url in settings.py for "www.example.com/path"

I am trying to deploy my django on a server, but this server has an extra tag for the url like this. http://john.example.com/mywebsite instead of http://john.example.com so whenever I want to redirect from the homepage to other pages, I got error…
0
votes
0 answers

one database from two different projects django

I am having two separate projects which I intent to share a database between them. The first project called first_project and second called second_project in the first project I have mysite.db. And I want to use mysite.db in my second project. I…
0
votes
1 answer

How change caching setting in django_cache_utils0.7 to cache the files in different directory other than C drive?

I am using django-cache-utils 0.7 where I am not able to change the cache directory to a drive location other than the default location. Please can anyone tell me how to define custom location and set a size limit on the folder ? CACHE_BACKEND =…
Sohail.py
  • 3
  • 2
0
votes
2 answers

Django database not always available

I have specified multiple databases in settings.py. One of the databases is a local Oracle database which is only available on my computer at work. So when I open my site on a computer which does not have access to this Oracle database, I see the…
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
0
votes
1 answer

Use Pytest with Django without using django-pytest 3rd party app

Is it possible to use Pytest with Django without using django-pytest 3rd party app? I had tried to set this up, but kept running into random errors, like pytest couldn't find the DJANGO_SETTINGS_MODULE. Then I fixed the path, but the normal python…
Aaron Lelevier
  • 19,850
  • 11
  • 76
  • 111
0
votes
1 answer

template not looked at app level template directory in django?

I get this error: TemplateDoesNotExist at /link/ link_app/link_list.html Request Method: GET Request URL: http://127.0.0.1:8000/link/ Django Version: 1.6 Exception Type: TemplateDoesNotExist Exception Value: link_app/link_list.html Inside…
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
0
votes
1 answer

django: changing settings while running

Is there a problem to change one of the settings when django is running? For example, I'd like to change REGISTRATION_OPEN from the django-registration app from False to True when it is live. I do not want to stop the server to change this value. Is…
Michael
  • 8,357
  • 20
  • 58
  • 86
0
votes
0 answers

Not able to configure Django project with multiple apps

Here is my project structure: Project |_Application_one |_Application_two |_DjangoProject (Now has been deleted) |_manage.py |_settings.py |_urls.py |_templates |_home.html I want to load the content of…
Amit Pal
  • 10,604
  • 26
  • 80
  • 160
0
votes
1 answer

django collect static looking for nonexistent directory

I am getting an existing project running locally. I am trying to collectstatic content to see my css, images, etc. My project structure looks like: myprojectname --- myprojectname --- --- myproectname --- --- --- settings --- --- --- --- base.py…
Atma
  • 29,141
  • 56
  • 198
  • 299
0
votes
1 answer

wrong time shown in admin for registration in Django?

I just registered for a new user account using Django Admin but it gives the time of registration wrong. It must be March 24, 2014, 11.01 a.m.but it shows as March 24, 2014, 6:01 p.m. I am in PST time-zone. In my settings.py, I have TIME_ZONE =…
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
0
votes
1 answer

STATICFILES on Django 1.6.2

This is my settings.py STATIC_URL = '/static/' TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) STATICFILES_FINDERS = ( …
Lucas Rezende
  • 2,516
  • 8
  • 25
  • 34
0
votes
1 answer

How do I define a App path in the new Django 1.7 App Registry

In the new Django 1.7 App Cache/App Registry I can apparently define a path/location for my app. I've looked in the documentation and it's not clear how/where to define the app's path. Is it implemented by something like a tuple in…
Williams
  • 4,044
  • 1
  • 37
  • 53
0
votes
1 answer

How can I change Django's project database name running on MAMP?

So, I have a running project that uses a MySQL database with a MAMP local server but for compliance issues I need to change the database name. So I changed it in MAMP and I changed it in settings.py as seen bellow: DATABASES = { 'default': { …
0
votes
0 answers

How do I put custom user models into Django admin

So, I have a model with 3 custom user classes: class customUser(AbstractBaseUser): class customUser(AbstractBaseUser): class customUser(AbstractBaseUser): I need all of them to be in Django's admin like Users and Groups in Django by…
Adilet Maratov
  • 1,312
  • 2
  • 14
  • 24
0
votes
1 answer

can't load image that save in media in url

I search many place but I can't find a solution for my problem.here is my settings.py: MEDIA_ROOT = '' MEDIA_URL = '' STATIC_ROOT = '' STATIC_URL = '/static/' in modesl.py I have a imagefield: class comp(modesl.Model): picture =…
mojibuntu
  • 307
  • 3
  • 16