Jump to content

geojoe

Members
  • Posts

    21
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by geojoe

  1. Hi rik,

     

    I had a similar issue a while back and have I just found the solution 20 mins from the time of this post (I can be very persistent when it comes to problem solving)

     

    just add this at the top of your app.py file 

    class ScriptNameStripper(Flask):
        def __call__(self, environ, start_response):
            environ['SCRIPT_NAME'] = ''
            return (super(ScriptNameStripper, self)
                    .__call__(environ, start_response))
                    
    app = ScriptNameStripper(__name__) 

    you'll have to replace app = Flask(__name__) with app = ScriptNameStripper(__name__)

  2. Hi @RootAdmin I've done it 

     

    I had sequence fields created and it turns out that postgres sequences needed special privileges to work, the problem arose when i try an insert operation; it gave the following error

    Error in query: ERROR: permission denied for sequence users_user_id_seq
    

    so i did a little research and was able to fix it

     

    here's how i did it in case someone else has the same issue:

     

    • I opened phppgadmin
    • logged in
    • clicked on schema
    • selected my schema (i used the default public schema)
    • selected sequences 
    • clicked on privileges 
    • checked SELECT, UPDATE, DELETE for my user

     

    and evoila it worked perfectly 

     

    thanks your service - although free - is one of the best I've ever gotten 

  3. Thanks for the reply.

    Yes I would like access from any ip address.

    The right way to connect to postgres through flask is as follows

    Postgres+psycopg2://db_username:db_password@db_host:5432/db_name

    In my case that would be

     

    Postgres+psycopg2://geojoe_geoffery:donsniper123@localhost:5432/geojoe_flask

     

    But it doesn't seem to work I think I may not have the right permissions to read from or write to the database, if it works I would be very grateful otherwise I might have to settle for the one from heroku

  4. Hi again,

    I need help connecting my flask app to the postgres database on the server.

    PS. I'm not trying to connect from outside although having remote access would be a bonus 

     

    username: geojoe

    database: geojoe_flask-app

    database user: geojoe_admin

    server: Tommy

     

     

    Issue 2: how do I hide the flask.wsgi from urls

    e.g instead of flask.geoffery.ml/flask.wsgi/login, i want it to be   flask.geoffery.ml/login

     

    thanks in anticipation

  5. Hi I've been on tommy server for about a month and some parts of the interface is still loading.

    Like where it says primary domain and theme, also some info about the account that's supposed to be under the right section of the main interface is missing

    is this normal or should i be worried.

     

    attached is a screen shot of the said interface 

    post-182349-0-96094200-1579831389_thumb.png

  6. Hi good day,

     

    I am current learning the flask micro framework and have built a relatively small app.

    said app runs well on my local machine but returns 500 error when uploaded to the server, attached are my details.

     

    any help will be highly appreciated.

     

     

    server tommy (I got lucky)

    username geojoe

    website: flask.geoffery.ml

     

    P.S. my app require some extra flask packages 

    a list of which can be found in requirements.txt

×
×
  • Create New...