Re: Settings file for multiple environments?

2019-04-17 Thread ANi
yes, it is "abcd.*settings*.hk". And I think it will show error if it's 
wrong (?

Ayser shuhaib於 2019年4月18日星期四 UTC+8下午1時10分04秒寫道:
>
> Are you sure about the directory?
> I mean is it “ abcd.setting.hk” or “abcd.settings.hk” ?
>
> On Thu, 18 Apr 2019 at 06:00, ANi > wrote:
>
>>
>> Hi,
>> I divided my settings into different files, but I think it's not working 
>> on Heroku, here are my code:
>>
>> # This is abcd/setting/hk.py
>> from .base import *
>> import dj_database_url
>>
>>
>> DATABASES = {
>>  'default': dj_database_url.config()
>> }
>>
>>
>> ALLOWED_HOSTS.append('abcdmyapp.herokuapps.com')
>> WSGI_APPLICATION = 'abcd.wsgi.hk.application'
>> MIDDLEWARE.append('whitenoise.middleware.WhiteNoiseMiddleware')
>>
>> DEBUG = False
>>
>>
>> I doubt these two configurations because I still can run my app in debug 
>> mode but got a error about not allowing the host and there is no folder 
>> created for static files.
>>
>>
>> More info:
>>
>> # This is base.py
>> # no DATABASES, DEBUG and WSGI_APPLICATION
>>
>> ALLOWED_HOSTS = ['127.0.0.1']
>> MIDDLEWARE = [
>> 'django.contrib.sessions.middleware.SessionMiddleware',
>> 
>> ]
>>
>>
>> # This is Procfile
>>
>> web: gunicorn abcd.wsgi.hk 
>> release: python manage.py migrate
>> web: python manage.py runserver 0.0.0.0:$PORT
>>
>> # This is abcd/wsgi/hk.py
>>  
>> import os
>> from django.core.wsgi import get_wsgi_application
>> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "abcd.settings.hk")
>> application = get_wsgi_application()
>>
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/8a6fe85d-2349-4b58-86df-6e2a4df00500%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/919a2737-c2fa-48e7-84ed-5e89a4ac0522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Settings file for multiple environments?

2019-04-17 Thread Ayser shuhaib
Are you sure about the directory?
I mean is it “ abcd.setting.hk” or “abcd.settings.hk” ?

On Thu, 18 Apr 2019 at 06:00, ANi  wrote:

>
> Hi,
> I divided my settings into different files, but I think it's not working
> on Heroku, here are my code:
>
> # This is abcd/setting/hk.py
> from .base import *
> import dj_database_url
>
>
> DATABASES = {
>  'default': dj_database_url.config()
> }
>
>
> ALLOWED_HOSTS.append('abcdmyapp.herokuapps.com')
> WSGI_APPLICATION = 'abcd.wsgi.hk.application'
> MIDDLEWARE.append('whitenoise.middleware.WhiteNoiseMiddleware')
>
> DEBUG = False
>
>
> I doubt these two configurations because I still can run my app in debug
> mode but got a error about not allowing the host and there is no folder
> created for static files.
>
>
> More info:
>
> # This is base.py
> # no DATABASES, DEBUG and WSGI_APPLICATION
>
> ALLOWED_HOSTS = ['127.0.0.1']
> MIDDLEWARE = [
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 
> ]
>
>
> # This is Procfile
>
> web: gunicorn abcd.wsgi.hk
> release: python manage.py migrate
> web: python manage.py runserver 0.0.0.0:$PORT
>
> # This is abcd/wsgi/hk.py
>
> import os
> from django.core.wsgi import get_wsgi_application
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "abcd.settings.hk")
> application = get_wsgi_application()
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8a6fe85d-2349-4b58-86df-6e2a4df00500%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE0AZGLtyhXJ5X3HL00H5sbB66h5rGftnu%2BVYWZdEmkOvzV4Cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Settings file for multiple environments?

2019-04-17 Thread ANi

Hi,
I divided my settings into different files, but I think it's not working on 
Heroku, here are my code:

# This is abcd/setting/hk.py
from .base import *
import dj_database_url


DATABASES = {
 'default': dj_database_url.config()
}


ALLOWED_HOSTS.append('abcdmyapp.herokuapps.com')
WSGI_APPLICATION = 'abcd.wsgi.hk.application'
MIDDLEWARE.append('whitenoise.middleware.WhiteNoiseMiddleware')

DEBUG = False


I doubt these two configurations because I still can run my app in debug 
mode but got a error about not allowing the host and there is no folder 
created for static files.


More info:

# This is base.py
# no DATABASES, DEBUG and WSGI_APPLICATION

ALLOWED_HOSTS = ['127.0.0.1']
MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',

]


# This is Procfile

web: gunicorn abcd.wsgi.hk 
release: python manage.py migrate
web: python manage.py runserver 0.0.0.0:$PORT

# This is abcd/wsgi/hk.py
 
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "abcd.settings.hk")
application = get_wsgi_application()



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8a6fe85d-2349-4b58-86df-6e2a4df00500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.