User Authentication in Pyramid

Pyramid has a much more flexible authentication system. And yes, if you want something simple like Django’s user/group/permission concept, then flexible might be scary. Pyramid does not have a “User” object, as it makes no assumptions about how you store your data or what ORM you use, therefore there isn’t something for you like contrib.auth. … Read more

ArgumentError: relationship expects a class or mapper argument

not happy with myself since it’s such a dumb mistake but here is my culprit: report_type = relationship(‘tReportType’, uselist=False, backref=backref(‘report’)) should be: report_type = relationship(‘TReportType’, uselist=False, backref=backref(‘report’)) capital T instead of t, I should be referencing the class, not my actual table name: ‘tReportType’ -> ‘TReportType’

Make sure only one worker launches the apscheduler event in a pyramid web app running multiple workers

Because Gunicorn is starting with 8 workers (in your example), this forks the app 8 times into 8 processes. These 8 processes are forked from the Master process, which monitors each of their status & has the ability to add/remove workers. Each process gets a copy of your APScheduler object, which initially is an exact … Read more

Should I use Pylons or Pyramid?

Pylons isn’t being “cancelled”, and it will continue to receive updates. That said, the “future” per se is in Pyramid. On the mailing list is has been referred to as Pylons 2.0. It is fully tested and better documented than Pylons 1.0, so you might as well jump aboard if you’re fresh. Pyramid is essentially … Read more

SQLAlchemy – Getting a list of tables

All of the tables are collected in the tables attribute of the SQLAlchemy MetaData object. To get a list of the names of those tables: >>> metadata.tables.keys() [‘posts’, ‘comments’, ‘users’] If you’re using the declarative extension, then you probably aren’t managing the metadata yourself. Fortunately, the metadata is still present on the baseclass, >>> Base … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)