Historical: HOW TO USE DJANGO-SQL-EXPLORER IN TENDENCI MMS

tendenci6megamenu.png

December 28, 2025
This wonderful insightful blog post about how to leverage the Django SQLExplorer on your Tendenci site was written back in 2015 when Tendenci v6 was released. What tendenci version is your site on? Yes, you can access the data you need with Tendenci’s SQL Explorer Data Analysis Tool right from your website! Read this blog to learn about it. -S.R.

February 7, 2015
Tendenci 6 ships with the excellent django-sql-explorer from ePantry. This means you can export anything at any time and build any report you want whenever you want. Absolute 100% anytime freedom of access to your data. #JOY #FREEDOM #ROCKS

First a warning. If you choose to use a direct query tool know they are dangerous. You are doing so at your own risk and could possibly corrupt your database beyond repair up to and including requiring a dba to come in and repair it at a cost of thousands of quid. So…. BE CAREFUL.

SQL explorer is a way to directly query your site through the user interface. It is for superusers only and we recommend disabling it by default (see disclaimer above.) But if you are still reading here is the lightning version.

  1. Login to your Tendenci6 site at /accounts/login/
  2. Navigate to /explorer/
  3. Click on playground and test out some queries. For example here are two
    1. “select tablename from pg_tables” – without the quotes to list all 300 tables in your database
    2. “select * from articles_article” – list all articles including expired and inactive etc.
  4. If you like the queries click “new query” and name and describe them and click save.
  5. Click on the SQL explorer icon top left and your back at the dashboard with icons to download the results of your queries.

Visually when you add the URL /explorer/ to the end of your site path you will see something very similar to this.

django-sql-query-dashboard.png

First note the icon on the right to Download CSV so you can download all of whatever that query is for.  If you don’t see any, no worries – that’s what this post is about!

So let’s write a basic sql statement.

django-sql-playground.png

And then when you click “New  Query” you will find this interface and you can carefully name and describe your query so you know what it does later.

creating-new-tendenci-query-for-csv-download.png

 

1) ALL Interactive users:

SELECT  u.first_name, u.last_name, u.email, u.username, u.is_staff,  u.is_superuser, p.salutation, p.company, p.position_title, p.phone,  p.address, p.address2, p.member_number, p.city, p.state, p.zipcode,  p.country, p.url, p.sex, p.address_type, p.phone2, p.fax, p.work_phone,  p.home_phone, p.mobile_phone, p.notes, p.admin_notes FROM auth_user u  INNER JOIN profiles_profile p ON u.id=p.user_id WHERE u.is_active=True  AND p.status=True AND p.status_detail='active'

Copy Paste Version:

SELECT u.first_name, u.last_name, u.email, u.username, u.is_staff, u.is_superuser, p.salutation, p.company, p.position_title, p.phone, p.address, p.address2, p.member_number, p.city, p.state, p.zipcode, p.country, p.url, p.sex, p.address_type, p.phone2, p.fax, p.work_phone, p.home_phone, p.mobile_phone, p.notes, p.admin_notes FROM auth_user u INNER JOIN profiles_profile p ON u.id=p.user_id WHERE u.is_active=True AND p.status=True AND p.status_detail=’active’

2) ALL memberships:

SELECT u.first_name, u.last_name, u.email, u.username, u.is_staff, u.is_superuser,
    p.salutation, p.company, p.position_title, p.phone, p.address, p.address2, 
    p.member_number, p.city, p.state, p.zipcode, p.country, p.url, p.sex, 
    p.address_type, p.phone2, p.fax, p.work_phone, p.home_phone, p.mobile_phone,
    m.membership_type_id, m.renewal, m.certifications, m.work_experience,
    m.referer_url, m.referral_source, m.join_dt, m.expire_dt, m.renew_dt,
    m.primary_practice, m.how_long_in_practice, m.application_approved,
    m.application_approved_dt, m.areas_of_expertise, m.home_state,
    m.year_left_native_country, m.network_sectors, m.networking,
    m.government_worker, m.government_agency, m.license_number,
    m.license_state, m.status_detail
FROM auth_user u
INNER JOIN profiles_profile p
ON u.id=p.user_id
INNER JOIN memberships_membershipdefault m
ON m.user_id=u.id
WHERE u.is_active=True
AND p.status=True
AND m.status_detail <> 'archive'

Copy Paste Version:

