Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Rest Framework Serializer - How to allow optional fields to be ignored when invalid?
I have a use case targeting developers sending extra data to my API. I want my API to have a strict typing system via Django Rest Framework Serializer validation. However, if a user sends partially invalid data, I want to ignore that data if the field is optional rather than return a 400 response. For example, consider a key-value tags field tags = serializers.DictField(child=serializers.CharField(), required=False) Valid data for the tags field might look like {"foo": "bar"}. Invalid data could look like {"foo": "bar", "invalid": {{"some": "object"}} as the value for "invalid" is an object and not a string. DRF is_valid will consider this invalid. validated_data will not be populated. > serializer.is_valid() False > serializer.validated_data {} Because this field is not required and other tags might be valid, I'd want this returned instead > serializer.is_valid() True > serializer.validated_data {'another_field': 'a', 'tags': [{'foo': 'bar']} Is there a way to make optional fields ignore invalid data instead of making the entire serializer invalid while still using a Django Rest Framework serializer and benefiting from the other validation and normalization performed? -
How to upload Multiple file data in Django?
How can i upload multiple photo or video in Django? The code below upload single file instead of multiple files. i also define attr for multiple files in forms.py and it's working for the selection of multiple files. but the form is only save single file in database. please can anybody tell me? how can i do what i want to do? I would be grateful for any help. models.py class Article(models.Model): title = models.CharField(max_length=300) file_data = models.FileField(upload_to='stories', blank=True, null=True) author = models.ForeignKey(User, on_delete=models.CASCADE) forms.py class ArticleForm(forms.ModelForm): file_data = forms.FileField(required=False, widget=forms.FileInput( attrs={'accept': 'image/*,video/*', 'multiple': True})) class Meta: model = Article fields = [ 'title', 'file_data', ] views.py class NewsCreateView(CreateView): form_class = ArticleForm template_name = 'create.html' success_url = '/' def form_valid(self, form): # check author validation form.instance.author = self.request.user return super().form_valid(form) -
How do I solve form not submiting in django
I have created a form without using the form model, but the form wouldn't submit any data and I dont get any error message. The html file <form action="{% url 'wiki:add_test' %}" method="post"> {% csrf_token %} <div class="input_form"> <label class ="label_title" for="entry_title">Title:</label> <input class="entry_title" type="text" name="entry_title" placeholder="Title"> </div> <br> <div class="input_form"> <div class="input_label"><label for="entry_content">Content:</label></div> <div class="input_field"> <textarea class="entry_content" name="entry_content" id="" cols="5" rows="2"></textarea> </div> </div> <div class="input_form"> <div class="title"></div> <div class="input_button"><input type="button" value="Add Entry"></div> </div> </form> The views.py def test1(request): return render(request, "encyclopedia/display_test.html",{ "lists": new_entry }) def add_test(request): if request.method == "POST": form1 = request.POST print(request.POST['entry_title']) list_item = form1['entry_title'] new_entry.append(list_item) return HttpResponseRedirect(reverse("wiki:test1")) return render(request, "encyclopedia/add.html") The urls.py from django.urls import path from . import views app_name = "wiki" urlpatterns = [ path("", views.index, name="index"), path("test1", views.test1, name="test1"), path("add_test", views.add, name="add_test"), ] I need help to know where I went wrong -
How to break the game when it reaches the score 10?
I'm working on Rock, Paper, Scissor game and I want to break the game when the score reaches 10(points) but I'm unable to do it. Can anyone tell me how to do that. I have used while loop for that but I can't get the actual output that I need. And what this stands for? #elif((player_input[1] - computer_input[1]) % 3 == 1): player_score = 0 computer_score = 0 options = [('rock',0), ('paper',1), ('scissors',2)] def player_choice(player_input): global player_score, computer_score computer_input = get_computer_choice() player_choice_label.config(text = 'You Selected : ' + player_input[0]) computer_choice_label.config(text = 'Computer Selected : ' + computer_input[0]) if(player_input == computer_input): winner_label.config(text = "Tie") elif((player_input[1] - computer_input[1]) % 3 == 1): player_score += 1 winner_label.config(text="You Won!!!") player_score_label.config(text = 'Your Score : ' + str(player_score)) else: computer_score += 1 winner_label.config(text="Computer Won!!!") computer_score_label.config(text='Computer Score : ' + str(computer_score)) #Function to Randomly Select Computer Choice def get_computer_choice(): return random.choice(options) -
Django ListView Multiple Pagination in Same Page
I was trying to make multiple pagination in the same page with out using any library. I followed this Multiple Pagination Method and successfully implemented it. However, one issue in this is say if I'm on page 3 on model_one, I click on next for model_two, then model_one resets to page 1, and model_two goes to page 2. Is there any way to retain the page of a table, while navigating through pages of another table? P.S.: If there is any library, please let me know as well. Found two versions of Django-Endless-Pagination, both seems to be abandoned around Django 1.8-2.0, and are more for Python2 than 3. TIA -
Search users function, doesn't work it comes back with error (django)
I am having some issue with the search users function in my django app , it comes back with the error image below: error result . Any ideas what I'm doing wrong ? error: Cannot resolve keyword 'username_icontains' into field. Choices are: date_joined, details, email, first_name, from_user, groups, id, is_active, is_staff, is_superuser, last_login, last_name, likes, logentry, password, post, profile, to_user, user_permissions, username Here is my code : views.py @login_required def search_users(request): query = request.GET.get('q') object_list = User.objects.filter(username_icontains=query) context ={ 'users': object_list } return render(request, 'users/search_users.html', context) models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) image = models.ImageField(default='default.png', upload_to='profile_pics') slug = AutoSlugField(populate_from='user') bio = models.CharField(max_length=255, blank=True) friends = models.ManyToManyField('Profile', blank=True) def __str__(self): return str(self.user.username) def get_absolute_url(self): return "/users/{}".format(self.slug) forms.py class UserRegisterForm(UserCreationForm): email = forms.EmailField() class Meta: model = User fields = ['username', 'email', 'password1', 'password2'] search_users.html {% extends "feed/layout.html" %} {% load static %} {% endblock cssfiles %} {% block searchform %} <form class="form-inline my-2 my-lg-0 ml-5" action="{% url 'search_users' %}" method="get" > <input name="q" type="text" placeholder="Search users.." /> <button class="btn btn-success my-2 my-sm-0 ml-4" type="submit"> Search </button> </form> {% endblock searchform %} {% block content %} <div class="container"> <div class="row"> <div class="col-md-8"> {% if not users %} <br /><br /> <h2><i>No … -
How to get current logged in user out of views(request) in django
I'm working on website whose an app which has class called Members whose a field that is related to the builtin User class from django.contrib.auth.models and it looks like class Members(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) member_image = models.ImageField(upload_to='unknown') member_position = models.CharField(max_length=255) ... So as you can see when I'm adding member_image as a user I have also to select the user which doesn't make sense to me because I want to detect which user is logged in and pass his/her id as default parameter like class Members(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, default=request.user.id) and after remove the user field in the admin panel like class MembersAdmin(admin.ModelAdmin): fields = ('member_image', 'member_position', ...) so that if the user field doesn't selected it will set the logged in user_id by default but to access request out of the views.py is not possible. so how will I achieve this I also tried the following answers Access session / request information outside of views in Django Accessing request.user outside views.py Django: How can I get the logged user outside of view request?, etc but still not get it -
CSS view changes after addition of bootstrap
I'm a beginner in web development. I am making a simple todo list app. I have designed a webpage which changes after addition of bootstrap. Code without bootstrap <!DOCTYPE html> <html> <head> <title>To Do List </title> {% load static %} <link rel="stylesheet" type="text/css" href="{% static 'todo/styles.css' %}"> </head> <body> <div class="box" id="heading"> <h1>{{kindOfDay}}!</h1> </div> <div class="box"> {% for i in newListItems %} <div class="item"> <input type="checkbox" \> <p>{{ i }}</p> <a href="{% url 'todo:delete_item' i %}">X</a> </div> {% endfor %} <form class= "item" action="" method="post"> {% csrf_token %} <input type="text" name="newItem" placeholder="Add new item here"> <button type="submit" name="button">+</button> </form> </div> </body> </html> Image of webpage without bootstrap Code with bootstrap <!DOCTYPE html> <html> <head> <title>To Do List </title> {% load static %} <link rel="stylesheet" type="text/css" href="{% static 'todo/styles.css' %}"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> <body> <div class="box" id="heading"> <h1>{{kindOfDay}}!</h1> </div> <div class="box"> {% for i in newListItems %} <div class="item"> <input type="checkbox" \> <p>{{ i }}</p> <a href="{% url 'todo:delete_item' i %}">X</a> </div> {% endfor %} <form class= "item" action="" method="post"> {% csrf_token %} <input type="text" name="newItem" placeholder="Add new item here"> <button type="submit" name="button">+</button> </form> </div> </body> </html> Image of webpage after adding bootstrap Any help will be appreciated -
Inherit bootstrap properties to a custom class
I want my custom class pm_btn to get all the properties that bootstrap's btn class has. One way is to use the actual source code of the btn class. But I believe that there has to be a better way. Therefore, I tried a bit of scss, where inheriting properties is quite easy and trivial using @extend as follows: .pm_btn{ @extends .btn; } But this throws error : Error: The target selector was not found. Use "@extend .btn !optional" to avoid this error. I am trying to achieve: apply bootstrap like classes to django-postman classes. Please suggest me how can I achieve this, if I am on the right track by choosing SCSS or should I think in some other directions. Thank you for your valuable time. -
URL is adding automatically - Django
I have got a problem while redirecting to the edit form. SO what I am doing is that whenever user clicks on edit button it redirects to "editadmin/{{admin.id}}" using form action = "editadmin/{{admin.id}}" in HTML. URL path is path("editadmin/<int:id>", views.editadmin, name="editadmin") path("update/<int:id>", views.updateadmin, name="updateadmin") Views.py @csrf_exempt def editadmin(request, id): admin = Admin.objects.get(id=id) return render(request, "editadmin.html", {"admin": admin}) @csrf_exempt def updateadmin(request, id): if request.method == "POST": admin_id = request.POST["admin_id"] admin_id = str(admin_id).strip().upper() name = request.POST["name"] name = str(name).strip() if db_name equals to name: messages.error(request, "Admin name already exists") return redirect("editadmin/" + str(id)) editadmin.html <form method="post" class="post-form" action="/update/{{admin.id}}"> <input type="hidden" name="id" id="id" required maxlength="20" value="{{ admin.id }}"/> {% csrf_token %} <div class="form-group row"> <label class="col-sm-3 col-form-label"><h4 style="margin-left:40px">Admin ID : </h4></label> <div class="col-sm-4"> <input type="text" name="admin_id" required style="margin-left:20px; height:38px; width:300px; border-radius: 5px" id="admin_id" value="{{ admin.admin_id }}"/> </div> </div> <div class="form-group row"> <label class="col-sm-3 col-form-label"><h4 style="margin-left:40px">Name : </h4></label> <div class="col-sm-4"> <input type="text" name="name" style="margin-left:20px; height:38px; border-radius: 5px; width:300px" required id="name" value="{{ admin.name }}"/> </div> </div> <div class="form-group row"> <label class="col-sm-1 col-form-label"></label> <div class="col-sm-4"> <button type="submit" class="btn btn-success" style="margin-left:210px">Submit</button> </div> </div> So what I want is that Whenever user submits invalid name in editadmin.html (URL - editadmin/1 ), it should redirect to the same URL … -
Django: PosixPath object is not iterable
Before version 3.x of Django it was possible to define templates, static and media folder using os.path. Into settings.py I had this configuration: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) . . . TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], . . . STATIC_URL = '/static/' STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static-folder') MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media-folder') MEDIA_URL = '/media/' STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] Now the settings are changed and I need to use Path: from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent I'm following this new way but I think something is not clear for me. My new settings.py configuration is: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ BASE_DIR / 'templates', ], . . . STATIC_URL = '/static/' STATIC_ROOT = BASE_DIR / 'static-folder' MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / 'media-folder' STATICFILES_DIRS = BASE_DIR / 'static' But with that configuration I see this error: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/maxdragonheart/DEV_FOLDER/MIO/Miosito/WebApp/backend/.env/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "/home/maxdragonheart/DEV_FOLDER/MIO/Miosito/WebApp/backend/.env/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "/home/maxdragonheart/DEV_FOLDER/MIO/Miosito/WebApp/backend/.env/lib/python3.8/site-packages/django/core/management/base.py", line 392, in check all_issues = checks.run_checks( File … -
django.db.utils.ProgrammingError: (1146, "Table 'online_examination_system.studentapp_courses' doesn't exist")
I tried makemigrations, migrate, and even many methods stated in stack overflow but nothing is happening. Please tell me the reason why this happens and how can i solve it? -
How to display dynamic page before task complete in Django
I have two pages in Django, I want to display a page while a task is being done and display second page after it complete how can I do: views.py render(request, 'loading_page.html') data_processing() return render(request, 'list.html') Page one (loading_page.html) I that want to display while I am processing data. After executing that data_processing function, I want to display list.html, How can I do that. -
Working on a Fastapi project. everything is fine but PUT method is throwing error. post and Get method is working fine
the error message is sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: UPDATE subjects SET url=subjects.url, title=subjects.title, name=subjects.name, "desc"=subjects."desc" WHERE subjects.id = ?] [parameters: (<class 'int'>,)] (Background on this error at: http://sqlalche.me/e/13/rvf5) schema is id : str = Field(..., example="Enter Your Id") title:str name :str desc:str models is class Subject(Base): __tablename__ = "subjects" id = Column(Integer, primary_key=True) created_date = Column(DateTime,default=datetime.datetime.utcnow) url = Column(URLType) title = Column(String) name = Column(String) desc = Column(String) crud.py is async def update_subject(db: Session,title:str,name:str,desc:str,url:str,id=int): query = models.Subject.__table__.update()\ .where(models.Subject.id== id)\ .values(title=models.Subject.title,desc=models.Subject.desc, name=models.Subject.name,url=models.Subject.url) return await db.execute(query) router.py is @router.put("/subject/{id}") async def update_subject( #user : schemas.SubjectUpdate, id: int, title:str,desc:str,name:str,file: UploadFile= File(...), db: Session = Depends(get_db) ): extension = file.filename.split(".")[-1] in ("jpg", "jpeg", "png") if not extension: return "Image must be jpg or png format!" # outputImage = Image.fromarray(sr_img) suffix = Path(file.filename).suffix filename = time.strftime( str(uuid.uuid4().hex) + "%Y%m%d-%H%M%S" + suffix ) with open("static/"+filename, "wb") as image: shutil.copyfileobj(file.file, image) #url = str("media/"+file.filename) url = os.path.join(images_path, filename) subject = crud.get_subject(db,id) if not subject: raise HTTPException(status_code=404, detail="comment not found") return await crud.update_subject(db=db,name=name,title=title,desc=desc,url=url) it is throwing 500 internal server error in swagger ui and the error mentioned above in IDE. All other methods are working fine. -
Django Simple History Module + How To Directly Migrate data to History Models
We have our own custom different tables which contain log data and where data looks similar as simple history models standard. Now i want to use SimpleHisory module for my django application. how can i directly move the existing data to new simple history models(I want to move log data alone into simple history tables) I want to move data through Django migration models, not with SQL I have changed my model as below, now history table is available with me. > from django.db import models from simple_history.models import > HistoricalRecords > > class Poll(models.Model): > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date sample') > history = HistoricalRecords() Please advise, how can save directly into history tables with some example. -
How to show only one user (user that is logged in) profile?
I'm trying to add a user profile page into my blog (in German) but when I run the server and go to user profile page, it shows profiles of all users that are in the database. I want to show only the profile of one user (the logged in one) Here is my views.py: ... class UserProfile(LoginRequiredMixin, ListView): model = Member template_name = "app/profile.html" context_object_name = "member_infos" ... And my profile.html template: ... {% for info in member_infos %} <div class="row"> <div class="col-md-3"> <div class="card card-body"> <h3 style="text-align:center;">Profil</h3> <hr /> {% if info.picture %} <img class="profile-pic" src="{{ info.picture.url }}" /> {% else %} <img class="profile-pic" src="{% static 'media/images/profile_pic/default_profile_pic.png' %}" /> {% endif %} </div> </div> <br /><br /> <div class="col-md-9"> <div class="card card-body"> <p class="card-text"> <strong>Vorname(n): </strong> {{ info.first_name }} </p> <hr /> <p class="card-text"> <strong>Nachname: </strong> {{ info.last_name }} </p> <hr /> <p class="card-text"> <strong>Telefonnummer: </strong> {{ info.contact }} </p> <hr /> <p class="card-text"> <strong>E-Mail-Adresse: </strong> {{ info.email }} </p> </div> <br /><br /> <a class="btn btn-warning ml-7" href="{% url 'edit-profile' %}"> Daten bearbeiten &rarr;</a> </div> </div> <br /><br /> {% endfor %} ... As I said, it shows up profiles of all users in my database. How to … -
Change Foreign Key name in django migration
I'm looking to change the name of a foreign key from uuid to uuid_erp. To do this i can run a migration as follows: migrations.RunSQL(''' ALTER TABLE result_suppliers RENAME COLUMN uuid TO uuid_erp; ''') By doing this i essentially want to do the migration for django, and that it does nothing when running makemigrations. However when i do run python manage.py makemigrations i see that django is trying to create the column uuid_erp (which has already been created). this gives the message: You are trying to add a non-nullable field 'uuid_erp' to resultsuppliers without a default; we can't do that (the database needs something to populate existing rows). Please select a fix: 1) Provide a one-off default now (will be set on all existing rows with a null value for this column) 2) Quit, and let me add a default in models.py Select an option: From the makemigrations docs I see that django: Creates new migrations based on the changes detected to your models. This doesn't give a huge insight into how the changes are detected. My question is two fold: How does makemigrations decide that there is a migration to make? How can I perform this operation ? NB. … -
Question about recording, hosting, and viewing videos from a React web app, with a Django backend
I'm working on the backend of a React web app, developed in Django (and Django Rest Framework). For sake of abstraction, the application is more or less an exercise app, where a trainer can record a trainee's exercises on their phone for the trainee to review at a later time. I am just lost as to how I would accomplish this and was hoping for some recommendations of technologies or methods that I should start looking into. My main questions are: Is there a React library or toolkit that might help with the recording process? and what kind of storage should I use for the videos so they can be easily stored and streamed? Some people have suggested using YouTube, but I am wary of this as the videos will be of a personal nature, and having the videos played back to the trainee in a youtube player might make the trainees uncomfortable. Thank you all for your help! -
Django and APScheduler not running on IIS Server
We have a django app which we deployed using IIS Server. The app has been running smoothly and without any problem. However, we want to schedule a job that will run every night at 02:00. We are using APScheduler which is working perfectly fine on the django local server but it never runs on production. Here is the code I am using to run the jobs. myapp/scheduler.py def schedule(): scheduler = BackgroundScheduler() scheduler.add_job(daily_schedules, 'interval', minutes=5) # scheduler.add_job(daily_schedules, trigger='cron', hour='2') scheduler.start() def daily_schedules(): time_now = time.clock() parse_api() # my function # Keeping logs path = join(settings.FILES_DIR, 'schedulled/logs.csv') logs = pd.read_csv(path, encoding='utf-8') time_end = time.clock() - time_now logs.loc[len(logs)] = [ datetime.now().strftime('%Y-%m-%d %H:%M:%S'), time_end ] logs.to_csv(path, encoding='utf-8', index=False) print(logs) myapp/apps.py from django.apps import AppConfig class MyAppConfig(AppConfig): name = 'MyApp' def ready(self): from myapp import scheduler scheduler.schedule() Is there any particular reason why the job is not being run? Do I need to do something else or this method does not work with IIS? Since the server is being used by many developers at the same time, I would like to run the jobs as part of the django application and not run them outside in a separate server. P.S: I have read all … -
how to create two table with custom primary and Foreign key
class UserInfo(models.Model): userame=models.CharField(max_length=100,help_text='Enter user name that you want', unique=True, primary_key=True) **#want have userame as primary key** mobile_number=models.IntegerField() email=models.CharField(max_length=200) Fist_Name=models.CharField(max_length=500) Middle_name=models.CharField(max_length=500) Last_name=models.CharField(max_length=500) class Order(models.Model): username=models.OneToOneField(UserInfo,on_delete=models.CASCADE) **#user name of UserInfo table want to be foreign key in Order table** Prodduc_name=models.CharField(max_length=500) It's failing with django.db.utils.OperationalError: (1829, "Cannot drop column 'id': needed in a foreign key constraint 'woodshophome_passwor_username_id_35d147b1_fk_woodshoph' of table 'woodshophome_passwordtable'") woodshophoe is app name -
type NoneType doesn't define __round__ method
I've gone through similar questions but was not able to find a solution to my question. I have 4 cards(movie cards) and the first two are working well but the rest are not. The problem started appearing once I added some logic to views.py in order to show an average rating of each movie based on the reviews given. Here is the code in views.py def detail(request, id): movie = Movie.objects.get(id=id) reviews = Review.objects.filter(movie=id).order_by('-comment') average = reviews.aggregate(Avg('rating'))["rating__avg"] average = round(average, 1) # The problem is above(in round) but dunno how to fix it context = {'movie': movie, 'reviews': reviews, 'average': average} return render(request, 'detail.html', context) -
Is it possible to retrieve data from a database view to a model in django?
i have a view in my oracle database that joins two tables which a made vertical partitioning, now i want to retrieve the data from that view in django. Does anyone know how to make a model in django for a view? Thank You -
Leave out parent node in template
I have a MPTT category tree which I display this with {% load mptt_tags %} <ul> {% recursetree category %} <li> <a href="/.../{{ node.id }}/{{ node.slug }}">{{ node.title }}</a> {% if not node.is_leaf_node %} <ul class="children"> {{ children }} </ul> {% endif %} </li> {% endrecursetree %} And it looks like that country usa california france provence germany However, I would like to leave out 'country'. I tried { if not children == ancestor } and then the code When adding in the model the filter Category.objects.filter(children__isnull=True) ``` then I get only the child, so 'usa' would be left out too in this example. I hope someone can help. Thank you! -
how to prevent/ secure delete request method from any attacker in django
@method_decorator(login_required, name='dispatch') class CategoryDeleteView(DeleteView): model = Category template_name = 'board/delete.html' success_url = reverse_lazy('category-list') path('category/<int:pk>/delete', CategoryDeleteView.as_view(),name='category-delete') if a attacker runs the script from logged in user browser with random category id, how we will prevent from this kind of attacks in Django or Django rest framework -
Is there a free no-credit card postgres hosting service?
So i am trying to create a python-django app which needs the admin to upload photos, but when I host this website on heroku it deletes these files after sometime. I figured that it was what heroku does by default and I needed to host by database on another service. There is AWS and CloudSQL but they require me to put a credit card which I don't have nor do my parents, there is elephant SQL but I don't know how to use it, can someone help me with this.