27
questions
3
votes
1
answer
110
views
Masonite - TypeError: Can't convert 'Undefined' object to str implicitly
I'm using the Masonite framework and I'm getting an error when registering a user after running the craft auth command in Masonite 1.6. The end of the stack trace looks like:
{% for i, line in ...
1
vote
1
answer
173
views
Masonite throw Invalid secret key error, even after secret key is created
I'm trying to set sessions request.session.set('request_token', oauth.request_token) and it is throwing
InvalidSecretKey > You have passed an invalid secret key of:
your-secret-key. Make sure ...
1
vote
1
answer
55
views
Is there a helper method for getting the absolute path to storage directory of masonite?
I need to be able to get the absolute path in my controller and my views for a storage path. Some storage paths are different for different static assets in my Masonite application.
How can I do ...
1
vote
1
answer
1k
views
Masonite - AttributeError > 'str' object has no attribute 'filename'
I have a form that looks like this:
<form method="POST" action="/posts">
{{ csrf_field }}
<input type="text" name="username">
<input type="file" name="image">
<...
1
vote
1
answer
214
views
Where to change HTTP port setting in Masonite?
When I run craft serve and it serves the web pages on 8000 port.
Is there any setting where I can change the port so I can run the server on 3000 Port or something?
1
vote
1
answer
113
views
What is equivalent of login_required() in Masonite?
In Django, we use login_required() decoratir around the view, so that login is required to pass the request,, usually it redirects to login page?
How to do this in Masonite?
1
vote
1
answer
68
views
How to do Permanent Redirect in Masonite
I can redirect the user, it works but it has 302 status, how I can redirect a user and add 301 so it will be permanent redirect?
request.redirect('/dashboard')
1
vote
1
answer
75
views
Masonite Route Parameters with slash does not work
My Routes:
Get().route('/amp/@website', 'PageController@amp_info').name('amp_info'),
Get().route('/@website', 'PageController@info').name('info')
This works: https://websiteopedia.com/www.eventsnow....
1
vote
1
answer
195
views
masonite 'Post' object has no attribute 'controller'
I have a controller in my Masonite project and I can't figure out why it is throwing this error. Here is my code snippet:
def restore(self, view: View, upload: Upload):
upload.accept_file_types =...
1
vote
1
answer
73
views
Masonite: Migrations for production data
Actually, I can't import Masonite's models properly inside my migration file. I want to create pre-registered data as database seeds. How can I do that?
1
vote
0
answers
11
views
Masoniteorm jointable(pivot)
I use masonite framework,But i can't enter value to pivot table?
class User(Model, SoftDeletesMixin, Authenticates):
"""User Model."""
__fillable__ = ["name&...
1
vote
0
answers
22
views
How do I redirect to a specific route inside a controller method in Masonite framework?
In Masonite framework , How do I redirect to a specific route inside a controller method ?
In update method (UnitController@update) of my controller class UnitController , I want to redirect the ...
1
vote
1
answer
44
views
How to serve robots.txt from Masonite
I want to serve the files like robots.txt, humans.txt and manifest.json.
I saw the docs, I didn't find a solution, I have found view.render only serve HTML not text or JSON or any other file.
1
vote
1
answer
196
views
Masonite - TypeError > encoding without a string argument
Whenever I render a view, the error
encoding without a string argument`
is being thrown. This is my controller method:
def show(self, Application):
view('welcome', {'app': Application})
0
votes
1
answer
52
views
Masonite - What is the difference between "name" and "prefix" when making route groups
I have this code snippet but I am not sure what the difference between prefix and name is in the group parameters?
group([
#Get().route('/', 'WelcomeController@show').name('welcome'),
get('/',...