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.
5 Replies
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
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
def get_absolute_url(self):
return reverse('home')class Profile(models.Model):
user = models.OneToOneField(User, null=True, on_delete=models.CASCADE)
bio = models.TextField()
profile_pic = models.ImageField(null=True, blank=True, upload_to="images/profile/")
website_url = models.CharField(max_length=255, null=True, blank=True)
facebook_url = models.CharField(max_length=255, null=True, blank=True)
twitter_url = models.CharField(max_length=255, null=True, blank=True)
instagram_url = models.CharField(max_length=255, null=True, blank=True)
pinterest_url = models.CharField(max_length=255, null=True, blank=True)
youtube_url = 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(max_length=255)
header_image = models.ImageField(null=True, blank=True, upload_to="images/")
video_file = models.FileField(null=True, blank=True, upload_to='videos/')
title_tag = models.CharField(max_length=255)
author = models.ForeignKey(User, on_delete=models.CASCADE)
#body = RichTextField(blank=True, null=True)
#french_body = RichTextField(blank=True, null=True)
body = models.TextField()
french_body = models.TextField(null=True, blank=True)
post_date = models.DateTimeField(auto_now_add=True)
category = models.CharField(max_length=255, default='')
snippet = models.CharField(max_length=255)
likes = models.ManyToManyField(User, related_name='blog_posts', blank=True)
post_highlighted = models.BooleanField(default=False)
photo_credit = models.CharField(max_length=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)
def get_absolute_url(self):
return reverse('home')class Comment(models.Model):
post = models.ForeignKey(Post, related_name="comments", on_delete=models.CASCADE)
name = models.CharField(max_length=255)
body = models.TextField()
date_added = models.DateTimeField(auto_now_add=True)
def __str__(self):
return '%s - %s' % (self.post.title, self.name)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 • over 2 years ago