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

Dajaxice running locally, but django settings problems to make it work online

I have created a Django account which uses Dajaxice and Dajax. I run my website in an azure VM. When I run it with localhost Dajaxice/Dajax work perfectly. However, online this does not work anymore. I have some configurations problems in my…
0
votes
1 answer

Key Value Storage for django ? editable in django admin

I need some good way to provide admin users of my django 1.5 app, manage some various app parameters, these parameters or settings are different from the app core settings, ... can anyone point some directions for this ?? thanks everyone
Daniel
  • 367
  • 2
  • 3
  • 9
0
votes
2 answers

django/python: to access defined constant by equivelent string

I have defined constant in django settings file like LABEL_NAME = 'xyz' And now I am having string 'LABEL_NAME' with me and want to have its equivalent constant defined value i.e 'xyz' I can able to access 'xyz' value by LABEL_NAME. But I don't…
MaNKuR
  • 2,578
  • 1
  • 19
  • 31
0
votes
0 answers

ImageField with thumbnail and generated upload_to path

I have following code in my models.py: def product_upload_to(instance, filename): return 'img/products/%s/large/%s' % (instance.uuid, filename,) def thumb_upload_to(instance, filename): return 'img/products/%s/thumb/%s' % (instance.uuid,…
dease
  • 2,975
  • 13
  • 39
  • 75
0
votes
1 answer

Using Waffle to toggle settings.py

Are there any caveats with using Waffle Switches to conditionally change settings in my project's settings.py? For instance, is it required to restart the Django process for the changes to take effect? And if a restart is required, what is the best…
nak
  • 690
  • 6
  • 15
0
votes
1 answer

Django admin panel works but main page gives me a 404

I'm brand new to Django and Python. I've only done php. It took me three tries, but I've almost Django installed correctly. I followed the tutorial on installing it, and it worked. So I enabled the admin, panel, and set up mysql. The admin panel…
gregor
  • 2,071
  • 3
  • 13
  • 9
0
votes
0 answers

Different project settings for admins in Django

I've just started to learn django. I'd like to know if it's possible to have different settings for certain users like admins with the default auth system. For example I'd like to have DEBUG = True if the user is super user and DEBUG = False if not.…
martintrapp
  • 769
  • 6
  • 15
0
votes
1 answer

What is the order of execution In Django Tests

Here is an example test class: @decorator_1() class SimpleTest(TestCase): fixtures = ['test_fixture.json'] def setup(self): x =1 y=2 def teardown(self): x =None y=None def…
Alex
  • 1,891
  • 3
  • 23
  • 39
0
votes
1 answer

How to setup Django default function?

I'm not sure that my question is correct. I develop a web site on local machine and I can not understand how to setup a view which will be executed when I open a start page http://127.0.0.1:8000/ I've tried to write a url - url(r'^/',…
Nodari Lipartiya
  • 1,148
  • 3
  • 14
  • 24
0
votes
0 answers

Django logging setting configuration issue

My Logging settings is like below: LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'standard': { 'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", …
arnold
  • 1,682
  • 8
  • 24
  • 31
0
votes
1 answer

django alter settings for one app

Well, I have a django project which works fine now. I'd like to add a new app to it, in which I need to access multiple databases. I know Django support multiple databases settings and know how to configure it. This is not the problem. The issue is…
Jerry Meng
  • 1,466
  • 3
  • 21
  • 40
0
votes
0 answers

AttributeError: 'LocaleRegexURLResolver' object has no attribute '_regex_dict' in django-cms

====When I run the project of django-cms, it shows me an Attribute error like LocalRegexURLResolver i dont know how to solve this error please help me===== /usr/local/lib/python2.7/dist-packages/django/conf/urls/defaults.py:3: DeprecationWarning:…
0
votes
1 answer

django settings error (DB Engine) when I moved all of my apps to "apps" directory

I changed the traditional django layout, and decided to put all of my apps to apps directory. the initial layout is something like this: Project/ apps/ myapp/ __init__.py tests/ __init__.py setting.py urls.py …
Eric
  • 5
  • 3
0
votes
0 answers

What should the Django DATABASE settings be in settings.py when you are using Apache2, Python, and Django on Ubuntu 12.04 and MSSQL on another server?

What should the Django DATABASE settings be in settings.py when you are using Apache2, Python, and Django on Ubuntu 12.04 accessing an MS SQL database on another server? Currently my settings are: ENGINE: 'sql_server.pyodbc', 'NAME':…
Glenda
  • 1
0
votes
1 answer

django a different production_settings file

I have a settings.py file, that contains basic settings. Then I have a local_settings.py file, that contains some profiling and testing apps as django_debug_toolbar etc. and then I have a different production_settings.py file, that contains db…
user1629366
  • 1,931
  • 5
  • 20
  • 30