SELECT u.first_name, u.last_name, u.email, u.username, u.is_staff, u.is_superuser, p.salutation, p.company, p.position_title, p.phone, p.address, p.address2, p.member_number, p.city, p.state, p.zipcode, p.country, p.url, p.sex, p.address_type, p.phone2, p.fax, p.work_phone, p.home_phone, p.mobile_phone, m.membership_type_id, m.renewal, m.certifications, m.work_experience, m.referer_url, m.referral_source, m.join_dt, m.expire_dt, m.renew_dt, m.primary_practice, m.how_long_in_practice, m.application_approved, m.application_approved_dt, m.areas_of_expertise, m.home_state, m.year_left_native_country, m.network_sectors, m.networking, m.government_worker, m.government_agency, m.license_number, m.license_state, m.status_detail FROM auth_user u INNER JOIN profiles_profile p ON u.id=p.user_id INNER JOIN memberships_membershipdefault m ON m.user_id=u.id WHERE u.is_active=True AND p.status=True AND m.status_detail <> ‘archive’

3) ALL corporate members:

SELECT cp.name, cp.address, cp.address2, cp.city, cp.state, cp.zip, cp.country,
    cp.phone, cp.email, cp.url, cp.number_employees, cp.chapter, cp.tax_exempt,
    cp.annual_revenue, cp.annual_ad_expenditure, cp.description, cp.expectations,
    cp.notes, cp.referral_source, cp.ud1, cp.ud2, cp.ud3, cp.ud4, cp.ud5, cp.ud6, 
    cp.ud7, cp.ud8, cm.corporate_membership_type_id, cm.renewal, cm.renew_dt,
    cm.join_dt, cm.expiration_dt, cm.approved, cm.admin_notes, cm.status_detail
FROM corporate_memberships_corpprofile cp
INNER JOIN corporate_memberships_corpmembership cm
ON cp.id=cm.corp_profile_id
WHERE cm.status_detail <> 'archive'

Copy Paste Version:

SELECT cp.name, cp.address, cp.address2, cp.city, cp.state, cp.zip, cp.country, cp.phone, cp.email, cp.url, cp.number_employees, cp.chapter, cp.tax_exempt, cp.annual_revenue, cp.annual_ad_expenditure, cp.description, cp.expectations, cp.notes, cp.referral_source, cp.ud1, cp.ud2, cp.ud3, cp.ud4, cp.ud5, cp.ud6, cp.ud7, cp.ud8, cm.corporate_membership_type_id, cm.renewal, cm.renew_dt, cm.join_dt, cm.expiration_dt, cm.approved, cm.admin_notes, cm.status_detail FROM corporate_memberships_corpprofile cp INNER JOIN corporate_memberships_corpmembership cm ON cp.id=cm.corp_profile_id WHERE cm.status_detail <> ‘archive’

4) All users in a specific group (replace <YOUR GROUP ID> with your group id)

SELECT ug.name, u.first_name, u.last_name, u.email, u.username, u.is_staff, u.is_superuser, p.salutation, p.company, p.position_title, p.phone, p.address, p.address2, p.member_number, p.city, p.state, p.zipcode, p.country, p.url, p.sex, p.address_type, p.phone2, p.fax, p.work_phone, p.home_phone, p.mobile_phone FROM auth_user u INNER JOIN profiles_profile p ON u.id=p.user_id INNER JOIN user_groups_groupmembership ugm on u.id=ugm.member_id INNER JOIN user_groups_group ug on ug.id=ugm.group_id WHERE ug.id=<YOUR GROUP ID> AND ugm.status=True AND ugm.status_detail='active'

Copy Paste Version:

SELECT ug.name, u.first_name, u.last_name, u.email, u.username, u.is_staff, u.is_superuser, p.salutation, p.company, p.position_title, p.phone, p.address, p.address2, p.member_number, p.city, p.state, p.zipcode, p.country, p.url, p.sex, p.address_type, p.phone2, p.fax, p.work_phone, p.home_phone, p.mobile_phone FROM auth_user u INNER JOIN profiles_profile p ON u.id=p.user_id INNER JOIN user_groups_groupmembership ugm on u.id=ugm.member_id INNER JOIN user_groups_group ug on ug.id=ugm.group_id WHERE ug.id=<YOUR GROUP ID> AND ugm.status=True AND ugm.status_detail=’active’

 

Contribute back your brilliance to the rest of us? Have you written some good queries for Tendenci using the amazing  django-sql-explorer from ePantry? Post them on the Tendenci Community Site for others to learn and share with!

Please do be careful. Remember the warnings above. Using a live sql tool on a relational database for anything besides SELECT queries is ill-advised. It really is your live data on a live site SO BE CAREFUL!

