SuperGenPy

Creating a Django app with a Postgres db using Docker Compose.

I was following this great tutorial.

To run the app:

docker-compose up command from the top level directory for your project.

The app should be running at port 8000 on your Docker host.

Now that I have my app set and running I want to start creating my content.

I want to create an app where users can login/logout securely and perform CRUD operations with their logins.  That means I will need a Login model. Each login will have some attributes too: a version, length, hash, type and prefix.

Some webs ask you to change your password many times so you can store in this interface the number of the version where you are currently, and don’t have to remember it. Same thing happens with that extras that some webs ask you, like a specific length, or special characters that the SuperGenPass don’t use. If a web asks me about a special character I put it at the beginning of the generated password. This interface would be a great place where you can store all info without compromising your security.

Creating my model.

To be tidy, I am going to create a new app, dashboard, and let know to Django to use it, in supergenpy/settings.py I add ‘dashboard’ to INSTALLED_APPS.

I create my Login model inside models.py and run my migrations:

docker-compose run web python manage.py migrate --noinput

Now, what I want is to see my Login model! For that I create a superuser.

I need the id of my docker-compose container:

docker-compose ps -q

and I run the following command

docker exec -it container_id python manage.py createsuperuser

When you run this command, the server has to be running.

Then, you can return to the browser and login in the admin dashboard (http://localhost:8000/admin/) with the credentials you have set up in the command line when creating the superuser.

After graduating

After a good break with family I am back in London to start looking for a job. Only one hour after I have opened my laptop I got a LinkedIn message from a fintech startup offering an opportunity for a developer. Half an hour later I had a phone call with them! Incredible!

The are looking for a developer working with javascript, node, react native and other softwares. I don’t have any experience with react native but asked them for a week, so I could study and try their code challenge!

Nervous!! But I got the following course. Let’s dive deep into it!

For what I have understood React Native is a fast framework where you can use your knowledge of React.js and JavaScript.

I doesn’t allow you to use HTML tags, it has its own special components compiled to native views:

<div> would be <View>

<input> would be <TextInput>

The logic of the app is not compiled. JS is thread hosted by React Native app. It runs inside a virtual machine inside your native app, the Javascript core, and you still have access to the native platform, the modules and the API. So you create your app with JS and these special components.

Creating a new native app.

There are two different ways:

-expo-cli tool, Expo is a third party service and it gives you a managed app development.Is simplifies the development but it has limits!

-and react native CLI. It is managed by the react team. Bare-bone development.

Expo is easier to use and if any case you need more flexibility you can “eject” and switch to the react native CLI.

Using Expo what you do is install an app, the Expo client, to your native device or simulator that is your phone, laptop… and so your app(all your code and configuration) can be loaded into the Expo App. Expo allows you to publish standalone apps too.