An Amazing Boilerplate for your next SaaS item, written in Django

While building our past item, it was needed to compose a backend to deal with standard SaaS elements like clients, memberships, plans, accounts, and so forth. Since we shut down, we chose to open source the SaaS backend for anybody to utilize.

An Amazing Boilerplate for your next SaaS item, written in Django

This article makes sense of the information base composition for any conventional djangosaas boilerplate and the codebase for regular APIs, for example,

  • Login
  • Information exchange
  • Reset Password
  • Data about a welcomed client to pre-fill information exchange structure
  • Welcome colleague
  • Me

Data set models for SaaS.

To monitor every one of the different enrolled organizations and the plans that those organizations are bought into, we want a blueprint that seems to be this.

Each enrolled business could likewise have various clients utilizing that record.

Initially utilized this composition to fabricate a portable application meeting recording device we needed to sell as a SaaS and planned our construction along these lines.


To store data about the various types of plans that the SaaS offers. It would help if you offered a free arrangement with limited capacities and at least one paid plan with extra usefulness.

Past this, this model could have more fields contingent on the utilization case. With regards to Session Fox, we offered plans given the number of meeting accounts and number of utilizations, so the extra fields in the Plan model for Session Fox were

  • Max accounts
  • Max applications


Addresses an arrangement membership by a business. It will like this contains a reference to the business and plan. It can be utilized to check if an active membership is present for a given business and, assuming this is the case, which plans the business bought into.

It can likewise be utilized to recharge, overhaul or deactivate a membership given the arrangement span expiry, notable credits for a specific business, and so on.

Begin time and End time address one pattern of an arrangement. For example, if an arrangement spans 15 days, and the membership started on the fifteenth of August, begin time would be the fifteenth of August, and the end time would be the thirtieth of August.

An occasional undertaking will recover all memberships where the end time has elapsed. Given the bought-in plan, this errand will choose whether to recharge the arrangement or deactivate the membership. For running occasional undertakings, we use a time loop.

New Businesses Sign-up

When another business joins, a membership is naturally made with an accessible arrangement. Since most of the new information exchanges were beta clients, we wanted a method for updating those clients to a limitless arrangement. To do this, we made a passage in the arrangement model called limitless arrangement where max accounts and max applications was a vast number and changed their relating membership model section to reference the limitless arrangement.

You can likewise utilize this model to store data that resets when another arrangement cycle begins. For example, once the business reached the maximum recording limit in Session Fox, we needed to keep any other accounts from that business. So we kept a field called current keep included in this model. This field is increased at whatever point another meeting recording is made. When it arrives at the highest furthest reaches of the comparing plan, the recording API will return a reaction suitably.

Since we were running an occasional errand to refresh the membership's beginning time and end season, we utilized a similar undertaking to reset the momentum recording count so that the following arrangement cycle begins from nothing.


Any extra fields that are well defined for a business can be placed in this model. For the client to call the APIs, an API_KEY would be given, and this field can be set in the action plan.

Business Team Member

Since we have all models expected to follow SaaS memberships for a business, we want a model to monitor every one of the clients that are getting to the item. These clients could be

  • Different colleagues from a similar business
  • Bots

Whether or not the client is a bot or a colleague from the business, we want a method for characterizing what consents a specific client will group. Regarding API calls should be made to the server by the SDK and the dashboard. To do this, the SDK would be given an entrance token, yet this entrance token shouldn't group consent to get to the dashboard APIs.

Django makes things more straightforward; this is the way

  • Joined with Django-rest-system, API creation turns out to be exceptionally unimportant
  • Simple to oversee verification and consents utilizing auth token.

The above information base models can be converted into Django models like this.

Overseeing clients and consent

The Business Team Member model addresses a solitary client. Anyway, there is a compelling reason to expressly fields for username and secret phrase. Instead, we can utilize Django clients. This Model given by Django abstracts the client confirmation framework, and it naturally stores passwords as hashes. The client can likewise be enacted or deactivated by utilizing the dynamic field. Thus the Business Team Member model can essentially contain a foreign key to the Django client model.


