IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Django Python Discussion :

Collectistatic et déploiement impossible


Sujet :

Django Python

  1. #1
    Membre régulier
    Homme Profil pro
    growth hacker
    Inscrit en
    Novembre 2018
    Messages
    182
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : growth hacker
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2018
    Messages : 182
    Points : 116
    Points
    116
    Par défaut Collectistatic et déploiement impossible
    Selon moi j'ai fait tout correctement pourtant quand je mets le débug False j'ai une erreur 505:

    j'ai essayé de vider la base, ça fonctionne. Déploiement avec débug True, non

    les fichiers indispensables sont là ctd requirements.txt, runtime.txt, Procfile
    settings.py:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
     
    if os.environ.get('ENV') == 'PRODUCTION':
        DEBUG = False
        ALLOWED_HOSTS = ['xxx.herokuapp.com']
    else:
        DEBUG = True
        ALLOWED_HOSTS = []
     
    MIDDLEWARE = [
        'django.middleware.security.SecurityMiddleware',
     
        "whitenoise.middleware.WhiteNoiseMiddleware",
     ]
     
    STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
    STATIC_URL = '/static/'
     
    MEDIA_URL = '/media/'
     
    STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
     
    MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
     
    DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
     
    if os.environ.get('ENV') == 'PRODUCTION':
     
        # Static files settings
        STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
        STATIC_URL = '/static/'
     
        MEDIA_URL = '/media/'
     
        STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
     
        MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
     
        STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"
     
        db_from_env = dj_database_url.config(conn_max_age=500)
        DATABASES['default'].update(db_from_env)
     
     
    django_heroku.settings(locals())

  2. #2
    Membre régulier
    Homme Profil pro
    growth hacker
    Inscrit en
    Novembre 2018
    Messages
    182
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : growth hacker
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2018
    Messages : 182
    Points : 116
    Points
    116
    Par défaut
    debug True sans production ça fonctionne

Discussions similaires

  1. Déploiement, impossible d'utiliser le SMTP Local
    Par CUCARACHA dans le forum ASP.NET MVC
    Réponses: 4
    Dernier message: 16/07/2012, 09h35
  2. Réponses: 1
    Dernier message: 08/12/2011, 13h23
  3. Déploiement impossible: EJB already registered
    Par tchize_ dans le forum Wildfly/JBoss
    Réponses: 2
    Dernier message: 17/11/2011, 23h53
  4. [WS 2003] Déploiement application impossible
    Par scarface56 dans le forum Windows Serveur
    Réponses: 0
    Dernier message: 23/04/2009, 14h12
  5. [VS2008] Déploiement http impossible
    Par CUCARACHA dans le forum ASP.NET
    Réponses: 2
    Dernier message: 13/10/2008, 09h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo