Tendenci Exports – Plus Easy Ways to Make Static Copies of Your Site

Today’s Tendenci community knowledge share. Here are three very easy free or low cost methods of making a static copy a web site. Use with caution, just know you have the power.

On Windows you can use HTTrack https://www.httrack.com/

HTTrack_Website_Copier_-_Free_Software_Offline_Browser__GNU_GPL_
Download a static version of a web site to your PC

On a Mac computer you can use sitesucker ($5) http://ricks-apps.com/osx/sitesucker/index.html

SiteSucker to download a static site to your Mac Computer
SiteSucker to download a static site to your Mac Computer

On the go? You can also use sitesucker from the app store to download to your iphone or ipad for $2 http://ricks-apps.com/ios/sitesucker/index.html

Use IOS to download your site for $2
Use IOS to download your site for $2

Of course for structured data in Tendenci, there are TONS of ways to export including exporting a copy of your entire database. There are help files on common exports like How to export your membership . There are too many options to list them all, but I’d encourage you to visit the support center or just google “tendenci exports” for more.

If you are on version 5 and want to “kick the tires” on Tendenci version 7, use https://demo.tendenci.com – you can login here https://demo.tendenci.com/accounts/login/ using “admin/admin” or “user/user”. It does reset every hour or so because of spammers but you can still get a feel for it. A HUGE upgrade from version 5.

Tendenci Admin Default Dashboard
Tendenci Admin Default Dashboard

There is also a previous post on making a static copy of your site here that is a bit more technical as well.

Why do we point out all of the ways to copy your Tendenci site (or most sites really)? Doesn’t that make it easier to leave?

Yes. Yes it does. BUT people rarely leave. Or if they do, they typically stay on Tendenci and self host. They’re still part of the Tendenci community which helps us all.

Another reason we promote exports and offsite backups is because we know the more freedom you have, realizing you have that freedom especially on the Tendenci open source platform, makes it less likely for clients to leave.

Think about it. Why would anyone who actually understands their product is open, does far more than other options, is lower cost, and they can self host if they want… why would that person make the decision to leave? It’s illogical.

I mean, who wants to be the President of an Association that takes it backwards in time to proprietary technology or an older open source software built on an unpopular programming language? That’s not in the best interests of the association long term.

Tendenci is written in Python and uses Java and Javascript libraries. This linked chart says it all.

programming-popularity-2016
THE 8 MOST IN-DEMAND PROGRAMMING LANGUAGES OF 2016

Popular programming languages means more coders for open source projects written in that language. And more capable people to modify and customize your install if you choose.

One of our goals is FREEDOM from the tyranny of per-user-licensing, proprietary products that want to own YOUR DATA, long term contracts, sites that post your events on THEIR site so if you leave then the history of that event is gone in the blink of an eye. Companies don’t own your data and they shouldn’t trap you.

We think that is unethical and just wrong.

Membership Management Software should be Open Source, Accessible, Responsive, and Search Engine friendly by default. Tendenci does all of those things.

Further we believe that Open Source Membership Management Software should be written in a Modern Programming Language like Python (watch out for bunnies) and the software should documented and open source (free, as in beer.) Even the US Government likes Open Source!

Want to change something? Get involved! Post on the forums at https://ww.tendenci.com/forums or post an issue at https://github.com/tendenci/tendenci/issues . If you are a programmer or into documentation, submit a pull request.

We make it easy to leave because we hope you don’t. Hence Tendenci has an incredibly low churn rate. That creates stability you can count on.

#peace

HOW TO USE DJANGO-SQL-EXPLORER IN TENDENCI MMS

tendenci6megamenu.png

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/