We believe this level of access to the superusers on Tendenci sites is empowering. We like knowing people can download any of their data when they need it. And perhaps contribute back some suggested new reports to the Tendenci Community as a whole!

Because Tendenci is part of the Django community and we couldn’t have brought this functionality to you without others in the community “giving first.” We may have added it to Tendenci, but that’s ONLY because of the generosity of building and making it available by others. Explorer is brought to you by the power of collaborative open source software (THANK YOU ePantry!)

Note this is a cross post from our help files. See the Help File for the latest accurate info at: https://www.tendenci.com/help-files/how-use-django-sql-explorer-tendenci/

Six Reasons to Switch Your Proprietary Software and LOVE the Open Source with Tendenci AMS

Tendenci is a gift to the world. And during this month of love, we want to share with you six reasons why you should switch your proprietary software and LOVE the open source with Tendenci AMS.

Open Source wins over closed proprietary softwares. Check out our list of closed source alternatives to Tendenci.

Adobe Stock Image File:279876642
Love Open Source Software with Tendenci AMS
#https://stock.adobe.com/images/heart-shape-made-of-binary-numbers-tech-love-concept-vector-illustration-eps-10/279876642?prev_url=detail


You have a lot of options when choosing an MMS or AMS. But if you need to scale to support hundreds of thousands of members, have recurring individual and corporate level memberships, and need the full features of a seasoned large scale enterprise AMS, it’s possible you might hit some limits with the new kids on the block.

Proprietary vendors are companies first and communities second. Tendenci is a community first, and though there is a small company behind it, with the support of the Open Source community, Tendenci software has grown far bigger than we ever expected. And given it started in 2001, when you switch from a proprietary solution, it’s an upgrade!

Open Source is the voice of the people – a shared language that brings everyone together.

Think Free In Terms of Freedom with Tendenci AMS

  1. Free Software, Free Society – In the selected essays of Richard M. Stallman Second Edition ‘Four Freedoms’ he wrote “A program is ‘free software’ if the program’s users have the four essential freedoms:
  • The freedom to run the program as you wish, for any purpose.
  • The freedom to study how the program works, and change it so it does your computing as you wish. Access to the source code is a precondition for this.
  • The freedom to redistribute copies so you can help your neighbor.
  • The freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
  1. Tendenci Software Means Greater Functionality and Usability on a Global Scale – Tendenci is a very large project with robust functionality. But it’s still a great low-cost AMS solution for small Associations too! You can easily disable modules you don’t need and keep it simple. Functionality will be there as YOUR small association needs to expand in the future! Freedom is actually pretty cool. Pay less with Tendenci and get greater functionality. 

Note: Tendenci AMS, as measured by an independent third party ranking firm, is the only top 5 AMS on the market that is Open Source on a global scale. We are people who understand the power of associations. And the importance of freedom from centralized platforms and the tyranny of regimes limiting access for all. 

  1. Tendenci Is Community First – Open-source is in line with our core values at Tendenci. Our mission is to Connect and Organize the World’s People. Do good. We are change makers who understand the power of associations, which is why we built a software to help NPOs anywhere with any budget to further their cause both nationally and internationally.
  1. Freedom to Choose With Tendenci AMS – Looking to make real changes in the world? Host your site and your data on your own server if needed. We dig that! Tendenci, however, is not just for hosting websites. Tendenci is an investment that results in a financial gain to our clients. And while you can certainly host with us, you don’t have to. It’s okay to support local open source developers in your own country and community as well. Or even get started with our Tendenci AMI and grow!  
  1. Freedom to Customize Tendenci To YOUR Associations Needs – You have innumerable ways to customize Tendenci. Association Management Software is complex because associations are complex! So if you are looking to make some minor changes, do it! Looking to write an entire app specific to your organization that integrates with Tendenci? We love it!

Tendenci scales  to support large national and international organizations with multiple chapters, who may also benefit from a custom server configuration. 

Need even further customization for your organization’s unique needs? You can fork Tendenci AMS on GitHub at https://github.com/tendenci/tendenci/. Every Tendenci site lets you pull down and customize existing templates as well. You can try that out on our free Demo site.

  1. Tendenci Is Accessible To The World – Languages, languages, languages! Translation and localization of your AMS is possible because the community uses the amazing Django Project web framework and thanks to the people at Transifex who support open source. The world is anxious for growth and because your organization needs to communicate with different constituents in the language of their choice, Tendenci  allows each individual user to specify the language of their choice. 
