Questions tagged [masonite]

Masonite is modern and developer-centric Web Framework written in Python that strives for an actual battery included developer tool with a lot of out of the box functionality with an extremely extendable architecture. Use this tags when questions are related to Masonite framework.

Links:

26 questions
3
votes
1 answer

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 enumerate(open(stack.filename)) %} TypeError: Can't…
Joseph Mancuso
  • 403
  • 5
  • 11
1
vote
1 answer

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.com this does not…
Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
1
vote
1 answer

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 = None filename =…
Joseph Mancuso
  • 403
  • 5
  • 11
1
vote
1 answer

Masonite - AttributeError > 'str' object has no attribute 'filename'

I have a form that looks like this:
{{ csrf_field }}
But when I submit this form…
Joseph Mancuso
  • 403
  • 5
  • 11
1
vote
1 answer

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?
Junior Gantin
  • 2,102
  • 1
  • 18
  • 24
1
vote
1 answer

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?
Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
1
vote
1 answer

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.
Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
1
vote
1 answer

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?
Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
1
vote
1 answer

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 you have correctly added your secret key. I did…
Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
1
vote
1 answer

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})
Joseph Mancuso
  • 403
  • 5
  • 11
0
votes
0 answers

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 route to 'unit/@id' and which eventually goes…
0
votes
0 answers

Cannot start Masonite project. Get CERTIFICATE_VERIFY_FAILED error

Trying to create first Masonite project. When running [project start .] I get an SSLError [SSL:CERTIFICATE_VERIFY_FAILED]. Unable to find resolution. OpenSSL is installed. Any suggestions? Thanks Python 3.8 CentOS 7
Loom
  • 83
  • 9
0
votes
0 answers

deploy Masonite framework on windows IIS

I have struggled to deploy Python Masonite build web app on windows IIS. Does anyone here has done that before. Do you might to share the guides online for me to reference? I tried to follow Djagon and Flask framework deployment approach but it…
0
votes
1 answer

AttributeError: 'NoneType' object has no attribute 'list_middleware' in masonite\routes\Route.py", line 166

Upon running python craft migration create_a_table --create a_table I received the following traceback: Traceback (most recent call last): File "SOMEPATH\craft", line 8, in from wsgi import application File "SOMEPATH\wsgi.py", line…
Jelmergu
  • 973
  • 1
  • 7
  • 19
0
votes
1 answer

Masonite Invalid CSRF token

Invalid CSRF Token raise InvalidCSRFToken("Invalid CSRF Token") After running the command "python craft serve" it is showing this error.
1
2