Utilizing the Django rest structure, each Django client made in the framework can be relegated an entrance token. Assuming this entrance token is available in the header of an API call, Django-rest-system naturally questions the client to which this token has a place and connects it to the API demand.

Check the comment section below for additional information, share what you know, or ask a question about this article by leaving a comment below. And, to quickly find answers to your questions, use our search Search engine.

Note: Some of the information in samples on this website may have been impersonated or spoofed.

Bookmark articleSave

Was this article helpful?

Comments, Questions, Answers, or Reviews

There are no comments as yet, please leave one below or revisit.

To protect your privacy, please remove sensitive or identifiable information from your comments, questions, or reviews. We will use your IP address to display your approximate location to other users when you make a post. That location is not enough to find you.

Your post will be set as anonymous because you are not signed in. An anonymous post cannot be edited or deleted, therefore, review it carefully before posting. Sign-in.

Write Your Comment, Question, Answer, or Review

Online Threat Alerts Security Tips

Pay the safest way

Credit cards are the safest way to pay for online purchases because you can dispute the charges if you never get the goods or services or if the offer was misrepresented. Federal law limits your liability to $50 if someone makes unauthorized charges to your account, and most credit card issuers will remove them completely if you report the problem promptly.

Guard your personal information

In any transaction you conduct, make sure to check with your state or local consumer protection agency and the Better Business Bureau (BBB) to see if the seller, charity, company, or organization is credible. Be especially wary if the entity is unfamiliar to you. Always call the number found on a website’s contact information to make sure the number legitimately belongs to the entity you are dealing with.

Be careful of the information you share

Never give out your codes, passwords or personal information, unless you are sure of who you're dealing with

Know who you’re dealing with

Crooks pretending to be from companies you do business with may call or send an email, claiming they need to verify your personal information. Don’t provide your credit card or bank account number unless you are actually paying for something and know who you are sending payment to. Your social security number should not be necessary unless you are applying for credit. Be especially suspicious if someone claiming to be from a company with whom you have an account asks for information that the business already has.

Check your accounts

Regularly check your account transactions and report any suspicious or unauthorised transactions.

Don’t believe promises of easy money

If someone claims that you can earn money with little or no work, get a loan or credit card even if you have bad credit, or make money on an investment with little or no risk, it’s probably a scam. Oftentimes, offers that seem too good to be true, actually are too good to be true.

Do not open email from people you don’t know

If you are unsure whether an email you received is legitimate, try contacting the sender directly via other means. Do not click on any links in an email unless you are sure it is safe.

Think before you click

If an email or text message looks suspicious, don’t open any attachments or click on the links.

Verify urgent requests or unsolicited emails, messages or phone calls before you respond

If you receive a message or a phone call asking for immediate action and don't know the sender, it could be a phishing message.

Be careful with links and new website addresses

Malicious website addresses may appear almost identical to legitimate sites. Scammers often use a slight variation in spelling or logo to lure you. Malicious links can also come from friends whose email has unknowingly been compromised, so be careful.

Secure your personal information

Before providing any personal information, such as your date of birth, Social Security number, account numbers, and passwords, be sure the website is secure.

Stay informed on the latest cyber threats

Keep yourself up to date on current scams by visiting this website daily.

Use Strong Passwords

Strong passwords are critical to online security.

Keep your software up to date and maintain preventative software programs

Keep all of your software applications up to date on your computers and mobile devices. Install software that provides antivirus, firewall, and email filter services.

Update the operating systems on your electronic devices

Make sure your operating systems (OSs) and applications are up to date on all of your electronic devices. Older and unpatched versions of OSs and software are the target of many hacks. Read the CISA security tip on Understanding Patches and Software Updates for more information.

