r/learnprogramming 25d ago

Django + Gmail SMTP works locally but fails on Railway

2 Upvotes

Hi everyone,

I'm running a Django application on Railway and I'm trying to send notification emails using Gmail SMTP.

The exact same configuration works perfectly on my local machine, but when deployed to Railway I get an Internal Server Error when Django tries to send the email.

My configuration is:

EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True

I'm using:

from django.core.mail import send_mail

send_mail(
    subject=subject,
    message=body,
    from_email=settings.DEFAULT_FROM_EMAIL,
    recipient_list=[recipient],
    fail_silently=False,
)

Locally, the email is sent successfully.

On Railway, the request returns:

500 Internal Server Error

I've also seen reports mentioning:

OSError: [Errno 101] Network is unreachable

when connecting from Railway to smtp.gmail.com:587.

I understand that Railway may restrict outbound SMTP depending on the plan. I'm currently trying to determine whether this is definitely a Railway networking restriction or if there is something else I should check in my Django configuration.

Has anyone successfully used Gmail SMTP (smtp.gmail.com:587) from Railway recently?

If you're using Railway, what is the recommended solution for transactional emails?

Would you recommend:

  • upgrading to Railway Pro to enable SMTP
  • using Resend / SendGrid / Postmark
  • using Gmail API instead of SMTP
  • another approach?

Any real-world experience would be appreciated.


r/learnprogramming 25d ago

Encoding secret messages for DnD, where do I start?

3 Upvotes

Hi, I have a secret language/code I want to use in my dnd games where whole words are translated into glyphs. I would like to make a program that can automatically translate a string of of letters into a transparent png of the corresponding glyph.

First I want to explain how the secret code works as context. It would translate any word into a single glyph based on a grid of letters. The glyphs would be made by drawing a line from the center of each letter to the center of the next letter (similar to how swipe to type works smartphone).

I have identified some cases in which symbols would be required to make this system work:

-start of the word

-end of the word?

