Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
JWT Authentication using custom database table in Django
I have a working Django REST API as back-end. I was previously using JWT Token Based Authentication for accessing the api's. For that I was used default django User. Now I planned to move login authentication method using custom database table field (like username and password), I can achive user login page using custom login page API, but after login I can't authenticate the API using JWT Token. Can someone please suggest how to authenticate API using JWT Token with custome database table. table_name : userdetails, fields : username, password -
cannot import name 'PredResults' from 'predict.models'
Here is the code from my Django app named 'predict' from the models' file. from django.db import models class PredResults(models.Model): month = models.FloatField() grade = models.FloatField() score = models.FloatField() bonus_score = models.FloatField() classification = models.CharField(max_length=30) def __str__(self): return self.classification When I am running my project, it's giving me an error that: File "C:\django_project\predict\views.py", line 4, in <module> from .models import PredResults ImportError: cannot import name 'PredResults' from 'predict.models' (C:\django_project\predict\models.py) How can I fix this? -
Replace SQLite database with a MySQL Database in Django
I am currently working on my first Django project. I made a website where my team and I could upload CSV's to be run through python and I made a SQLite model that I never really used. I now have access to this website's database so we no longer have to use these CSVs downloaded from the site. I have been trying to follow along online on how to switch to an existing database. The database is managed through phpMyAdmin and uses MySql First I updated my database config: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'MadeUpName', 'USER': 'UserIDForDB', 'PASSWORD': 'MyPasswordThatGoesWithUser', 'HOST': 'db.Website.com', 'PORT': '', } } For clarification, for Name I just made up a name, User and Password are my login credentials for PHPMyAdmin, the Host is the actual host I was told I could use when connecting through code and I left port blank for defaults. I removed the old model I had built in the models.py file. When I run python manage.py inspectdb I still see the model I build and my admin/user stuff. I have tried migrating but it says no migrations. I also made sure to install mysql. I imagine I am missing … -
Why it Printing out different name? in Django
I want to Print all the result same. my code: models.py: class Product(models.Model): name = models.CharField(max_length=100) image = models.ImageField(upload_to='images') description = models.TextField(max_length=10000, blank=True, null=True) category = models.ManyToManyField(Category, related_name='category') company = models.ForeignKey(Company, related_name='company', on_delete=models.CASCADE) price = models.IntegerField() discount = models.IntegerField(default=0) views.py: excludeCompanyId = [] company = Company.objects.all().order_by('?').exclude(id__in=excludeCompanyId)[:1]#random 1 company companyName = company[0].name print(companyName) companyProduct = Product.objects.filter(company=company).order_by('?')[:10] print(companyProduct[0].company) for i in companyProduct: print(i.company) Result will be different at different time. But I want to show you one result: Tesla Apple Inc. Sony Sony Sony Sony I want to print all the result same. how do i do that? -
Python Pickle.dump UTF8
im using this codes to make chatbot in python: https://data-flair.training/blogs/python-chatbot-project/comment-page-5/ The problem is this code do not run probably when im using Arabic words. I think the problem is in pickle to dump words in utf8. Please help me to reslove this problem -
Facing issues in running django server
Hey i'm learning a python course and just came upon using django...but as i clear the command: python manage.py runserver in the terminal its giving the error C:\Users\Owner\Desktop\vs code>python manage.py runserver python: can't open file 'manage.py': [Errno 2] No such file or directory Plus it turns out there's some problem with my manage.py file(which does exist) showingImport "django.core.management" could not be resolved from sourceand the issue is in line 8 : #!/usr/bin/env python import os import sys if name == 'main': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv) Can someone pls help me out with this? -
gunicorn.socket: Failed with result 'service-start-limit-hit' , what should i do now?
As i was following the guide https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04 when i used sudo journalctl -u gunicorn.socket i got the following error -- Logs begin at Mon 2021-05-31 02:03:42 UTC, end at Sat 2021-06-05 13:11:38 UTC. -- Jun 02 11:04:28 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: Listening on gunicorn socket. Jun 02 11:06:38 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: gunicorn.socket: Failed with result 'service-start-limit-hit'. Jun 02 11:12:10 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: Listening on gunicorn socket. Jun 02 15:01:32 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: gunicorn.socket: Failed with result 'service-start-limit-hit'. Jun 02 15:15:35 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: Listening on gunicorn socket. Jun 02 15:18:37 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: gunicorn.socket: Failed with result 'service-start-limit-hit'. -- Reboot -- Jun 02 15:20:08 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: Listening on gunicorn socket. Jun 02 15:22:28 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: gunicorn.socket: Failed with result 'service-start-limit-hit'. Jun 02 15:23:31 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: Listening on gunicorn socket. Jun 02 15:43:25 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: gunicorn.socket: Failed with result 'service-start-limit-hit'. Jun 02 15:46:44 ubuntu-s-1vcpu-1gb-blr1-01 systemd[1]: Listening on gunicorn socket. my gunicorn.socket file [Unit] Description=gunicorn socket [Socket] ListenStream=/run/gunicorn.sock [Install] WantedBy=sockets.target my gunicorn.service file [Unit] Description=gunicorn daemon Requires=gunicorn.socket After=network.target [Service] User=developer Group=www-data WorkingDirectory=/home/developer/myprojectdir ExecStart=/home/developer/myprojectdir/myprojectenv/bin/gunicorn \ --access-logfile - \ --workers 3 \ --bind unix:/run/gunicorn.sock \ bharathwajan.wsgi:application [Install] WantedBy=multi-user.target -
FOREIGN KEY constraint failed on django custom user model
I am currently working on a Django project where I am stuck at creating a custom user model I am getting the error FOREIGN KEY constraint failed Please help me solve the error My models.py from django.db import models from django.contrib.auth.models import AbstractBaseUser, UserManager import string import random from .managers import UserManager # Create your models here. def generate_unique_code(): length = 6 while True: code = ''.join(random.choices(string.ascii_uppercase, k=length)) if User.objects.filter(user_name=code).count() == 0: break return code class User(AbstractBaseUser): email = models.EmailField(unique=True, max_length=255) full_name = models.CharField( max_length=50, default='', null=True, blank=True) user_name = models.SlugField(unique=True, default=generate_unique_code) staff = models.BooleanField(default=False) admin = models.BooleanField(default=False) address = models.CharField( max_length=255, default='', null=True, blank=True) phone_no = models.CharField( max_length=11, default='', null=True, blank=True) USERNAME_FIELD = "email" REQUIRED_FIELDS = ['user_name', 'phone_no', 'address', 'full_name'] objects = UserManager() def __str__(self): return self.email def get_full_name(self): return self.full_name def get_username(self): return self.user_name def get_email(self): return self.email def get_address(self): return self.address def get_phone_no(self): return self.phone_no def has_perm(self, perm, obj=None): return True def has_module_perms(self, app_label): return True @property def is_staff(self): return self.staff @property def is_admin(self): return self.admin My managers.py from django.contrib.auth.models import BaseUserManager class UserManager(BaseUserManager): def create_user(self, email, user_name, full_name="", address="", phone_no="", password=None, is_staff=False, is_admin=False): if not email: raise ValueError("Users must have an email address") if not password: … -
django.urls.reverse(): URL-encoding the slash
When one supplies URL args or kwargs to a django.urls.reverse() call, Django will nicely URL-encode non-Ascii characters and URL-reserved characters. For instance, given a declaration such as path("prefix/<stuff>", view=MyView.as_view(), name="myurl") we get reverse('myurl', args=['aaa bbb']) == "/prefix/aaa%20bbb" reverse('myurl', args=['aaa%bbb']) == "/prefix/aaa%25bbb" reverse('myurl', args=['Ä']) == "/prefix/%C3%84" and so on. So far, so good. What Django will not encode, however, is the slash: reverse('myurl', args=['aaa/bbb']) will give us django.urls.exceptions.NoReverseMatch: Reverse for 'myurl' with arguments '('aaa/bbb',)' not found. 1 pattern(s) tried: ['prefix/(?P<stuff>[^/]+)$'] (The question what to encode and what not has been discussed as a Django issue. It's complicated.) I found a remark in the code that may explain why the slash is a special case: _reverse_with_prefix in django/urls/resolvers.py contains a comment that says # WSGI provides decoded URLs, without %xx escapes, and the URL # resolver operates on such URLs. First substitute arguments # without quoting to build a decoded URL and look for a match. # Then, if we have a match, redo the substitution with quoted # arguments in order to return a properly encoded URL. Given that unencoded arguments are used in the matching initially, it is no wonder that it does not work: The slash looks like the … -
Why private route is not accessible even after login success?
If I am logged out and try to access private route I am successfully redirected to login page, but even after login private route is not accessible to me code in App.js App.js code in PrivateRoute.js PrivateRoute.js -
Why does Django REST Framework Router break query parameter filtering?
In the Django REST Framework Tutorial quickstart, views are added to the default router: // project/urls.py router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) My project layout is project/ stuffs/ I include the stuffs application in the default router: router.register(r'stuffs', views.StuffViewSet) The stuffs/ endpoint is then nicely listed in the API Root list of endpoints: HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accept { "users": "http://localhost:8000/users/", "groups": "http://localhost:8000/groups/", "stuffs": "http://localhost:8000/stuffs/" } A Stuff object has a relationship to a owner model class and to filter for objects belonging to a certain owner, I intend to use a request such as: stuffs/?owner_id=abc In order to do so, and here is where I'm not sure if it is correct, I introduced an urls.py configuration in the stuffs app: // stuffs/urls.py urlpatterns = format_suffix_patterns([ path('stuffs/', stuffs_views.StuffList.as_view()), path('stuffs/<int:pk>/', stuffs_views.StuffDetail.as_view()), re_path(r'^stuffs/(?P<owner_id>.+)$', stuffs_views.StuffsList.as_view()) ]) using the below StuffsList class based view: class StuffList(generics.ListCreateAPIView): serializer_class = StuffSerializer def get_queryset(self): queryset = Stuff.objects.all() owner_id = self.request.query_params.get('owner_id') if owner_id is not None: queryset = queryset.filter(owner__short_id=short_id) return queryset I'm pretty sure this view is correct, because when I remove the View Set from the default router, the query works. However, when the viewset is registered in the default router, when … -
Display the ImageField in HTML with Django 3.2
Im begginer Dev, i got some trouble to understand the mechanics of ImageField. I made a model Article with an image to illustrate it, in my admin i also added the field that made possible the injection in a folder named uploads. I saw many tutorial who explain how to do it, but i have trouble to apply it. I made migrations and migrate, and it work. From my admin pannel i can put the file i want and it drag in into the "uploads" folder. Now i want to display this ImageField from the HTML. I know, urls and views need to be edited for the thing i want, but i miss understand how, after readed some tutorials i still failling. Here is my project and the related files: admin models urls html views I also thanks ppl who will help me :) -
Django:How to add field dynamically?
I want to dynamically add new input field for cylinder to a Django formset, so that when the user clicks an "add" button it runs JavaScript that adds a new input for cylinder field in IssueForm to the page but instead of adding only one field, the entire form is getting added. Expected Output:- How do I execute for this or there is any better way of doing this? Model:- class IssueCylinder(models.Model): cylinder=models.ForeignKey('CylinderEntry',on_delete=models.CASCADE) userName=models.CharField(max_length=60,null=False) issueDate=models.DateTimeField(default=timezone.now) def save(self,*args,**kwargs): if not self.pk: if self.cylinder.Availability=='Available': CylinderEntry.objects.filter(cylinderId=self.cylinder.cylinderId).update(Availability=('Issued')) CylinderEntry.objects.filter(cylinderId=self.cylinder.cylinderId).update(issue_Date=self.issueDate) CylinderEntry.objects.filter(cylinderId=self.cylinder.cylinderId).update(issue_user=self.userName) super().save(*args,**kwargs) def __str__(self): return str(self.userName) view :- @login_required def issue(request): if not request.user.is_superuser: return redirect('index') issueformset=modelformset_factory(IssueCylinder,form=IssueForm,extra=1) if request.method=='POST': formset=issueformset(request.POST or None) insatnce=formset.save(commit=False) if formset.is_valid(): for form in formset: form.save() formset=issueformset(queryset=IssueCylinder.objects.none()) return render(request,'issue/issue_form.html',{'formset':formset}) form:- class IssueForm(forms.ModelForm): class Meta: model=IssueCylinder fields='__all__' Template:- <form id="form-container" method="POST"> {% csrf_token %} {{formset.management_form}} {% for form in formset %} <div class="row form-row spacer"> <div class="col-2"> <label>{{form.cylinder.label}}</label><br><br> <label>{{form.issueDate.label}}</label><br> <label>{{form.userName.label}}</label> <hr> </div> <div class="col-4 "> <div class="input-group " > {{form.cylinder}} <div class="input-group-append"> <button class="btn btn-success add-form-row" id="add_more">+</button> </div> </div> <div class="input-group"> <br> {{form.issueDate}} {{form.userName}} </div> </div> </div> {% endfor %} <div class="row spacer"> <div class="col-4 offset-2"> <button type="submit" class="btn btn-block btn-primary">Submit</button> </div> </div> </form> script:- <script type='text/javascript'> $(document).ready(function () { $('body').on('click', '#add_more', function … -
Import "blocktunes" could not be resolved Pylance report Missing Imports
urls.py from django.contrib import admin from django.urls import path, include from blocktunes import views #error in blocktunes urlpatterns = [ path('', include('blocktunes.urls')), path('admin/', admin.site.urls), path('', views.UserRegister_view) ] Why is it showing missing imports? settings.py INSTALLED_APPS = [ 'blocktunes.apps.blocktunesConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] PLEASE HELP. Image link of structure of apps [1]: https://i.stack.imgur.com/YhPEg.png -
Django - Suggestions with building a minimal one-to-one chat app (Potentially using Web Sockets)
My next challenge is to build a minimal realtime chat application where my users of my application can send direct one-to-one messages to each other. With this being said, I have researched online in to building realtime chat apps and many of which I have seen refer to building "group" chats through using Django Channels. Secondly, I have also looked in to tutorials which provide guidance on how to build an AJAX refresh based chat app (without Web Sockets) but I thought this approach would be inefficient with the heavy strain on my server this could cause as my user base grows. I am wanting to reach out on here and ask - Is there any existing Django Libraries out there for building efficient one-to-one chat apps (Without WebSockets) or would I be better served using WebSockets? And if I was to use the WebSockets approach with Django-Channels and ASGI, are there any recommended tutorials or chat libraries which I can use to help kickstart the development of my chat app? I'm eager to learn, but I just need a little direction with understanding where my initial starting point and focus should be. As simple as what my vision is, … -
Show and modify local Json file from a web page using python
ive written a script, that stores its configuration in a local json file. The script runs in a continuous loop and loads the configuration at startup. Because i will run my script in a headless machine, i thought on writing a small web app to allow me to view and modify this json file and reload the script if a change is made Also it would be handy to show some stats and maybe the console output logs in the web page I can program in python but im totally new in web development. I did some research and flask looks to be the easiest way My idea is to load the json tree in a web page in a user friendly way, and allow you to modify the 'value' part of each 'key' in the json from a nice edit box or something. I would also need to add key value sub pairs for some given keys Then at the bottom one would have a 'reload' button that would save the updated json file into the file system and reload the script with its new configuration. Im not sure if its best to keep this two separated, one as … -
When I try to do collect static in my Django project i got Post-processing staticfiles\static\css\style.css failed
I am trying this i did not got any solution .. I said Post-processing 'staticfiles\static\css\style.css' failed! but there is no problem on my file . My this project in running on machine without any error you can check my repo here https://github.com/programmer-Quazi/personal-blog.git This is my terminal output after giving this command python manage.py collectstatic Post-processing 'staticfiles\static\css\style.css' failed! Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "C:\Users\faald\AppData\Roaming\Python\Python38\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line utility.execute() File "C:\Users\faald\AppData\Roaming\Python\Python38\site-packages\django\core\management\__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\faald\AppData\Roaming\Python\Python38\site-packages\django\core\management\base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\faald\AppData\Roaming\Python\Python38\site-packages\django\core\management\base.py", line 398, in execute output = self.handle(*args, **options) File "C:\Users\faald\AppData\Roaming\Python\Python38\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 187, in handle collected = self.collect() File "C:\Users\faald\AppData\Roaming\Python\Python38\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 134, in collect raise processed whitenoise.storage.MissingFileError: The file 'staticfiles/static/img/elements/primary-check.png' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x000001F9F6FF3280>. The CSS file 'staticfiles\static\css\style.css' references a file which could not be found: staticfiles/static/img/elements/primary-check.png Please check the URL references in this CSS file, particularly any relative paths which might be pointing to the wrong location. my settigns.py file is """ Django settings for djangoProject4 project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full … -
Django: reducing inventory and change model display format in admin
I'm trying to make a website where users can register an account and sign up for different courses via stripe. I buildt the system with an Order -> OrderItem -> Product (Kurs) model. Thanks to great tutorials I have been able to make most of what I want but I am still a beginner and now I'm having a hard time figuring stuff out. After signing up an account the users can view all courses that have been added to the course model and add them to a basket and procceed to checkout the orders in the basket. When stripe signals the payment_intent_succeeded all the products from that order change billing_status to 'True'. I am able to see all Orders and the OrderItem from the django admin view but now I am missing two features that I can't figure out how to add. 1. To reduce integerField "ledige_plasser" in the Product model (called Kurs in my code) model after each purchase is made. 2. To view the all the orders for a certain Kurs (product) in the django admin in a readable way. Is there any way I can setup the django admin to display all users that have signed … -
Is Heroku using Dedicated Servers
Is Heroku using Dedicated Servers? I am using Django and I want to know whether Heroku is using Dedicated servers or not, and what Django Deploy platforms use Dedicated Servers, Thanks. -
getting unicode characters as response when trying to download excel file using Django-Rest-Framework
I am working on application where I am required to download the excel files saved in the project media directory on clicking the download button using react. I have written an api for it, from the answers I found to download the file using django rest framework but postman is giving me a response that is unicode characters. Here is my DRF views: def download(self): file_name= 'reports.xlsx' file_path = (settings.MEDIA_ROOT +'/'+ file_name).replace('\\', '/') file_wrapper = FileWrapper(open(file_path,'rb')) file_mimetype = mimetypes.guess_type(file_path) response = HttpResponse(file_wrapper, content_type=file_mimetype ) response['X-Sendfile'] = file_path response['Content-Length'] = os.stat(file_path).st_size response['Content-Disposition'] = 'attachment; filename=%s' % str(file_name) return response I would really appreciate if somebody could help me resolve it. Thank you! -
How to restrict non logged in users from accessing the api data
Here are the permissions.py from rest_framework import permissions from rest_framework.permissions import BasePermission, SAFE_METHODS class ReadOnly(permissions.BasePermission): def has_permission(self, request, view): return request.method in SAFE_METHODS How to modify this so only logged in users can access the data -
django-simple-captcha Don't work when DEBUG=False
I'm working on Django 2.2 and DjangoCMS 3.7.4 I'm facing a problem with django-simple-captacha I've follow the instalation guide (https://django-simple-captcha.readthedocs.io/en/latest/usage.html#installation)It's working when DEBUG=True but when Debug=False in settings.py I got a 500 on when I try to send a contact form. Here my urls.py: # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from cms.sitemaps import CMSSitemap from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.static import serve from django.views.generic import TemplateView from .views import career_form, contact_form, mentions admin.autodiscover() urlpatterns = [ url(r'^mentions/$', mentions, name='mentions'), url(r'^sitemap\.xml$', sitemap, {'sitemaps': {'cmspages': CMSSitemap}}), ] urlpatterns += i18n_patterns( url(r'^captcha/', include('captcha.urls')), url(r'^admin/', admin.site.urls), # NOQA url(r'^ckeditor/', include('ckeditor_uploader.urls')), url(r'^', include('cms.urls')), url(r'^career/', include('career.urls')), url(r'^carreer_form', career_form, name='career_form'), url(r'^contact_form', contact_form, name='contact_form'), ) urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # This is only needed when using runserver. if settings.DEBUG: urlpatterns = [ url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), ] + staticfiles_urlpatterns() + urlpatterns My installed app in settings.py: INSTALLED_APPS = [ 'djangocms_admin_style', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.staticfiles', 'django.contrib.messages', 'ckeditor', 'ckeditor_uploader', 'djangocms_text_ckeditor', 'cms', 'menus', 'sekizai', 'treebeard', 'filer', 'easy_thumbnails', 'djangocms_column', 'djangocms_file', 'djangocms_link', 'djangocms_picture', 'djangocms_style', 'djangocms_snippet', 'djangocms_googlemap', 'djangocms_video', 'absolute', … -
Spring boot looks more boiler plate than Django
In Django to create a model we have to just do: class Sample(models.Model): sample = models.CharField(max_length=100) and later to all the operations are very easy Sample(sample="test").save(), Sample.objects.all() etc Where as in spring boot we have to first define an entity and then a repository for that entity and then do all the operations @Entity @Table(name = "sample") public class Sample { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String sample; public Sample() { } public Sample(String sample) { this.sample = sample; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getSample() { return sample; } public void setSample(String name) { this.sample = sample; } @Repository public interface SampleRepository extends JpaRepository<Sample, Long> { } Then @Service public class SampleService { @Autowired private SampleRepository sampleRepository; public List<Sample> findAll() { return (List<Sample>) SampleRepository.findAll(); } } Is there any easy way like Django. Even the time to understand to this level is also a lot -
how to send user it with access jwt token in drf
Currently I'm using JWT token in django rest framework, while using login api, i just get refresh token & access token. I'm wondring if could send the user id with these tokens too(i have no idea on if it's possible or not) currently { "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYyMjk3NzY2OCwianRpIjoiYWE2ZTk0NWNiYjRjNDAxZmFiMmM2NWEzZWQ1Yzg5NDUiLCJ1c2VyX2lkIjoxfQ.a54fcfa0ZsFrfVrb1VTdRO6bXY47NOuZqO8T1I3yKCc", "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjU0NDI3MjY4LCJqdGkiOiI1ODEwNDQyZWU3ZTM0MzczYTBkNmEzMDBkYmRmYTg2MyIsInVzZXJfaWQiOjF9.d6fmMq6ddsCaCyAEbDDaE5aja04LxYZmRP8WHfpmJqs" } what i want { "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYyMjk3NzY2OCwianRpIjoiYWE2ZTk0NWNiYjRjNDAxZmFiMmM2NWEzZWQ1Yzg5NDUiLCJ1c2VyX2lkIjoxfQ.a54fcfa0ZsFrfVrb1VTdRO6bXY47NOuZqO8T1I3yKCc", "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjU0NDI3MjY4LCJqdGkiOiI1ODEwNDQyZWU3ZTM0MzczYTBkNmEzMDBkYmRmYTg2MyIsInVzZXJfaWQiOjF9.d6fmMq6ddsCaCyAEbDDaE5aja04LxYZmRP8WHfpmJqs", "userid": <id> } -
Migrate native app (android/ios) to react
I have a situation that maybe you can help and would love to hear your opinions. I have an app from a startup with android and iOS version and the backend with Django. Right now is so expensive to maintain because there’s different technologies and I was wondering if to migrate to a multi platform technology as Reactjs (PWA) and maybe use firebase as a service for backend. The app is live now (pinwins) but it’s a MBP that needs corrections and development. Its has been developed by an agencie and for the moment I can count on a junior profile on react. What do you think? Would you keep working in this one or would you migrate to a new technology with more agile development? (In this case what would be the best way?) Thanks a lot in advance, Have a nice weekend!