Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django session-timeout page refresh
I'm using a package for my Django project that after a certain amount of time logs out the user. The package works perfectly save for one thing, when it timesout, the page is not refreshed. So what this does is change the url path back to the login page and only when I try to navigate to a further link it brings me back to the login. This is a problem because I don't want the sensitive information open for someone to look at until they try to navigate from that page. Can I refresh the page in this middleware so it kicks the user back to login immediately? if session_is_expired: request.session.flush() redirect_url = getattr(settings, "SESSION_TIMEOUT_REDIRECT", None) if redirect_url: return redirect(redirect_url) else: return redirect_to_login(next=request.path) -
Django cannot find one template out three - strange behavior
I am currently going through the Django tutorial and when I tried to run the webserver at the middle of part 4 I stumbled accross this error: TemplateDoesNotExist at /polls/2/ The strange thing is that the other two file work fine, just not the detail.html (see screenshots) I checked the spelling over and over as well als polls/view.py and polls/url.py - but I have no clue as to origin of this seemingly erratic behavior. I also the polls/pycache content after reading about that in another post. Nothing. And btw, the same behavior occurs on my local machine as well as on pythonanywhere.com What did I do wrong? Thanks. Oh, is there anything you need like the views.py, urls.py ...? -
How to use Datatables Scroller in Angular
I'm using the server-side Datatables to get a large amount of data from the Django RestAPI (+500,000 rows) to Angular. When I set a limit to 1000 rows, everything works perfectly but when I remove the limit nothing is shown on the screen. Here's what I've tried: Admin.component.ts ngOnInit(): void { this.dtOptions = { pagingType: 'full_numbers', pageLength: 10, deferRender: true }; this.http.get<any>(this.Authservice.getApiUrl() + 'societes/list/?page=') .subscribe(persons => { this.persons = persons; console.log("Persons == ", this.persons); this.dtTrigger.next(); }); } And here's my views.py @api_view(['GET','POST','DELETE']) def list_societes(request): if request.method == 'GET': societes = Societe.objects.all().order_by('-id') try: page = int(request.GET.get('page')) except Exception: page = 1 societes_data = SocieteSerialize(societes.all(), many=True) return Response(societes_data.data, status.HTTP_200_OK) From what I've searched online, I found that I need to use the Datatables Scroller, but I didn't find a clear documentation for Angular. -
JavaScript set a form fields initial value, to the same value of another field?
I am trying to handle some JavaScript work, which i don't have much experience with. I have a 2 part form where a user enters their personal info, and then company info. I am trying to set some of the company fields to what they already entered in their personal info. I don't want the user to have to retype address, email, etc. for example I have... <div class="form-group"> <label for="email">Email<span>*</span></label> <input name="email" type="text" class="form-control required" id="email"placeholder="Email" value=". {{email}}"> <span id="span_email" class="error-msg"></span> And... <div class="form-group"> <label for="comp_email">Company Email<span>*</span></label> <input name="comp_email" type="text" class="form-control required" id="comp_email"placeholder="Email" value="{{comp_email}}"> <span id="span_email" class="error-msg"></span> How would I be able to set that second comp_email field to initially have the email info, so the user doesn't have to retype, unless they actually wanted to change the comp_email to another email address? EDIT It is all in one form, just separated by div's. Initially when the page is loaded, the account section div is displayed, when the user hits next, it triggers the display of the business info. <input type="button" onclick="nextFormPage(); window.scrollTo(0, 100)" class="btn btn-danger btn-block" value="Next"> The nextFormPage() function just hides the first div, and displays the second div. -
How to update relation field in override save
How to update relation OneToOneField field in override save update working in object.create() but not working in .save() def save(self, *args, **kwargs): self.wallet.wallet_inventory = 50 self.wallet.save() super(MonthlyBuyerOrder, self).save(*args, **kwargs) custom save function also does not work -
Make change to selected object in many to many fields
I have a Order model and item model with many to many relationship, but I just want to make change to selected items for each Order, How can I do that? As when I get order.items.all will affect all the items in the Order. Model.py: class OrderItem(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True) item = models.ForeignKey(Product, on_delete=models.CASCADE) quantity = models.IntegerField(default=1) ordered = models.BooleanField(default=False) being_delivered = models.BooleanField(default=False) being_delivered_date = models.DateTimeField(null=True) Received = models.BooleanField(default=False) Received_date = models.DateTimeField(null=True) def __str__(self): return f"{self.quantity} of {self.item.product_name}" class Order(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True) items = models.ManyToManyField(OrderItem) ordered = models.BooleanField(default=False) being_delivered = models.BooleanField(default=False) being_delivered_date = models.DateTimeField(null=True) Received = models.BooleanField(default=False) Received_date = models.DateTimeField(null=True) def __str__(self): return self.user.username Views.py def update_to_recevied(request, id): order_item = get_object_or_404(OrderItem, id=id) order_item.Received = True order_item.Received_date = timezone.now() order_item.save() return redirect(...) html: {% for item in order.items.all %} <a href="{% url 'update_to_recevied' id=item.id %}" class="btn btn-primary mb-1">Received<br><span>{{ item.item.product_name }}</span></a> {% endfor %} -
How to implement a DDos protection page in Python
I am wondering on how to implement a DDos protection page using Python and exactly Django 3.0 Framework, if anyone has any solutions please let me know on how at least i can restrict all pages or use a middle-ware just like in Laravel PHP. -
Apache - Error 403 Forbidden when deploying Django app
I am trying to deploy my Django application in Apache but it is impossible. When I enter the url it says 403 Forbidden and nothing happens. I have tried watching many tutorials but have not been able to fix my error. I'm using CentOS 7. This is my site.com.conf => /usr/local/apache/conf.d/vhost/myproject.com.conf <VirtualHost myprojectIP:8181> ServerName myproject.com ServerAlias www.myproject.com ServerAdmin myproject@myproject.com DocumentRoot /var/www/html/myproject UseCanonicalName Off ScriptAlias /cgi-bin/ /home/admin/public_html/cgi-bin/ <IfModule mod_setenvif.c> SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on </IfModule> <IfModule mod_userdir.c> UserDir disabled UserDir enabled admin </IfModule> <IfModule mod_suexec.c> SuexecUserGroup admin admin </IfModule> <IfModule mod_suphp.c> suPHP_UserGroup admin admin suPHP_ConfigPath /home/admin </IfModule> <IfModule mod_ruid2.c> RMode config RUidGid admin admin </IfModule> <IfModule itk.c> AssignUserID admin admin </IfModule> <Directory /var/www/html/myproject> Options -Indexes -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch SSLRequireSSL </Directory> <Directory /var/www/html/venv> Require all granted </Directory> Alias /static /var/www/html/myproject/templates/static <Directory /home/admin/public_html/myproject/templates/static> Require all granted </Directory> WSGIProcessGroup remesas WSGIScriptAlias / /var/www/html/myproject/remesas/wsgi.py </VirtualHost> This is my site.com.ssl.conf => /usr/local/apache/conf.d/vhost/myproject.com.ssl.conf <VirtualHost myprojectIP:8443> ServerName myproject.com ServerAlias www.myproject.com ServerAdmin myproject@myproject.com DocumentRoot /var/www/html/myproject UseCanonicalName Off ScriptAlias /cgi-bin/ /home/admin/public_html/cgi-bin/ #SSL CONFIGURE HERE #################### <IfModule mod_userdir.c> UserDir disabled UserDir enabled admin </IfModule> <IfModule mod_suexec.c> SuexecUserGroup admin admin </IfModule> <IfModule mod_suphp.c> suPHP_UserGroup admin admin suPHP_ConfigPath /home/admin </IfModule> <IfModule mod_ruid2.c> RMode config RUidGid admin admin </IfModule> <IfModule itk.c> AssignUserID admin … -
failing to install mysqlclient on python 3.7.9
I have python 3.7.9 and I am trying to install mysqlclient package if I give "pip install mysqlclient" it gives below error ERROR: Command errored out with exit status 1: /usr/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-72vmg7v7/mysqlclient/setup.py'"'"'; file='"'"'/tmp/pip-install-72vmg7v7/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-j125wcaz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/sachin/.local/include/python3.7m/mysqlclient Check the logs for full command output. When I try to install off line and download cp37 version for my python 3.7.9 and run below command pip install mysqlclient-2.0.1-cp37-cp37m-win_amd64.whl It gives error ERROR: mysqlclient-2.0.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform. My python is 64 bit and I am using Ubuntu 20.04.1 LTS import struct print(struct.calcsize("P") * 8) Pls help! Thanks in advance. -
Django error smtplib.SMTPAuthenticationError: (535, b'Incorrect authentication data') while sending email
Hi i am trying to execute the following code on terminal with django.core.mail send_mail send_mail('some title','some text','myemail@gmail.com',['otheremail@gmail.com']) but after execution the console is showing this error Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/adjtlikp/virtualenv/globalit-web/3.7/lib/python3.7/site-packages/django/core/mail/__init__.py", line 61, in send_mail return mail.send() File "/home/adjtlikp/virtualenv/globalit-web/3.7/lib/python3.7/site-packages/django/core/mail/message.py", line 284, in send return self.get_connection(fail_silently).send_messages([self]) File "/home/adjtlikp/virtualenv/globalit-web/3.7/lib/python3.7/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages new_conn_created = self.open() File "/home/adjtlikp/virtualenv/globalit-web/3.7/lib/python3.7/site-packages/django_smtp_ssl.py", line 14, in open self.connection.login(self.username, self.password) File "/opt/alt/python37/lib64/python3.7/smtplib.py", line 730, in login raise last_exception File "/opt/alt/python37/lib64/python3.7/smtplib.py", line 721, in login initial_response_ok=initial_response_ok) File "/opt/alt/python37/lib64/python3.7/smtplib.py", line 642, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'Incorrect authentication data') my settings.py EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend' EMAIL_HOST_PASSWORD = 'pass' EMAIL_HOST_USER = 'myemail@gmail.com' EMAIL_USE_SSL = True EMAIL_PORT = 465 MAILER_EMAIL_BACKEND = EMAIL_BACKEND EMAIL_HOST = 'smtp.gmail.com' DEFAULT_FROM_EMAIL = EMAIL_HOST_USER i tryed to change the EMAIL_PORT and the EMAIL_HOST but nothing changed the intersting is that in localhost the code work perfect but when i am using the host the errors came to me) sorry for my bad english ) -
Django Python - Add table values inside common header
Maybe trying to do something not possible but basically, I created a file header.html that I include all other my html pages e.g. {% include "project/header.html" %} This works fine the challenge is that on header.html I want to put a dropdown menu with values coming from a model. it works fine if I invoke directly header.html but not when inside other page. header.html ... <ul> {% for club in clubs.all %} <li> <a href="#">{{ club.name }}</a></li> {% endfor %} ... views.py from django.http import HttpResponse from django.shortcuts import render from .models import Club def index(request): clubs = Club.objects return render(request, 'project/index.html',{'clubs':clubs}) Is this even possible? Thanks in advance -
How to make a "public" API using Django Restfull: no authentication and rendering a default json format (not using browsable API)?
I am neewbie in DRF. I have implemented DRF API following quikstart exemple on my own data and deploy my app on pythonanywhere. It works and I can access browsable API (users). To resume, in one hand I have a Django web app with a Django Rest API app layer. In the other hand, I have a Flutter mobile app. I would like users to be able to connect to web app or mobile app with the same account (shared database). A solution mentionned in this forum would be my Flutter web app to be able to recover data from django web app using the DRF API. And I would like api to be accessible without authentication and directly rendered in json format. But I face 2 problems. All tutorial I've seen for now show the browsable API. I've read about JsonRenderer but not sure how to implement this solution (renderer_classes = [JSONRenderer] ?). To have access to API, I need to be authenticated. I've read about token that seems to be the solution but how to implement it? thanks to lead me to the way to do that... -
Keep getting ModuleNotFoundError: No module named 'mainsite.settings' when pushing scheduler to heroku
I'm trying to set up a scheduler on heroku - I read on the django docs that I need to treat django as a stand alone app My clock.py, which triggers the background job looks like this: import os import django os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mainsite.settings.dev') django.setup() from django.conf import settings from apscheduler.schedulers.blocking import BlockingScheduler from rq import Queue from worker import conn from accounts.tasks import print_message q = Queue(connection=conn) sched = BlockingScheduler() @sched.scheduled_job('interval', minutes=3) def timed_job(): print('This job is run every three minutes.') q.enqueue(print_message, 'http://heroku.com') sched.start() I keep getting an error saying ModuleNotFoundError: No module named 'mainsite.settings' even though my folder structure doesn't even have a mainsite.settings. It's stored in mainsite.settings.prod for the heroku server and in mainsite.settings.dev on my local machine, as seen here: My wsgi.py looks like this: os.environ.setdefault('DJANGO_SETTINGS_MODULE', os.getenv('DJANGO_SETTINGS_MODULE')) The worker.py file, if anyone wonders, looks like this: import os import redis from rq import Worker, Queue, Connection listen = ['high', 'default', 'low'] redis_url = os.getenv('REDISTOGO_URL', 'redis://localhost:6379') conn = redis.from_url(redis_url) if __name__ == '__main__': with Connection(conn): worker = Worker(map(Queue, listen)) worker.work() What am I doing wrong? -
Django NoReverseMatch at / is it conflicting path names and or order?
hello i am trying to add an edit page to my django url patterns and the page give me an error once i click on one of the links on my page the system crashes and i am presented with a no reverse match error from the system. If i do swap the the edit path with the entry path it does work then but that is not the way i want it to work. I would like the user be presented with entry page first and then be able to click on the edit button to edit the page. below are my views and some html pages. new to django and looked into the documentation but didn't find anything. thank you for the help below is also the error: error - Reverse for 'edit' with arguments '('# Django\r\n\r\nDjango is a web framework written using Python that allows for the design of web applications that generate HTML dynamically.\r\n',)' not found. 1 pattern(s) tried: ['(?P[^/]+)$'] urls.py: from django.urls import path from . import views app_name = "enc" urlpatterns = [ path("", views.index, name="index"), path("new_page", views.new_page,name="check_page"), path("",views.get_search,name="search"), path("<str:title>",views.entry, name="page"), path("<str:title>",views.edit, name ="edit"), ] views.py from django.shortcuts import render from django.http import HttpResponse, … -
How to create a horizontal box-card carousel using for loop with django
Iam new to django and learning.I did make my html card-box code horizontally carousel but has lot of card-box, I'am trying from last one week to modify and simplify card-box code using django forloop, searched all over net but couldn't get any desire solution. help me with example templets plz. -
Is it possible to override model save behavior in cases where Django admin throws an error on save?
The situation is this: I have two models, Text and Edition, in a many-to-many relationship. That relationship is tracked by an intermediate "through" model, EditionTextThrough, which keeps track of the position of each text within each edition. This position is represented by an integer, and must be unique with the edition ID. So the table looks like this: +----+----------+----------------------------------+---------+ | id | position | edition_id | text_id | +----+----------+----------------------------------+---------+ | 1 | 1 | 5208c5563d4148c89813a4f7105b0b4c | 1 | | 2 | 2 | 5208c5563d4148c89813a4f7105b0b4c | 2 | | 4 | 3 | 5208c5563d4148c89813a4f7105b0b4c | 4 | | 5 | 4 | 5208c5563d4148c89813a4f7105b0b4c | 4 | | 6 | 5 | 5208c5563d4148c89813a4f7105b0b4c | 4 | | 7 | 6 | 5208c5563d4148c89813a4f7105b0b4c | 1 | +----+----------+----------------------------------+---------+ This sample only shows one edition, but you get the idea. What's important here is that I want to keep the position numbering consecutive; the numbers don't matter on their own except to keep track of a sequence. I've been able to get them to stay consecutive when an instance is deleted, along with most of the other behavior I want. However, the sticking point is when it comes to rearranging them, swapping positions, etc. Say … -
How do I maintain a button state across pages
In my project I'm using normal HTML for front-end and Django for back-end. There I have a login system. I have two questions on that: When the user logs-in how do I detect it in HTML and change the Login button to show Log out. How do I maintain this changes across pages. So, that when I navigate to a different page after login it keeps showing the logout button. Don't suggest me react. I have come a long way from where I can change my technology stack for this project. -
time data '0:02:00' does not match format '%H %M %S'
I want to save a string as time format to store it in the database for a django project, Here's my utils.py file: import datetime import re import math from django.utils.html import strip_tags def count_words(text_string): word_string = strip_tags(text_string) matching_words = re.findall(r'\w+', word_string) count = len(matching_words) return count def get_read_time(text_string): count = count_words(text_string) read_time_min = math.ceil(count/200.0) #Assuming 200 words per min Reading read_time = str(datetime.timedelta(minutes=read_time_min)) return read_time Here's the required portion of the models.py file: class Post(models.Model): read_time = models.TimeField(null=True, blank=True) Here's the required portion of the views.py file: class PostDetailView(DetailView): model = Post def get_context_data(self, *args, **kwargs): context = super().get_context_data(**kwargs) texts = self.object.content # print(texts) read_time=get_read_time(texts) # print(read_time) Post.objects.create(read_time=datetime.strptime(read_time, "%H:%M:%S")) return context The Output format of the string is 0:02:00 this I want to save it in the database as datetime field. But I am encountering this error:- Exception Type: ValueError at /post/this-blog-contains-an-image-with-it/ Exception Value: 's' is a bad directive in format '%H:%MM:%ss' -
Django Custom Authentication with user model
Im trying to add SAML2 authentication to my Django Project. I'm now at the point where I get the SAML response with user and I can parse the response. I'm in the returned URL of SAML2 request that is a specific view of my SAML2 module. In the view I have this code: if 'samlUserdata' in request.session: if len(request.session['samlUserdata']) > 0: attributes = request.session['samlUserdata'].items() user = saml_authenticate(attributes) saml_authentication is a simple method that take the attributes of SAML Response, take username and search it on DB and return the user model. Now its not clear what I have to do to effectively log in my software. Im especting to redirect to the HomePage of my software where, instead of Login Page, I automatically login. Searching on google, I found out the custom authentication. So I've create a new backend authentication and added to settings. Somehting like this: def authenticate(self, request, username): try: logger.debug("Authenticating user '%s'" % (username)) user = User.objects.get(username=username) if not user.is_active: syslog.syslog("User '%s' not active" % (username)) return None logger.debug("User '%s': authenticated" % (username)) return user except User.DoesNotExist as e: logger.debug("User '%s' not found" % (username)) return None But I don't know how to use properly. I have … -
Retrieve user e-mailaddress given confirmation key (email verification) from Django all-auth with rest-auth
The application is using Django backend and ReactJS frontend. I created user accounts using the standard rest-auth package in Django, calling the endpoints from the ReactJS frontend forms. Sign up and login works fine, but when it comes to e-mail confirmation, I haven't been able to find where confirmation keys are stored and how this is accessed. I've overridden get_email_confirmation_url from DefaultAccountAdapter to change the URL confirmation link that is being sent out from [backend]/rest-auth/registration/account-confirm-email/[KEY] to [frontend]/registration/confirm-email/[KEY]. I'm able to read out [KEY] at the frontend. However, how do I retrieve the e-mailaddress and name of the user that's trying to confirm their address? In the standard Django template this is possible (email_confirm.html): {% extends "account/base.html" %} {% load i18n %} {% load account %} {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} {% block content %} <h1>{% trans "Confirm E-mail Address" %}</h1> {% if confirmation %} {% user_display confirmation.email_address.user as user_display %} <p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p> <form method="post" action="{% url 'account_confirm_email' confirmation.key %}"> {% csrf_token %} <button type="submit">{% trans 'Confirm' %}</button> </form> {% else … -
How to initialize db.sqlite3 database in pythonanywhere?
I'm neewbie in pythonanywhere. I've just deploy my django project and all seems to be OK except I need initialize ma database first and I don't know how to do this. I can I get a python shell? thanks for help -
Is it possible to use FastAPI with Django backend?
Well, it seems like nobody is talking about this. I'm a django developer and recently stumbled onto FastAPI framework, which seems to be promising among the community. Then I decided to give it a shot. But usually when you talk about building RESTful APIs with django you usually use Django Rest Framework(DRF). My question is: is anybody aware if it is possible to substitute DRF by FastAPI using django perks, like its ORM, and still have access to all FastAPI's async features? Up until now I only found one article on this. And the guy makes a poor integration, losing most of the exciting features of FastAPI. You can find it here In the FastAPI docs, they do mention that it is possible to redirect certain request to a WSGI application here. I hope this post starts a healthy discussion about the manner. -
How to load json api data to html template in angular?
Can anyone help me with a simple question(I guess). I'm trying to display a json file in a table through Django into an Angular front end app. I can view the data by console logging it, however I can't seem to get the data into the webpage. I know how to display the table in HTML. The specific problem is that the object which is fetched from the API does not appear in the HTML. component.ts import { AfterViewInit, ChangeDetectionStrategy, Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import ApexChart from 'apexcharts' import { ApexOptions } from 'ng-apexcharts'; import { FinanceService } from 'app/modules/admin/dashboards/finance/finance.service'; @Component({ selector: 'app-finance', templateUrl: './finance.component.html', styleUrls: ['./finance.component.scss'], encapsulation : ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }) export class FinanceComponent implements OnInit { _stockData: any; _portData: any; _effData: any; _calData: any; _labels: any; _table: any; constructor( private _financeService: FinanceService, ){ } ngOnInit(): void { this._financeService.getFinanceData() .subscribe((res: any) => { console.log(res); this._stockData = res.stocks; this._portData = res.port; this._effData = res.eff; this._calData = res.cal; this._labels = res.labels; this._table = res.table; console.log(res.table); this._prepareChartData(); }, (response) => { // Re-enable the form }); } template.html <div> <p>{{_table.Percentage}}</p> </div> json (as presented by the django API) { "stocks":[], "eff":[], "port":[], "cal":[], "labels":[], "table":{ "Percentage":{ "AD.AS":16.1, … -
Is there a way to construct pages with components
I am familiar with the concept of extends and include with django templates. However, I am trying to build up pages with components (which relates more to the "include" approach). Unfortunately, some elements on a page should be added in the header of the page (e.g. stylesheets) and some should be added at the end of the page (e.g. scripts). Is there a way to declare blocks (e.g. {% block extraheaders %}<link...>{% endblock %}) in the included files so they are placed in the correct region of the page? -
Multiple Database Instance for Django Project
I have created an django application where i am using ngnix server. My project is deployable for customer. One of client is saying that they won't allow us to their customer data in our database due to data privacy. So basically they want us to make a system where data will be store data on their database instance. Basically we want store their data on their system. I did some research and found django allow Multiple Database. But i am using ngnix also, please suggest me a good solution for such type of problem where it will be generic, let say in future other customer also come so i can provide them. My Questions - Using Django Multiple Approach using db_label will be a good approach? Is there other ways to achieve such problems? Is there a way using ngnix server redirecting, where ngnix will redirect data to particular database? Basically my django code will be on my instance. But they will provide us database credentials where we can access it. For login system my database will be using for checking credentials. But except user models, all other models will be on client system. Please provide me a best solutions.