What if You Got Scammed?

Stop Contact With The Scammer

Hang up the phone. Do not reply to emails, messages, or letters that the scammer sends. Do not make any more payments to the scammer. Beware of additional scammers who may contact you claiming they can help you get your lost money back.

Secure Your Finances

  • Report potentially compromised bank account, credit or debit card information to your financial institution(s) immediately. They may be able to cancel or reverse fraudulent transactions.
  • Notify the three major credit bureaus. They can add a fraud alert to warn potential credit grantors that you may be a victim of identity theft. You may also want to consider placing a free security freeze on your credit report. Doing so prevents lenders and others from accessing your credit report entirely, which will prevent them from extending credit:

Check Your Computer

If your computer was accessed or otherwise affected by a scam, check to make sure that your anti-virus is up-to-date and running and that your system is free of malware and keylogging software. You may also need to seek the help of a computer repair company. Consider utilizing the Better Business Bureau’s website to find a reputable company.

Change Your Account Passwords

Update your bank, credit card, social media, and email account passwords to try to limit further unauthorized access. Make sure to choose strong passwords when changing account passwords.

Report The Scam

Reporting helps protect others. While agencies can’t always track down perpetrators of crimes against scammers, they can utilize the information gathered to record patterns of abuse which may lead to action being taken against a company or industry.

Report your issue to the following agencies based on the nature of the scam:

  • Local Law Enforcement: Consumers are encouraged to report scams to their local police department or sheriff’s office, especially if you lost money or property or had your identity compromised.
  • Federal Trade Commission: Contact the Federal Trade Commission (FTC) at 1-877-FTC-HELP (1-877-382-4357) or use the Online Complaint Assistant to report various types of fraud, including counterfeit checks, lottery or sweepstakes scams, and more.
  • If someone is using your personal information, like your Social Security, credit card, or bank account number, to open new accounts, make purchases, or get a tax refund, report it at This federal government site will also help you create your Identity Theft Report and a personal recovery plan based on your situation. Questions can be directed to 877-ID THEFT.

How To Recognize a Phishing Scam

Scammers use email or text messages to try to steal your passwords, account numbers, or Social Security numbers. If they get that information, they could get access to your email, bank, or other accounts. Or they could sell your information to other scammers. Scammers launch thousands of phishing attacks like these every day — and they’re often successful.

Scammers often update their tactics to keep up with the latest news or trends, but here are some common tactics used in phishing emails or text messages:

Phishing emails and text messages often tell a story to trick you into clicking on a link or opening an attachment. You might get an unexpected email or text message that looks like it’s from a company you know or trust, like a bank or a credit card or utility company. Or maybe it’s from an online payment website or app. The message could be from a scammer, who might

  • say they’ve noticed some suspicious activity or log-in attempts — they haven’t
  • claim there’s a problem with your account or your payment information — there isn’t
  • say you need to confirm some personal or financial information — you don’t
  • include an invoice you don’t recognize — it’s fake
  • want you to click on a link to make a payment — but the link has malware
  • say you’re eligible to register for a government refund — it’s a scam
  • offer a coupon for free stuff — it’s not real

About Online Threat Alerts (OTA)

Online Threat Alerts or OTA is an anti-cybercrime community that started in 2012. OTA alerts the public to cyber crimes and other web threats.

By alerting the public, we have prevented a lot of online users from getting scammed or becoming victims of cybercrimes.

With the ever-increasing number of people going online, it important to have a community like OTA that continuously alerts or protects those same people from cyber-criminals, scammers and hackers, who are every day finding new ways of carrying out their malicious activities.

Online users can help by reporting suspicious or malicious messages or websites to OTA. And, if they want to determine if a message or website is a threat or scam, they can use OTA's search engine to search for the website or parts of the message for information.

Help maintain Online Threat Alerts (OTA).

An Amazing Boilerplate for your next SaaS item, written in Django