[Python] CaveCMS

Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    beep Bui is offline
    MemberRank
    Jan 2012 Join Date
    United KingdomLocation
    459Posts

    note [Python] CaveCMS

    CaveCMS

    This something I've been keen on trying out for quite a while. I'm currently in the process of writing a CMS in Python, so far the name has been decided as CaveCMS. Don't ask why.

    I'll be developing this at my own pace: admittedly I do have a lot on my plate at the moment, but this will get done as I slowly progress through it. Once it's in a usable state I'll put up the source on a scm repository, as well as a demo.

    CaveCMS uses Flask as its web framework; the variety of extensions as well as Jinja made it a great choice to write the CMS in. For the design, I'll use Bootstrap with the "United" swatch from Bootswatch. I won't be using any (if any) Habbo assets since I want to release the whole thing under an open source license (MIT).

    Screenshots so far:
    Spoiler:


    Not much, I know. The design isn't (currently) something I'm focusing on.

    Snippets:
    Login view:
    Spoiler:
    Code:
    @no_login
    @cave.route('/login', methods=['GET', 'POST'])
    def login():
        if request.method == 'GET':
            return redirect(url_for('index') + '#login')
    
        form = LoginForm(request.form)
        if form.validate_on_submit():
            user = User.query.filter_by(username=form.login_username.data).first()
            if user and user.password == hashlib.md5(form.login_password.data).hexdigest():
                login_user(user)
                flash('Welcome back, %s!' % user.username)
                return redirect(url_for('me'))
            flash('Invalid username or password.')
        return render_template('index.html', form=form)
    Landing jinja2 template:
    Spoiler:
    Code:
    {% extends 'layout.html' %}
    {% block title %}Home{% endblock %}
    {% block body %}
    {% for e in form.errors %}
      {% if e.startswith('login_') %}
        <script type="text/javascript">
          $(document).ready(function(){showLogin();});
        </script> {% break %}
      {% endif %}
    {% endfor %}
              <h1>Welcome to {{ config['HOTEL_NAME'] }}!</h1>
              <p>{{ config['HOTEL_NAME'] }} is a free, fun virtual world where you can build your own rooms, chat to your friends, and make new ones!</p>
    
              {% for flash in get_flashed_messages() %}
              <div class="alert">{{ flash}}
              {% endfor %}
    
              {% for error in form.errors %}
              <div class="alert alert-error">{{ error }}</div>
              {% endfor %}
    
              <div class="well">
                <button class="btn btn-large btn-primary" type="button" id="hp-login-btn">Log in</button>
                <button class="btn btn-large btn-success" type="button" id="hp-register-btn">New here? Register!</button>
    
                <div id="hp-login-form">
                  {% from '_render.html' import render %}
                  <form action="login" method="POST">
                    <fieldset>
                      <legend>Log in to {{ config['HOTEL_NAME'] }}</legend>
                      {{ form.csrf_token }}
                      {{ render(form.login_username) }}
                      {{ render(form.login_password) }}
                      <button class="btn btn-large btn-primary" type="submit" id="hp-login-btn">Log in</button>
                      <span style="padding-left:15px">Don't have an account? <a href="#register" id="hp-loginreg-a">Register now!</a>
                </div>
              </div>
    
              <div id="ws-content">
                <div class="alert">TODO: Add filler content, maybe features?</div>
              </div>
    {% endblock %}

    I'll keep this thread update as I go along. Advice, feedback or suggestions are greatly appreciated!


  2. #2
    Alpha Member Emily is offline
    MemberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [Python] CaveCMS

    I love Python! Good luck with it!

  3. #3
    beep Bui is offline
    MemberRank
    Jan 2012 Join Date
    United KingdomLocation
    459Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by Tha View Post
    I love Python! Good luck with it!
    Thanks! Currently working on the front-end a little. Going to design the /me page, then work on registration. Logging in and signing out are done.

  4. #4
    Boomshakalaka resize is offline
    MemberRank
    Dec 2011 Join Date
    286Posts

    Re: [Python] CaveCMS

    Good luck with this man!

  5. #5
    apt-get install xcowsay 3M1L is offline
    MemberRank
    Jul 2012 Join Date
    SwedenLocation
    268Posts

    Re: [Python] CaveCMS

    Python is my favorite :)

    Goodluck with it!

  6. #6
    beep Bui is offline
    MemberRank
    Jan 2012 Join Date
    United KingdomLocation
    459Posts

    Re: [Python] CaveCMS

    This is what /me looks like so far. I'm not the best at designing, so this may change later. I'll add more links and things to the sidebar later on when I get to them.


  7. #7
    Alpha Member Emily is offline
    MemberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by Bui View Post
    This is what /me looks like so far. I'm not the best at designing, so this may change later. I'll add more links and things to the sidebar later on when I get to them.

    Looks ok, but I don't like the character sitting in that corner.
    Also.. dicks? Why not vagina's?

  8. #8
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by Tha View Post
    Looks ok, but I don't like the character sitting in that corner.
    Also.. dicks? Why not vagina's?
    Because you're scared of vaginas

  9. #9
    beep Bui is offline
    MemberRank
    Jan 2012 Join Date
    United KingdomLocation
    459Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by Tha View Post
    Looks ok, but I don't like the character sitting in that corner.
    Also.. dicks? Why not vagina's?
    I'll probably move it somewhere fancy; not too sure where to place the user's look to be honest. I'll stick to something later.

    Couldn't think of any better placeholder text, on /me I suppose there will be newsposts and whatever else I think of putting in the content area.

  10. #10
    Proficient Member AluxH is offline
    MemberRank
    Mar 2012 Join Date
    184Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by Bui View Post
    This is what /me looks like so far. I'm not the best at designing, so this may change later. I'll add more links and things to the sidebar later on when I get to them.

    Not bad. You might want to make the button icons white too, though.

  11. #11
    beep Bui is offline
    MemberRank
    Jan 2012 Join Date
    United KingdomLocation
    459Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by AluxH View Post
    Not bad. You might want to make the button icons white too, though.
    I think I'm just gonna scrap the buttons and put up a proper navbar.

  12. #12
    Proficient Member AluxH is offline
    MemberRank
    Mar 2012 Join Date
    184Posts

    Re: [Python] CaveCMS

    It would be nice to have a CMS that doesn't look like a bootstrap example... :P

  13. #13
    beep Bui is offline
    MemberRank
    Jan 2012 Join Date
    United KingdomLocation
    459Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by AluxH View Post
    It would be nice to have a CMS that doesn't look like a bootstrap example... :P
    But it's not: sticky navbars are a feature of Bootstrap.

    I might make the whole thing work with AJAX once you're in /me (eg. clicking news tab fetches and displays news), might be cool.

  14. #14
    Novice Generik is offline
    MemberRank
    May 2013 Join Date
    4Posts

    Re: [Python] CaveCMS

    Python is a horrible language. Goodluck, however. Glad to see some variety in the community. :)

  15. #15
    Proficient Member AluxH is offline
    MemberRank
    Mar 2012 Join Date
    184Posts

    Re: [Python] CaveCMS

    Quote Originally Posted by Bui View Post
    But it's not: sticky navbars are a feature of Bootstrap.

    I might make the whole thing work with AJAX once you're in /me (eg. clicking news tab fetches and displays news), might be cool.
    It's not that big of a deal, I'm just sick of bootstrap everywhere you go on the web. I understand, though, that some developers don't want to worry about UI design and bootstrap is an easy and attractive looking solution.

    Quote Originally Posted by Generik View Post
    Python is a horrible language. Goodluck, however. Glad to see some variety in the community. :)
    Python is a great language. Easy to learn, wide distribution, long history, good standard library, plenty of third party libraries for every job out there...

    There's no excusing the whitespace but once you just get on with it and use a proper text editor with auto indentation you'll forget all about it.



Page 1 of 3 123 LastLast

Advertisement