lingthio / flask-user-starter-app Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
In app/settings.py:
USER_ENABLE_REGISTRATION = True # Allow new users to register
changing to false has no effect.
The setting should be:
USER_ENABLE_REGISTER = True # Allow new users to register
Returns status code 500? But other than that, I can login using [email protected] and [email protected]
Hi how to setup ENV_SETTINGS_FILE in Win 7? Thanks
In startup/create_app.py/create_app:
env_settings_file = os.environ.get('ENV_SETTINGS_FILE', 'env_settings_example.py')
app.config.from_pyfile(env_settings_file)
this needs to change to env_settings.py outside project directory as well?
i see you have gunicorn in the requirements.txt but i can't seem to able to run the application using gunicorn ? any help ?
I can change register template but i dont know how i can change login template?
I followed the installation instructions and all of the requirements install successfully. I'm using the newest version of virtualenvwrapper. When I visit localhost:5000 I get the following error:
File "[path_to_project]/app/templates/layout.html", line 29, in block "body"
{% if current_user.is_authenticated() %}
AttributeError: 'bool' object has no attribute '__call__'
I'm somewhat new to flask and to Python, apologies if this is not a problem with the application itself, but I am stumped as to how to fix it. I googled a couple of solutions and haven't found anything that works. Thank you!
Flask-Mail is required but left out of requirements.txt
when trying to initialise the db it gives the following error
ImportError: cannot import name 'url_encode' from 'werkzeug'
Werkzeug changed the url_encode function from werkzeug.url_encode to werkzeug.urls.url_encode.
Simple fix should be to bump flask-wtf to version 0.14.3
Thanks for the awesome framework and organizational scheme!
I would love to use this as a starting point for my app, but I see several longstanding issues here in the Github issue tracking system, and quite a few old pull requests.
Is this project considered a deprecated example?
Have tried using the default
env_settings_example.py as well as using my own env_settings.py, but they all cannot register new users?
Have been able to sign in using default admin and user:
Test users:
But cannot create new user:
127.0.0.1 - - [07/Sep/2015 13:07:34] "GET /user/register HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2015 13:08:10] "POST /user/register HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_user/views.py", line 423, in register
_send_registered_email(user, user_email, require_email_confirmation)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_user/views.py", line 662, in _send_registered_email
emails.send_registered_email(user, user_email, confirm_email_link)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_user/emails.py", line 148, in send_registered_email
user_manager.send_email_function(email, subject, html_message, text_message)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_user/emails.py", line 49, in send_email
mail_engine.send(message)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_mail.py", line 491, in send
with self.connect() as connection:
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_mail.py", line 144, in __enter__
self.host = self.configure_host()
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/site-packages/flask_mail.py", line 156, in configure_host
host = smtplib.SMTP_SSL(self.mail.server, self.mail.port)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/smtplib.py", line 796, in __init__
SMTP.__init__(self, host, port, local_hostname, timeout)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/smtplib.py", line 256, in __init__
(code, msg) = self.connect(host, port)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/smtplib.py", line 316, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/smtplib.py", line 801, in _get_socket
new_socket = socket.create_connection((host, port), timeout)
File "/home/osboxes/anaconda/envs/py27/lib/python2.7/socket.py", line 557, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
TypeError: getaddrinfo() argument 1 must be string or None
127.0.0.1 - - [07/Sep/2015 13:08:10] "GET /user/register?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2015 13:08:10] "GET /user/register?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2015 13:08:10] "GET /user/register?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2015 13:08:10] "GET /user/register?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [07/Sep/2015 13:08:10] "GET /user/register?__debugger__=yes&cmd=resource&f=source.png HTTP/1.1" 200 -
The starter app is failing. It's probably due to updates in dependencies - flask-user.
As of Flask 0.11 or so, flask_script is no longer needed. See here for details on using the new stuff - it looks pretty easy, just decorate existing functions.
Edit ~/dev/my_app/app/env_settings.py.
Should be:
Edit ~/dev/my_app/app/local_settings.py
There isn't an env_settings.py
file in the project and the user was just asked to copy to local_settings.py
Maybe the intended is to reference local_settings.py and edit that?
Can someone else confirm? Not sure what the fix would be for this
The README for this project says: "This code base serves as a great starting point to write your next Flask application."
However, there's no mention of the license terms of this project, and each file is headed with:
# Copyright 2014 SolidBuilds.com. All rights reserved
#
# Authors: Ling Thio <[email protected]>
Could you clarify the terms for using or distributing this code? Are people even allowed to use this in the first place? And if we are, under what terms? Is this in the Public Domain? Creative Commons? MIT License? GPL?
Hello,
I did follow the instruction, I got the application running but I got redirect errors when signing in.
I also got these errors (see error.txt) when running the unit tests.
Any idea?
best
Matthias
Still not able to start project, though I can see db created with admin and user sample db. But upon launching it is status code 500?
Table names and some property names in 0001c8ac1a69_initial_version.py do not match those in models.py. I guess migration file needs to be updated.
File "/Users/Flask-User-starter-app-0.6/app/views/misc_views.py", line 40, in user_profile_page
form = UserProfileForm(request.form, current_user)
File "/usr/local/lib/python3.6/site-packages/wtforms/form.py", line 212, in call
return type.call(cls, *args, **kwargs)
TypeError: init() takes from 1 to 2 positional arguments but 3 were given
It's a nice Sample to learn flask. Great help to me , TKS!
create_app.py.create_app function:
env_settings_file = os.environ.get('ENV_SETTINGS_FILE', 'env_settings.py')
or is it supposed to get the env_settings as intended?
The text in app/templates/README.md
includes
The template files are organized into the following directories:
common # Common base template files and macros
flask_user # Flask-User template files (register, login, etc.)
pages # Template files for web pages
However there is only a common
and main
folder, and a main/register.html
that I think, is never used.
On a Linux machine, I get this error:
Traceback (most recent call last):
File "manage.py", line 7, in <module>
app = create_app()
File "../Flask-User-starter-app/app/create_app.py", line 24, in create_app
app.config.from_pyfile(env_settings_file)
File "../lib/python3.4/site-packages/flask/config.py", line 129, in from_pyfile
with open(filename) as config_file:
FileNotFoundError: [Errno 2] Unable to load configuration file (No such file or directory): '../Flask-User-starter-app/appenv_settings.py'
The issue is in create_app.py
on line 21:
default_filename = app.root_path + 'env_settings.py'
Which can be fixed with:
default_filename = app.root_path + '/env_settings.py'
I have not opened a PR for this because it may break non-Linux installs by creating //
for the file-path.
Please confirm, otherwise I will open a PR for it.
reset_db.py is in app/startup/ from there it is unable to resolve package dependencies. When I moved it to root directory it's fine.
OR am I doing something wrong?
Default python2.7 installation in Openshift has app.py file in root dir to run Python app. The base module is called the same so in reality not found.
In my case I renamed the module app to "application".
There is a problem with the reset password.
I'm trying to assign a default user role to newly registered accounts. In the flask-user documentation this code is used to manually assign a user role to a new account:
user.roles.append(Role(name='Admin'))
But how can this be done automatically when the user registers?
Could you help to get the buttons to style? I can add the btn class to others but not sure how to do it for the templated/macro'd submit buttons.
Any way I can stop that from happening? My app is running on port 5000, but it is proxied from the webserver at domain root port 80. In other words, when people click to confirm their email, they are sent to a non-working port (5000 isn't open to the public).
Where is this set? Thanks!!
The migrations table names do not match the model table names, which make the app unable to find the tables even after running the migrations
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.