failing to deploy
silascode
TRIALOP

2 years ago

I have been trying to deploy my project from Github, after paying the hobby plan but my project is failing to deploy and i can't get the help i need to fix the issue that seem to be from railway
I'm unable to deploy my project from GitHub.
There is no other options or guidance towards fixing the error.

Solved

5 Replies

dev
MODERATOR

2 years ago

So you're deploying your app but it's crashing?
Any logs?


silascode
TRIALOP

2 years ago

Hello there! i'm trying to deploy my django project to railway from github. here is the error i'm getting
[Region: us-west1]

==============

Using Nixpacks

==============

context: 7a841832fbe02cbdc35ae244f07

Nixpacks build failed

Error: Error reading models.py

Caused by:

stream did not contain valid UTF-8


dev
MODERATOR

2 years ago

Does your models.py script contain valid UTF-8


silascode
TRIALOP

2 years ago

Yes it's all valid UTF-8
Here is my Model.py

from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
from datetime import datetime, date
from ckeditor.fields import RichTextField

class Category(models.Model):
name = models.CharField(max_length=100)

class Meta:
    ordering = ('name',)
    verbose_name_plural ='Categories'

def __str__(self):
    return [self.name](self.name)

def get_absolute_url(self):
    return reverse('home')

class Profile(models.Model):
user = models.OneToOneField(User, null=True, ondelete=models.CASCADE) bio = models.TextField() profilepic = models.ImageField(null=True, blank=True, uploadto="images/profile/") websiteurl = models.CharField(maxlength=255, null=True, blank=True) facebookurl = models.CharField(maxlength=255, null=True, blank=True) twitterurl = models.CharField(maxlength=255, null=True, blank=True) instagramurl = models.CharField(maxlength=255, null=True, blank=True) pinteresturl = models.CharField(maxlength=255, null=True, blank=True) youtubeurl = models.CharField(max_length=255, null=True, blank=True)

def __str__(self):
    return str(self.user)

def get_absolute_url(self):
    return reverse('home')

class Post(models.Model):
title = models.CharField(maxlength=255) headerimage = models.ImageField(null=True, blank=True, uploadto="images/") videofile = models.FileField(null=True, blank=True, uploadto='videos/') titletag = models.CharField(maxlength=255) author = models.ForeignKey(User, ondelete=models.CASCADE)
#body = RichTextField(blank=True, null=True)
#frenchbody = RichTextField(blank=True, null=True) body = models.TextField() frenchbody = models.TextField(null=True, blank=True)
postdate = models.DateTimeField(autonowadd=True) category = models.CharField(maxlength=255, default='')
snippet = models.CharField(maxlength=255) likes = models.ManyToManyField(User, relatedname='blogposts', blank=True) posthighlighted = models.BooleanField(default=False)
photocredit = models.CharField(maxlength=255, null=True, blank=True)

class Meta:
    ordering = ('-post_date',)

def total_likes(self):
    return self.likes.count()

def __str__(self):
    return self.title + ' | ' + str([self.author](self.author))

def get_absolute_url(self):
    return reverse('home')

class Comment(models.Model):
post = models.ForeignKey(Post, relatedname="comments", ondelete=models.CASCADE)
name = models.CharField(maxlength=255) body = models.TextField() dateadded = models.DateTimeField(autonowadd=True)

def __str__(self):
    return '%s - %s' % ([self.post](self.post).title, [self.name](self.name))

brody
EMPLOYEE

2 years ago

from the error message

stream did not contain valid UTF-8

so please make sure all files are formatted with utf-8 encoding


Status changed to Solved Railway about 2 years ago


Loading...