Disruptive Technology Adobe Stock Image File#242937992 
Love Open Source Software with Tendenci AMS
https://stock.adobe.com/images/disruptive-technology/242937992?prev_url=detailDisruptive Technology and Science Engineering in Robotics

Lastly, our CEO Ed Schipul has attended enough board meetings to understand your organization is likely made up of volunteers and the rules for nonprofits are different. Tendenci – The Open Source AMS software is a relationship marketing application that fully meets the needs of large organizations. Have any doubts and concerns? Contact us today. We are here to serve you. Join us

We want to say THANK YOU to all of the developers out there who are contributing, translating, updating and maintaining a very complex piece of software. Tendenci AMS software is inclusive of other languages and cultures, and run by a team that believes in security and privacy. We love and very much dearly appreciate you all. Let’s continue to do good today, and tomorrow even more, together. 

Remember, all of the code is on githubdocumentation is on readthedocs, and translation is crowd-sourced on Transifex. Self-host or host with us – your choice, your data, your association.

Give us a call, let’s talk at (281) 497-6567 or visit us at www.tendenci.com 

Much open love always,

Team Tendenci
<p>heart</p>

Tendenci Puppy Logo
www.tendenci.com/open-source

The EU GDPR – the General Data Protection Regulation

Control your AMS with Open Source

RSA Conference in San Francisco
GDPR as seen by a vid from the RSA Conference

The European Union’s General Data Protection Regulation starts May 25, 2018. This is mostly an FYI as Tendenci “the Company” does not engage in cross site monitoring. It creeps us out a bit.

Yet while Tendenci does not do cross site tracking or individual tracking, it is possible that YOUR site does if you are using Google Analytics, DoubleClick or any number of third party add-ons and plugins.

It is up to YOU to reauthorize and comply with the data protection policies associated with third party add-ons on your site.

What DOES Tendenci do that might allow you to make a mistake in GDPR compliance?

If used as designed, it would be hard to become out of compliance as every site is in an isolated database and container. Yet there are security functions that log activity on your Tendenci site, that if you were to use it for tracking with AI or sell your data, it could potentially be against the GDPRs regulations. Talk to your attorney about this.

For example PCI best practices require dual logging and analysis of the logs for security reasons. There is no direct identifying data in web logs, but they would obviously include things like the IP address to block DDoS attacks.

These logs are never sold or accessed by anyone but our security team to trouble shoot the application and provide feedback to the administrators. Remember, you have the same user interface and front end functionality that our team does if you host with us. Zero difference. And the logs do not contain any identifying information such as an email or name.

We are NOT lawyers, Thus it is up to YOU to determine how you manage your data. We do not, nor have we ever, sold client data to third parties.

 

Why Tendenci Chose Python over PHP

Note: this is a repost from the eschipul.com blog and also lives as a help file on Tendenci.

This blog is a WordPress blog written in PHP. And WordPress, which is written in PHP is a great platform when secured properly.

So why did our team choose to rewrite Tendenci Open Source and in the Python Programming language? It is a question I get asked a lot. We’ve never been a company that likes to talk in the negative if at all possible, yet it is important to talk about the megatrends going on given we work with associations and nonprofits.

Python Growing in Academia
Why Python instead of PHP for Tendenci

Source: https://www.upguard.com/blog/which-web-programming-language-is-the-most-secure

programming vulnerabilities
Vulnerabilities in each language

Source: http://info.whitehatsec.com/rs/whitehatsecurity/images/statsreport2014-20140410.pdf

security-report

Source: http://info.whitehatsec.com/rs/whitehatsecurity/images/statsreport2014-20140410.pdf

Popularity of a language is a trend, and what you want is as many developers familiar and liking the language of your open source project as possible. This means you have a better chance to have a secure web site and therefore a more secure future.

To be fair – as Disraeli said – “lies, damn lies and statistics” – so there is no one perfectly secure language any more than there is a perfectly “safe” hammer. There will always be operator error and programmers make mistakes.

So we’re not saying Python is perfect, and all of us have used most of the other languages on those charts at some point. We’re just saying we are pleased so many other programmers also like Python and Open Source. THAT is the best that can be done to secure your future online. Secure code that you can examine yourself and even host yourself!

Addendum: As I post this on the Tendenci Blog. Given we focus on non-profits, associations, memberships, education, medical, religious – basically the do-good cause-based organizations, I believe it is particularly important that the project is as transparent as possible. Sometimes it is healthy to inform everyone of WHY we made a decision seven years ago. Python was the right call.

blog.tendenci.com