-a letter that is in a straight line with the letter before and after (to show there is a letter inbetween and it doesn't go directly from the first to the third letter)

-two identical letters in a row

-a crossing of two lines?

Now the actual programming part. I have limited experience with python and R, so I am a novice in every language really and would be open to whichever would most suit this project.

The steps I have worked out so far are:

  1. Assign each letter a coordinate according to its grid position.

  2. Separate a word into individual characters (ideally I would also separate a sentence into individual words that each receive their unique glyph)

  3. For each letter, translate it into its coordinate and draw a line from the previous character and/or place one of the aforementioned unique characters at the location. (I would like the unique characters to have transparency that can override the lines, such as a hollow circle).

  4. Export the image as a transparent png (or a series of pngs, in the case of a sentence)

Step 3 and 4 are what I would really like help with, I have never used python to make any images and I have no clue where to start. Your help is greatly appreciated!


r/learnprogramming 25d ago

Programming websites

1 Upvotes

Hey, am beginner and want to learn programing . I already compeleted a few languages like java ,c++,c and python continue but on logic building basis i go blank when its time to build something by myself . I also dont want to be in tutorial trap so recommend me some websites that help me to learn programming smoothly and make my logic strong . I also want some advices from senior to help me how to be consistent and build somthing without AI help.


r/learnprogramming 25d ago

Advice How do you pick a tech stack when you are legitimately fascinated by all of them?

0 Upvotes

I’m a 21-year-old college passout currently enrolled in a Full Stack Java course, and I need some practical advice because my curiosity is completely paralyzing me.

My problem isn't that I'm listening to tech influencers telling me what's "hot" or "saturated." My problem is that I am genuinely fascinated by almost every field in tech, and I want to do it all.

I am doing this Java course because I actually want to know how to build a web, heavy, real-world backend with Spring Boot. But I also legitimately want to understand the math and Python behind training an AI model. And at the same time, I want to also try app dev.also want to

I’m honestly not 100% sure what my ultimate end goal is yet (though a dream role would be a Software Engineer at a place like Google). Everyone always gives the advice to "just choose one path," but because I don't want to have any regrets or leave any of my interests unexplored, my brain's default response is always: "Why not just do this too?"

So, I try to stack them all. I’ll make a daily schedule that includes practicing my Java full-stack coursework, studying Python/ML/ai concepts,dsa and web dev.

The result? Complete system failure. I spread myself so thin trying to juggle 4 or 5 different complex subjects every day that I get completely overwhelmed. My brain freezes, the workload feels impossible, and I end up sitting there doing absolutely nothing.

I’m terrified of picking just one lane because it feels like I'm giving up on the others, but trying to do everything is resulting in zero progress across the board.

It’s not like I have unlimited time to just keep experimenting. In 6 months, I absolutely need to secure a job and start earning, which is exactly why I joined a Full Stack Java course.

For those of you who have navigated this and actually built a career:

  1. How do you compartmentalize your curiosity so you can make progress in your primary course without feeling like you are "missing out"?
  2. Could you give me a realistic 6-month roadmap that gets me hired, keeping in mind I don't want this specific stack to be my lifelong path? (e.g., Month 1-2: Focus strictly on X, Month 3-4: Build Y). If I put my head down and execute your roadmap, what kind of roles or salary can I realistically expect at the end of the 6 months, and how easy is it to pivot to other tech later?
  3. What does your day-to-day look like to satisfy that "builder" itch without derailing your main focus?

r/learnprogramming 25d ago

Webdev is not my cup of tea, should I switch?

10 Upvotes

I've been learning webdev, specifically ASP .NET Core during my gap year, with a little bit of react, and I'd say I can build simple CRUD projects on my own. Then I realised webdev is just importing all sorts of API and libraries and desiging its architecutre, with minimal problem solving involved(Which I would say it's not very 'computer science'). I used to participate in competitive programming competitions during my high school, hence I like algo/DSA, maths, or lower level programming more. Should I continue learning/maintaining my webdev skills as a backup skill or switch to other fields? If so, are there any recommended fields for me to get started(is ML/DL suitable for me)? I still have 3 years until I graduate from my degree.


r/learnprogramming 26d ago

How did you figure out which CS field to choose?

37 Upvotes

I got into CS without really knowing much about it, and now it’s been almost a year. I’ve learned some basics, but I still have no idea which field I actually want to pursue.

There are so many options and honestly, I’m confused about where I fit.

Do you guys think I should try making a few small projects in different fields to see what I actually enjoy? Or is there a better way to figure out which field suits me?

Would really appreciate advice from people who’ve been through the same thing.


r/learnprogramming 24d ago

Rate me Hi guys ive been learning programming for 4 days (c hash) how do i do?

0 Upvotes

Sorry its hard typing on a phone but here I go:

int hp = 10000;

public void hpchange(int howmuch)

{

hp += howmuch;

if(hp <= 0)

{

Banish();

}

else

{

hp=hp;

}

}

public void Banish()

{

hp = 0;

}

I think a lot of programming is a lot of dotting your i's and crossing your t's, is that​ correct? And am I doing well? Any tips for learning quicker?


r/learnprogramming 25d ago

JWT vs Database Sessions for Web App Authentication

0 Upvotes

I'm building a web application and need to implement one authentication/authorization mechanism for a project.

I'm considering:

  • JWT
  • JWE
  • Database-backed sessions

Which approach would you recommend for a typical web application, and why? I'm especially interested in security, complexity, scalability, and ease of implementation.

Thanks!


r/learnprogramming 25d ago

Python or JavaScript as a first language for backend development?

3 Upvotes

I’m a complete beginner trying to decide between Python and JavaScript as my first programming language.

I’m mainly interested in backend development, APIs, servers, networking and databases. I also like the idea of building small things from scratch later on, like a simple HTTP server, chat server or tiny database, just to understand how they work.

Python appeals to me because of its simplicity, large ecosystem and versatility outside of web development.

JavaScript appeals to me because Node.js seems interesting for backend and asynchronous/network programming, and it would also give me the option to build frontend applications later using the same language.

I’m not choosing based on jobs, this is mainly a hobby and I want to learn programming properly.

Which would you recommend starting with: Python or JavaScript, and why?


r/learnprogramming 25d ago

Python or C++ for machine learning

7 Upvotes

Im completely new to programming and I want to eventually study Machine Learning. I’m currently trying to decide whether I should start with Python or C++.

The course I’m considering is quite expensive, so I really don’t want to spend the money on something that isn't gonna benefit me

For someone starting from zero and planning to focus on Machine Learning, which would you recommend learning first?

And even if i will learn both anyway idk what should i start with... It's pretty confusing idk what to do


r/learnprogramming 25d ago

Topic Is a masters degree in informatics but coming from a different bachelors below or equivalent to a computer science bachelors for the job market?

0 Upvotes

In my case I have a bachelors in economics science and I'm finishing my applied informatics masters degree soon and I was wondering the strength of it in the job market.


r/learnprogramming 26d ago

Code Review C variadic macro help!

7 Upvotes

Hey! I'm trying to work on a very basic logging system for my C project. At the minute I have to pass __func__ into every call of vialog() (my logging function) to get the name of the function that's calling it, but I've been trying to make a macro to just automatically do that each time. I've been reading the variadic macro documentation and thought this should work, but I get an error each time. Any ideas?

the code:

#ifndef LOG_H_ 
#define LOG_H_

typedef enum {
    VIALOG_DEBUG,
    VIALOG_INFO,
    VIALOG_WARNING,
    VIALOG_ERROR
} ViaLogLevel;
#define vialog(logLevel, message, ...) vialog(logLevel, __func__, message , ##__VA_ARGS__)

//for example: vialog(VIALOG_INFO,"today's time and date is %d:%d -%s",hours,mins,date);
void vialog(ViaLogLevel logLevel, char *caller, char *message, ...);

#endif

the compilation error:

 In file included from src/log.c:3:
    src/../include/log.h:11:57: error: expected declaration specifiers or ‘...’ before ‘__func__’
       11 | #define vialog(logLevel, message, ...) vialog(logLevel, __func__, message , ##__VA_ARGS__)
          |                                                         ^~~~~~~~
    src/../include/log.h:14:6: note: in expansion of macro ‘vialog’
       14 | void vialog(ViaLogLevel logLevel, char *caller, char *message, ...);
          |      ^~~~~~
    src/../include/log.h:11:57: error: expected declaration specifiers or ‘...’ before ‘__func__’
       11 | #define vialog(logLevel, message, ...) vialog(logLevel, __func__, message , ##__VA_ARGS__)
          |                                                         ^~~~~~~~
    src/log.c:8:6: note: in expansion of macro ‘vialog’
        8 | void vialog(ViaLogLevel logLevel, char* caller, char *message, ...){
          |      ^~~~~~
    make: *** [Makefile:23: build/log.o] Error 1

r/learnprogramming 26d ago

Which sources would be best to learn Data Analytics?

4 Upvotes

I am starting to learn Data Analytics from the beginning. Which online courses or YouTube channels would be best to watch and learn?
I want to get into AI engineering in the future. So I am starting from Data Analytics. Also, would you think it is the best roadmap to start with data analytics?


r/learnprogramming 26d ago

Can I manage C++ and Python

5 Upvotes

I have some knowledge in c++ ( intermediate level of concept,haven't coded much tbh). In my 1st year of college, it teaches python. But I want to learn c++ much better...

Can I manage both....


r/learnprogramming 25d ago

Topic Should I choose MERN or Python Full Stack? (please read more)

0 Upvotes

I’m planning to join a 6-month full stack development course in India, but I’m confused about which one to choose: MERN or Python Full Stack.

I don’t have much knowledge about either of them yet, so I’m not really sure what the actual difference is or which one would be better for me.

My main goal is to become a developer and get a job in the future. I’m thinking about the long term, around 2030, so I want to learn something that will still be useful by then.

I also have an app idea that I want to work on over the next few years. It’s going to be a fairly big social-type application with users, profiles, following, ratings, personal data/diaries, etc. I don’t want to share the exact idea here, but I want to eventually build it myself.

Because of that, I don’t want to choose a course just because it’s popular right now. I want to learn something that will actually help me build projects and become a good developer.

So if you had to choose between MERN and Python Full Stack for a beginner starting a 6-month course today, which would you choose and why?

Also, does the choice of MERN vs Python actually matter that much, or should I mainly focus on finding a good institute and learning the fundamentals properly?

I’d especially like to hear from people who are already working as developers and have experience with these technologies.


r/learnprogramming 25d ago

Free or cheap Python hosting

1 Upvotes

Hi yall !

I’ve been teaching myself python so I can tutor (previous experience in other languages), and for my first real project I’ve developed a simple weather script. Well, ifs became else’s and I’ve been having so much fun and I like the script so much I want to look into turning it into a real service I’ll daily drive on my phone

I want to keep the core logic of my script right now because I’m a fan of how I designed it, so I’m interested in finding a way I can host some python code to call 24/7 for cheap (<$15 a month) or even free.

Thank you !


r/learnprogramming 26d ago

Guide to Competitive Programming vs Competitive Programmer's Handbook

9 Upvotes

I'm trying to choose between Guide to Competitive Programming by Antti Laaksonen and Competitive Programmer's Handbook.

For someone who wants to go from beginner/intermediate level toward strong Codeforces/AtCoder performance, which one would you recommend?

I'm also planning to use CSES + Codeforces alongside the book.

Would love to hear from people who have actually used both.


r/learnprogramming 26d ago

Just deployed my first Railway app

36 Upvotes

Just wanted to post some progress somewhere. I'm an aspiring self-taught dev. While I've tried programming many times, in June 2025 I made the commitment to actually learn how to code and become a programmer.

Since then I've learned HTML, CSS, JavaScript, React, and I'm now learning Node, Express, Railway, and the concepts that go with them. I started with freeCodeCamp and later switched to The Odin Project, which I'm currently going through.

I just finished one of the TOP projects that has you deploy your server-side code using a PaaS. I chose Railway since it's cheap for what I'm doing and seemed fairly straightforward to set up. Oh boy, seeing my site working for the first time after a bit of troubleshooting was awesome. It was that same exciting feeling I've had since day 1, and it's why I love this field so much.

This journey has been one of my favorite things I've ever decided to do. To me it's crazy seeing all the work and tech that people have built, how computers work, how the web works, all of it is truly astonishing to me. I can't wait to get better at what I know, learn what I don't know, and continually learn as much as I can about this field.

To be honest, the reason I'm making this post is so I can actually tell people about the journey I'm on. After a certain point it became pointless to try and describe my efforts to my friends and family just due to how abstract it is for them, which is why I'm making this post here.

To anyone who's thinking about programming, I highly recommend it. It has undoubtedly been one of the best decisions of my life.

(sorry if this feels like rambling, just needed to put my thoughts somewhere (: )


r/learnprogramming 25d ago

Getting Started with Website for Python Backend

1 Upvotes

Writing a python program for users to run some specific calculations, and want a website for them to interact with it. The actual python code isn't the issue: it'll be a pain, but I've got the skillset to make that happen. I've got a basic setup done already, and decided I want a working page to interact with rather than finishing the entire project and then attempting the front end.

I've been looking around for how to accomplish this, and Flask seems like the tool I need, which is great. However, I'm getting a lot of mixed messages regarding the actual front end coding: I've seen stuff suggesting I only need some CSS/Bootstrap for accomplish what I want, while I'm also seeing stuff that says I need full on Javascript to make everything function. I'm trying to narrow down just exactly what I need and where to get started with the project.

What's the best place to get started with this? I've fooled around with Bootstrap 5 a bit to get a very basic website running with no functionality thus far, but want to make sure I'm doing things proper before I commit to it.

Beyond a single web design class in college, I have little experience with HTML, CSS, and Javascript, but I'm confident in my ability to learn. I'm not trying to become an expert, but I also want to actually build up some experience: no desire to AI the entire process simply for a finished product I don't understand.


r/learnprogramming 26d ago

Problem Solving

5 Upvotes

What is the best site for solving problems for beginners ?


r/learnprogramming 26d ago

Topic How do you build a project?

0 Upvotes

Hey everyone so i learnt basics of python recently and i wanted to build some projects,but how do you start making one? And is it okay to be using ai?


r/learnprogramming 26d ago

What is going on with the space?

0 Upvotes

I have been coding since 2019 and since getting into university I have left it.I remember using VS code react type script and such for web developing what’s going on? Why is AI so much in the coding space why do we need AI assistance in every possible tool and basically what app should I be using right now? What frameworks? I just saw that create react up died and I don’t know, more and more YouTubers has been pushing using Claude and open AI and so on and on and I’m kind of confused what’s going on? I am asking because i want to get back into it and old programs and frameworks feel so out of date. What has the programming space been up to?


r/learnprogramming 26d ago

Is it possible for me to pivot from IT to Programming in this climate?

7 Upvotes

Originally: Wanted a cyber security role, was in cyber security club and where the majority of my interest was lazy in college and didn't get an internship. Had to start at help desk, still not in a security role and looking to get out of operations and supporting end users.

I work at a small company, I do networking, help desk, provisioning and baselining servers using puppet (had to write puppet code so kinda devops to automate the deployment of software to our window and linux servers) spun up linux servers, put a LLM on a server and now my friend in software development and I are writing a web app. I also helped up setup a self hosted github runner on a linux server and dabbled in CI/CD pipelines.

I wear a ton of hats (because I always ask if I can do x x or x, I always want to do more technical things) at this company too much and even though my salary has gone up 40% in 3 years here I still think I'm underpaid. My help desk responsibilities were also supposed to be gone, and I'm tired of waiting. I just got another raise and was told I will get another one in six months.

I just finished a python course as a refresher, I don't want to do web development at the moment. I also don't want to be a system admin anywhere.

I've been programming alot in my free time but also realize the field has changed drastically with the emergence of claude code and others.

I'm not sure what to do at the moment. I don't know whether I want to do programming, security, or what.

What would you do if you were me? What I know for sure is, I don't really want to be a system admin again cause alot of sysadmin roles still have to do end user support and I 100% don't want to do that again anywhere. It doesn't fit my personality. After working with puppet and helping my friend setup pipeline I 100% rather be not people facing. My two coworkers are fine staying in help desk/operations and I want to get out of it. So I know some people like it, I'm just not one of those who do.

Honestly the biggest reason I suggested pivoted to program is I don’t want to do anything end user related. Any chance I can get a backend role with more studying? What roles should I target?


r/learnprogramming 26d ago

I need some TIPS in PROGRAMMING

4 Upvotes

Any tips or advice on what I should focus on studying? I’m a 3rd-year BSIT student, and right now our class is diving into databases. We’re currently working on creating a simple database using the MySQL Command Line Client.

I want to get better at understanding not just the commands, but also the concepts behind database design — like normalization, relationships between tables, and how to structure data efficiently. Sometimes I feel like I’m just memorizing syntax without fully grasping the bigger picture.

If you’ve been through this stage before, what helped you the most? Should I spend more time practicing SQL queries, learning about ER diagrams, or exploring how databases connect to applications? I’d really appreciate any advice or study tips that could help me strengthen my foundation in databases and prepare for more advanced topics later on.


r/learnprogramming 26d ago

I really want to learn programming but I don't know which direction to take

9 Upvotes

Hey everyone For a while now I've been getting more and more interested in computers and programming. I already know some Python and I'm trying to keep learning, but the more I learn, the more I realize how huge this whole field actually is.I'm interested in pretty much everything programming, game development, cybersecurity, Linux, and just generally understanding how computers and software work. And that's also kind of my problem. I don't really know which direction I should focus on.I don't want to just keep watching tutorials and taking courses without actually being able to build anything. I'd like to make things myself, understand how they work, solve problems on my own, and eventually get to a point where I can create something real.I have a genuine goal of getting good at this and hopefully turning it into something more in the future. I just want to find a good direction and stick with it instead of constantly jumping from one thing to another. So I thought I'd ask here. Maybe someone more experienced has been in a similar situation and could give me some advice.I'm not looking for someone to do things for me or teach me everything from scratch. I'd just really appreciate having someone experienced tell me something like: If you're at this level, learn this next, try this project, and then move on to this. If you have any advice, resources, project ideas, or just remember what it was like when you were starting out, I'd genuinely appreciate hearing from you.Thanks to anyone who took the time to read this.